/* TOOFAN checkout — light theme.
   Convention over novelty: this screen's job is to be trusted instantly, so it
   follows established checkout patterns. TOOFAN's gold is the single brand
   thread (progress bar, icons, focus ring); everything else stays neutral so
   the money and the commit button carry the weight. */

:root {
  --canvas: #f5f6f8;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-2: #3f4550;
  --muted: #737b89;
  --line: #e4e7ec;
  --line-strong: #cfd4dc;

  --brand: #a8762b;          /* accessible gold for text/icons on white */
  --brand-soft: #f6efdf;
  --brand-line: #e6d3a8;

  --ok: #0e7c4a;
  --ok-soft: #eaf6f0;
  --ok-line: #bfe3d0;
  --err: #b42318;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -12px rgba(16, 24, 40, .14);
  --ring: 0 0 0 3px rgba(168, 118, 43, .18);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }

/* Any author `display` value beats the UA rule for [hidden], which silently
   un-hides elements the JS thinks are hidden. Enforce it once, globally. */
[hidden] { display: none !important; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100dvh;
  display: flex;
  /* column, so anything above the card (e.g. the staging banner) stacks
     rather than sitting beside it */
  flex-direction: column;
  align-items: center;
  padding: 0 0 3rem;
}
@media (min-width: 34rem) { .page { padding: 3rem 1.25rem 4rem; } }

.card {
  position: relative;
  width: 100%;
  max-width: 27.5rem;
  background: var(--surface);
  overflow: hidden;
}
@media (min-width: 34rem) {
  .card { border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
}

/* progress: a hairline, not a stepper */
.card__progress { height: 3px; background: var(--line); }
.card__progress i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brand), #d4b46a);
  transition: width .5s cubic-bezier(.22, 1, .36, 1);
}

.card__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.15rem 1.35rem 1rem;
}
/* Logo lockup is gold-on-transparent, drawn for dark backgrounds. On this
   light card it needs a slightly darker rendering to hold contrast, and a
   fixed height so the header never shifts while it loads. */
.wordmark {
  height: 1.75rem; width: auto; display: block;
  /* gold-on-transparent reads faint at small sizes on white; deepen it */
  filter: brightness(.62) saturate(1.35) contrast(1.1);
}
.secure {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .75rem; font-weight: 500; color: var(--muted);
}

.ic { width: 20px; height: 20px; flex: 0 0 auto; }
.ic--sm { width: 15px; height: 15px; }

/* summary — the constant anchor */
.summary {
  padding: .85rem 1.35rem;
  background: #fbfbfc;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.summary__main { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.summary__item { font-size: .875rem; color: var(--ink-2); }
.summary__price {
  font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.summary__meta { margin-top: .2rem; font-size: .78rem; color: var(--muted); }
.summary__meta[hidden] { display: none; }

/* stage: content morphs, frame does not */
.stage { padding: 1.35rem; }
.pane[hidden] { display: none; }
.pane { animation: rise .28s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pane { animation: none; } }

.pane__title { font-size: 1.15rem; font-weight: 600; letter-spacing: -.012em; }
.pane__sub { margin-top: .3rem; font-size: .875rem; color: var(--muted); }
.pane__sub b { color: var(--ink-2); font-weight: 600; }

/* fields */
.field { margin-top: 1.1rem; }
.field--full { grid-column: 1 / -1; }
.field__label {
  display: block; font-size: .8rem; font-weight: 500; color: var(--ink-2); margin-bottom: .35rem;
}
.opt { color: var(--muted); font-weight: 400; }

input {
  width: 100%; height: 2.9rem; padding: 0 .8rem;
  font: inherit; font-size: .95rem; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #a6adba; }
input:hover { border-color: #b6bcc7; }
input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[readonly] { background: #f7f8fa; color: var(--muted); }

.phoneinput { display: flex; align-items: stretch; }
.phoneinput__cc {
  display: inline-flex; align-items: center; padding: 0 .7rem;
  font-size: .95rem; font-weight: 500; color: var(--ink-2);
  background: #f7f8fa;
  border: 1px solid var(--line-strong); border-right: 0;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.phoneinput input { border-radius: 0 var(--r-sm) var(--r-sm) 0; letter-spacing: .04em; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .7rem; }

.field__err { min-height: 1.05rem; margin-top: .3rem; font-size: .8rem; color: var(--err); }

/* otp */
.otp { display: flex; gap: .5rem; margin-top: 1.1rem; }
.otp input {
  flex: 1; min-width: 0; height: 3.1rem; padding: 0;
  text-align: center; font-size: 1.15rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* consent block on the OTP screen */
.consent { margin-top: .9rem; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.consent[hidden] { display: none; }
.consent__row {
  display: flex; gap: .7rem; padding: .8rem .9rem;
  font-size: .82rem; line-height: 1.45; color: var(--muted);
}
.consent__row + .consent__row { border-top: 1px solid var(--line); }
.consent__row .ic { color: var(--brand); margin-top: .05rem; }
.consent__row b { display: block; color: var(--ink); font-weight: 600; font-size: .85rem; }
.consent__row span { display: block; }
.consent__row span b { display: inline; font-size: inherit; }

/* payment method */
.method {
  display: flex; gap: .7rem; align-items: flex-start;
  margin-top: .9rem; padding: .9rem;
  background: var(--ok-soft); border: 1px solid var(--ok-line); border-radius: var(--r-md);
}
.method__tick {
  flex: 0 0 auto; width: 1.35rem; height: 1.35rem; border-radius: 50%;
  background: var(--ok); color: #fff; display: grid; place-items: center;
}
.method b { display: block; font-size: .9rem; font-weight: 600; color: var(--ink); }
.method span { display: block; font-size: .82rem; color: var(--ink-2); }

.addrbox {
  margin-top: .9rem; padding: .85rem .9rem;
  border: 1px solid var(--line); border-radius: var(--r-md);
  font-size: .85rem; line-height: 1.55; color: var(--ink-2);
}
.addrbox b { color: var(--ink); font-weight: 600; }
.addrbox .row { display: flex; justify-content: space-between; gap: 1rem; }
.addrbox .row + .row { margin-top: .2rem; }
.addrbox .row--total {
  margin-top: .55rem; padding-top: .55rem; border-top: 1px solid var(--line);
  font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums;
}

/* buttons */
.btn {
  display: block; width: 100%; height: 3.1rem; margin-top: 1.1rem;
  font: inherit; font-size: .95rem; font-weight: 600;
  text-align: center; text-decoration: none; line-height: 3.1rem;
  border: 1px solid transparent; border-radius: var(--r-sm); cursor: pointer;
  transition: background .15s, box-shadow .15s, opacity .15s;
}
button.btn { line-height: normal; }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: #000; }
.btn--commit { background: var(--ok); }
.btn--commit:hover { background: #0b6a3f; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: #f7f8fa; }

.linkbtn {
  background: none; border: 0; padding: 0;
  font: inherit; font-size: .82rem; font-weight: 500; color: var(--brand);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.linkbtn:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.linkbtn:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 3px; }

.finenote { margin-top: .6rem; text-align: center; font-size: .78rem; color: var(--muted); }
.finenote[hidden] { display: none; }
.resend { margin-top: .7rem; text-align: center; font-size: .8rem; color: var(--muted); }

.verified {
  display: inline-flex; align-items: center; gap: .35rem;
  margin-bottom: .5rem; font-size: .8rem; font-weight: 600; color: var(--ok);
}
.autofill {
  display: inline-flex; align-items: center; gap: .35rem;
  margin-top: .5rem; font-size: .8rem; font-weight: 500; color: var(--ok);
}
.autofill[hidden] { display: none; }
.pinhint { min-height: 1.05rem; margin-top: .35rem; font-size: .8rem; color: var(--muted); }

.devcode {
  margin-top: .7rem; padding: .5rem .7rem; text-align: center;
  font-size: .78rem; color: var(--brand);
  background: var(--brand-soft); border: 1px dashed var(--brand-line); border-radius: var(--r-sm);
}
.devcode[hidden] { display: none; }
.devcode b { font-size: .95rem; letter-spacing: .16em; font-variant-numeric: tabular-nums; }

/* done */
.pane--done { text-align: center; }
.done__mark {
  width: 3.25rem; height: 3.25rem; margin: .25rem auto .8rem; border-radius: 50%;
  background: var(--ok); color: #fff; display: grid; place-items: center;
}
.done__mark .ic { width: 26px; height: 26px; }
.pane--done .addrbox { text-align: left; }

/* trust strip */
.trust {
  display: flex; justify-content: center; flex-wrap: wrap; gap: .35rem 1.15rem;
  padding: .9rem 1.35rem 1.15rem;
  border-top: 1px solid var(--line);
  background: #fbfbfc;
}
.trust span {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .74rem; font-weight: 500; color: var(--muted);
}
.trust .ic { color: var(--brand); }

/* busy: a top progress bar that never blocks input */
.busy {
  position: fixed; left: 0; right: 0; top: 0; height: 3px;
  pointer-events: none; z-index: 20; overflow: hidden;
}
.busy[hidden] { display: none; }
.busy__dot {
  display: block; height: 100%; width: 38%;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  animation: slide 1s ease-in-out infinite;
}
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(320%); } }
@media (prefers-reduced-motion: reduce) { .busy__dot { animation-duration: 2.4s; } }

/* live status while the code is checked and the order is created — with no
   button, this is the only thing telling the customer work is happening */
.otpstatus {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  margin-top: .8rem; font-size: .85rem; font-weight: 500; color: var(--ink-2);
}
.otpstatus[hidden] { display: none; }
.otpstatus::before {
  content: ""; width: .95rem; height: .95rem; border-radius: 50%;
  border: 2px solid var(--line-strong); border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
.otpstatus--ok { color: var(--ok); }
.otpstatus--ok::before {
  border-color: var(--ok); border-top-color: var(--ok); animation: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .otpstatus::before { animation-duration: 2.4s; } }

/* Shiprocket S2S requires this consent be surfaced in the brand's own UI */
.srconsent {
  margin-top: .7rem; font-size: .78rem; line-height: 1.45; color: var(--muted); text-align: center;
}
.srconsent b { color: var(--ink-2); font-weight: 600; }

/* Unmissable staging banner. If this is visible, it is not production. */
.stagingbar {
  width: 100%; max-width: 27.5rem; margin: 0 auto .75rem;
  padding: .55rem .9rem; text-align: center;
  font-size: .8rem; font-weight: 600; color: #7a2e0e;
  background: #fff4ed; border: 1px solid #f9c9a8; border-radius: var(--r-sm);
}

/* full delivery details on the confirmation */
.donesec {
  margin-top: .7rem; padding-top: .7rem; border-top: 1px solid var(--line);
  text-align: left; line-height: 1.6;
}
.donesec b { display: block; margin-bottom: .2rem; font-size: .8rem; color: var(--muted); font-weight: 600; }

/* Post-order product information. Factual copy only. */
.prodinfo {
  padding: 1.35rem;
  border-top: 1px solid var(--line);
  background: #fbfbfc;
  font-size: .875rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.prodinfo h2 { font-size: 1rem; font-weight: 600; color: var(--ink); margin-bottom: .5rem; }
.prodinfo h3 {
  font-size: .78rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin: 1rem 0 .25rem;
}
.prodinfo p { margin: 0; }
.prodinfo i { color: var(--ink); font-style: italic; }
