/* Stripe Checkout — visual replica.
   Geometry measured from the live page (js.stripe.com/v3/embedded-checkout-inner.html, 1100px viewport):
   container 888px, summary 444 (padding 32/16), payment card 444 with 32px padding and 1px border,
   12px radius, 16px base font, 36px inputs, 50px payment rows, 55px pay button. */

:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, sans-serif;
  --ink: rgba(26, 26, 26, 0.9);
  --ink-80: rgba(26, 26, 26, 0.8);
  --ink-70: rgba(26, 26, 26, 0.7);
  --ink-65: rgba(26, 26, 26, 0.65);
  --ink-50: rgba(26, 26, 26, 0.5);
  --ink-40: rgba(26, 26, 26, 0.4);
  --hairline: rgba(26, 26, 26, 0.1);
  --blue: #0073e6;
  --link-green: #00d66f;
  --test-orange: #ffde92;
  --ring: 0 0 0 1px #e0e0e0, 0 1px 1px 0 rgba(0, 0, 0, 0.07);
  --ring-focus: 0 0 0 2px #0073e6, 0 1px 1px 0 rgba(0, 0, 0, 0.07);
  --btn-shadow: inset 0 0 0 1px rgba(50, 50, 93, 0.1), 0 2px 5px 0 rgba(50, 50, 93, 0.1),
    0 1px 1px 0 rgba(0, 0, 0, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}

.page {
  width: 888px;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  padding-bottom: 64px;
}

/* ---------- TEST MODE notch ---------- */
.test-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}
.test-notch .tag {
  display: inline-block;
  background: var(--test-orange);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--ink);
}

/* ---------- shell ---------- */
.checkout {
  display: grid;
  grid-template-columns: 444px 444px;
  align-items: start;
}

/* ---------- left column: order summary ---------- */
.summary {
  padding: 32px 16px 0;
}

.merchant {
  margin: 0 0 20px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-65);
}

.currency-label {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 16px;
}

.currency-toggles { display: flex; gap: 8px; }

.currency-btn {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  font: 500 16px/1.15 var(--font);
  color: #000;
  cursor: pointer;
}
.currency-btn.is-active { border-color: #1a1a1a; }
.currency-btn .amount { font-variant-numeric: tabular-nums; }

.currency-btn .flag {
  width: 17px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.flag-eu {
  background: #003399;
  position: relative;
  overflow: hidden;
}
.flag-eu::after {
  content: "";
  position: absolute;
  inset: 2px 4px;
  background: radial-gradient(circle, #ffcc00 0 0.8px, transparent 1.1px) 0 0 / 4px 4px;
}
.flag-us {
  background: repeating-linear-gradient(#b22234 0 1px, #fff 1px 2px);
  position: relative;
}
.flag-us::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 7px;
  height: 6px;
  background: #3c3b6e;
}

.exchange-note { font-size: 12px; line-height: 1.4; color: var(--ink-70); margin-top: 8px; }

/* product line */
.product {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 20px;
}
.thumb {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: #e8eff6;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.product-name { font-size: 14px; line-height: 1.4; }
.product-price { font-size: 14px; line-height: 1.4; text-align: right; margin-left: auto; white-space: nowrap; }

/* totals */
.totals { display: flex; flex-direction: column; margin-top: 28px; }
.totals .row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  font-size: 14px;
  line-height: 1.4;
}
.totals .row:nth-child(1) { margin-bottom: 16px; }
.totals .row:nth-child(2) { margin-bottom: 37px; }
.totals .row:nth-child(3) { margin-bottom: 17px; }
.totals .row:first-child { padding-top: 0; }
.totals .row .amount { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.totals .row .amount.muted { color: var(--ink-70); }
.totals .row.total { font-size: 16px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.totals .row.total .label { font-weight: 500; }
.totals .row.total .amount { font-weight: 500; }

.discount-cell { display: flex; flex-direction: column; gap: 2px; }
.discount-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f5f5f5;
  border: 1px solid rgba(26, 26, 26, 0.08);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}
.discount-sub { font-size: 12px; color: var(--ink-70); }

.info-i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(26, 26, 26, 0.3);
  color: var(--ink-70);
  font-size: 9px;
  line-height: 12px;
  text-align: center;
  display: inline-block;
  font-style: normal;
  vertical-align: 1px;
}

/* ---------- right column: payment ---------- */
.pay {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: #fff;
  padding: 32px;
  min-height: 100%;
}

.express { display: flex; gap: 8px; height: 44px; }
.express button {
  flex: 1 1 0;
  height: 44px;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font);
}
.applepay { background: #000; color: #fff; font-size: 17px; font-weight: 500; }
.linkpay { background: var(--link-green); color: #0a2540; }
.link-logo { display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 30px 0 16px;
  font-size: 12px;
  line-height: 1.15;
  color: var(--ink-50);
}
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

.section-title {
  margin: 0 -8px 8px;
  padding: 8px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
}
.payment-title { margin-top: 3px; margin-bottom: 16px; }

.field { margin-top: 16px; }
.field:first-of-type { margin-top: 0; }
.field label {
  display: block;
  font-size: 16px;
  line-height: 1.3;
  margin-bottom: 4px;
  color: var(--ink);
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
  width: 100%;
  height: 36px;
  padding: 8px 12px;
  font: 400 14px/1.5 var(--font);
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 6px;
  box-shadow: var(--ring);
  outline: none;
  appearance: none;
}
select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
input::placeholder { color: var(--ink-40); }
input:focus, select:focus { box-shadow: var(--ring-focus); }

/* grouped shipping fields — one rounded box, hairline dividers */
.field-group {
  border-radius: 6px;
  box-shadow: var(--ring);
  overflow: hidden;
  background: #fff;
}
.field-group input,
.field-group select {
  box-shadow: none;
  border-radius: 0;
  border-top: 1px solid var(--hairline);
}
.field-group input:first-child,
.field-group select:first-child { border-top: 0; }
.field-group input:focus,
.field-group select:focus { box-shadow: inset 0 0 0 2px #0073e6; }

.field-hint { margin-top: 8px; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: 400 14px/1.15 var(--font);
  color: var(--ink-70);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* payment method accordion — bordered box, hairline dividers */
.methods {
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 3px;
}
.method { border-top: 1px solid var(--hairline); }
.method:first-child { border-top: 0; }
.method-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.3;
}
.method-head .name { flex: 1; }
.method.more .method-head { justify-content: space-between; color: var(--ink); padding: 24px 16px; }

.radio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(26, 26, 26, 0.4);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: #fff;
}
.method.is-open .radio { border-color: #0073e6; }
.method.is-open .radio::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0073e6;
}
.card-icon { flex: 0 0 auto; }
.brand-row { display: flex; gap: 4px; align-items: center; }
.brand-row svg { display: block; }

.method-body { display: none; padding: 0 16px 16px; }
.method.is-open .method-body { display: block; }

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.card-grid .field { margin-top: 0; }

.card-number-wrap { position: relative; }
.card-number-wrap .brand-slot {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 4px;
}
.card-number-wrap input { padding-right: 44px; }

.method-note { font-size: 12px; line-height: 1.4; color: var(--ink-70); margin: 8px 0 0; }

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 30px 0 0;
  font-size: 14px;
  line-height: 1.35;
}
.checkbox-row input {
  margin: 2px 0 0;
  width: 16px;
  height: 16px;
  accent-color: #0073e6;
  flex: 0 0 auto;
}
.checkbox-row label { font-size: 14px; }
.checkbox-row .sub { display: block; color: var(--ink-70); font-size: 12px; margin-top: 2px; }

.pay-btn {
  margin-top: 34px;
  width: 100%;
  height: 55px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font: 400 16px/1.15 var(--font);
  cursor: pointer;
  box-shadow: var(--btn-shadow);
}
.pay-btn:hover { background: #006bda; }
.pay-btn:disabled { opacity: 0.7; cursor: default; }

/* ---------- footer ---------- */
.footer {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 12px;
  line-height: 1.15;
  color: var(--ink-80);
}
.footer .footer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.footer .returns { display: flex; align-items: center; gap: 6px; }
.footer .powered { display: flex; align-items: center; gap: 6px; color: var(--ink-70); }
.footer .links { display: flex; gap: 16px; font-size: 14px; line-height: 1.3; color: var(--ink-70); }
.footer a { color: inherit; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

@media (max-width: 920px) {
  .page { padding: 24px 12px 48px; width: 100%; }
  .checkout { grid-template-columns: 1fr; }
  .pay { border-radius: 12px; padding: 24px; margin-top: 16px; }
  .summary { padding: 24px 12px 0; }
  .test-notch { position: static; transform: none; text-align: center; margin-bottom: 8px; }
}
/* ---------- validation + log badge ---------- */
.field-error {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  color: #df1b41;
  margin-top: 4px;
  min-height: 0;
}
.field-error:empty { display: none; }

.form-alert {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff5f6;
  border: 1px solid rgba(223, 27, 65, 0.25);
  color: #b3093c;
  font-size: 13px;
  line-height: 1.35;
}
.form-alert[hidden] { display: none; }

.log-badge {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  padding: 8px 12px;
  border-radius: 999px;
  background: #1a1a1a;
  color: #fff;
  font-size: 12px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.log-badge:hover { background: #333; }
