/* ==========================================================================
   GOGLOBALSAFE — OSHC application
   The cover period is the product, so the page is built around a measured
   span: a band that draws the time you are covered for, with the price
   hanging off it.
   ========================================================================== */

:root {
  --paper:      #F6F7FB;
  --surface:    #FFFFFF;
  --ink:        #101B33;
  --ink-soft:   #5A6685;
  --cover:      #16786A;
  --cover-dim:  #16786A1F;
  --signal:     #D8542B;
  --edge:       #DCE1EC;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "Noto Sans SC", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 46rem;
  --r: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:    #0B1120;
    --surface:  #131C30;
    --ink:      #E8ECF6;
    --ink-soft: #93A0BE;
    --cover:    #3FB39D;
    --cover-dim:#3FB39D26;
    --signal:   #F0764B;
    --edge:     #26324B;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.nowrap { white-space: nowrap; }

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper);
  padding: .6rem 1rem; border-radius: 0 0 var(--r) 0; z-index: 10;
}
.skip:focus { left: 0; top: 0; }

:where(a, button, input, select, summary):focus-visible {
  outline: 2px solid var(--cover);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--edge);
  background: var(--surface);
}
.masthead-in {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  align-items: baseline; justify-content: space-between;
  padding-block: 1.1rem;
}
.mark-name {
  display: block;
  font-family: var(--display);
  font-weight: 700; font-size: 1.05rem;
  letter-spacing: .04em;
}
.mark-sub {
  display: block;
  font-family: var(--mono);
  font-size: .66rem; letter-spacing: .09em;
  color: var(--ink-soft);
}
.masthead-note {
  margin: 0;
  font-size: .82rem; color: var(--ink-soft);
}

/* ---------- hero ---------- */

.hero { padding-block: clamp(2.75rem, 8vw, 4.5rem) 2rem; }

.eyebrow {
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--cover);
}

.headline {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.1rem, 7.5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -.015em;
}
.headline em {
  font-style: normal;
  color: var(--cover);
  position: relative;
}

.lede {
  margin: 0 0 2rem;
  max-width: 34rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
}
.lede.small { font-size: .95rem; }
.lede strong { color: var(--ink); font-weight: 500; }

/* ---------- forms ---------- */

.quote-form, .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem 1.25rem;
}
.quote-form { margin-bottom: 2.5rem; }

.field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.field-wide { grid-column: 1 / -1; max-width: 26rem; }

.field label {
  font-size: .82rem; font-weight: 500;
  display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap;
}
.field .en {
  font-family: var(--mono);
  font-size: .68rem; letter-spacing: .05em;
  color: var(--ink-soft); font-weight: 400;
}
.req {
  font-family: var(--mono); font-weight: 400;
  font-size: .6rem; letter-spacing: .08em;
  color: var(--signal);
  border: 1px solid currentColor; border-radius: 2px;
  padding: 0 .25em;
}

input[type="text"], input[type="email"], input[type="date"], select {
  font: inherit;
  font-size: .95rem;
  width: 100%;
  padding: .6rem .7rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  transition: border-color .15s ease;
}
input[type="date"] { font-family: var(--mono); font-size: .9rem; }
input:hover, select:hover { border-color: var(--ink-soft); }
input.invalid, select.invalid { border-color: var(--signal); }

.hint { margin: 0; font-size: .76rem; color: var(--ink-soft); }

.check { flex-direction: row; align-items: flex-start; gap: .6rem; }
.check input { margin-top: .3rem; flex: none; width: 1rem; height: 1rem; accent-color: var(--cover); }
.check label { font-weight: 400; font-size: .88rem; }

/* ---------- SIGNATURE: the cover band ---------- */

.band {
  margin: 0;
  padding: 1.5rem 1.4rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--r);
}

.band-caption {
  font-size: .82rem; color: var(--ink-soft);
  margin-bottom: 1.1rem;
}
.band[data-state="ok"] .band-caption { color: var(--cover); }
.band[data-state="error"] .band-caption { color: var(--signal); }

.band-track {
  --fill: 0%;
  position: relative;
  height: 6px;
  background: var(--cover-dim);
  border-radius: 99px;
  margin-bottom: .85rem;
}
/* the 12-month mark — the reference every student compares against */
.band-track::after {
  content: "";
  position: absolute; top: -4px; bottom: -4px; left: 50%;
  width: 1px;
  background: var(--edge);
}
.band-fill {
  position: absolute; inset-block: 0; left: 0;
  width: var(--fill);
  background: var(--cover);
  border-radius: 99px;
  transition: width .45s cubic-bezier(.22,.61,.36,1);
}
.band[data-state="error"] .band-fill { background: var(--signal); }

.band-cap {
  position: absolute; top: 50%;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--cover);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity .3s ease, left .45s cubic-bezier(.22,.61,.36,1);
}
.band-cap-start { left: 0; }
.band-cap-end   { left: var(--fill); }
.band[data-state="ok"] .band-cap { opacity: 1; }
.band[data-state="error"] .band-cap { opacity: 1; border-color: var(--signal); }

.band-ends {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: .75rem;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--ink-soft);
}
.band-date { letter-spacing: .02em; }
.band-date-end { text-align: right; }
.band-span {
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--cover);
  text-align: center;
}

.price {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--edge);
  display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem .9rem;
}
.price-label {
  font-family: var(--mono);
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft);
  flex-basis: 100%;
}
.price-value {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 8vw, 2.9rem);
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.price-meta { font-size: .76rem; color: var(--ink-soft); }

.rate-note {
  margin: .9rem 0 0;
  font-size: .74rem; line-height: 1.5;
  color: var(--ink-soft);
  border-left: 2px solid var(--edge);
  padding-left: .75rem;
}

/* ---------- steps ---------- */

.step { padding-block: clamp(2.5rem, 7vw, 3.75rem); }
.step + .step { border-top: 1px solid var(--edge); }

.step h2 {
  margin: 0 0 .9rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.45rem, 4.5vw, 2rem);
  line-height: 1.2;
  letter-spacing: -.01em;
}

/* ---------- consent ---------- */

.consents { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }

.consents li {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  transition: border-color .15s ease;
}
.consents li:has(input:checked) { border-color: var(--cover); }

.consents label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .75rem;
  padding: .85rem 1rem;
  cursor: pointer;
}
.consents input {
  margin-top: .3rem;
  width: 1.05rem; height: 1.05rem;
  accent-color: var(--cover);
}
.consents .zh { font-size: .92rem; }
.consents .en {
  display: block;
  font-size: .75rem; line-height: 1.5;
  color: var(--ink-soft);
  margin-top: .2rem;
}

.doc-links {
  margin: 1.25rem 0 0;
  display: flex; flex-wrap: wrap; gap: 1.25rem;
  font-size: .84rem;
}
.doc-links a { color: var(--cover); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- summary + pay ---------- */

.summary {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
}
.summary dl { margin: 0; display: grid; gap: .55rem; }
.summary dl > div {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: .88rem;
}
.summary dt { color: var(--ink-soft); flex: none; }
.summary dd { margin: 0; text-align: right; font-family: var(--mono); font-size: .84rem; }
.summary-total {
  margin: 1.1rem 0 0; padding-top: 1rem;
  border-top: 1px solid var(--edge);
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  font-size: .88rem; color: var(--ink-soft);
}
.summary-total strong {
  font-family: var(--display);
  font-size: 1.7rem; color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.notice {
  border: 1px dashed var(--edge);
  border-radius: var(--r);
  padding: 1rem 1.15rem;
  margin-bottom: 1.5rem;
  font-size: .85rem;
  color: var(--ink-soft);
}
.notice p { margin: 0; }
.notice p + p { margin-top: .5rem; }
.notice-title {
  font-family: var(--mono);
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--signal);
}
.notice strong { color: var(--ink); font-weight: 500; }

.submit {
  font: inherit;
  display: block; width: 100%;
  padding: .95rem 1.25rem;
  background: var(--ink); color: var(--paper);
  border: 0; border-radius: var(--r);
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}
.submit span { display: block; }
.submit span:first-child { font-weight: 500; font-size: 1rem; }
.submit-sub {
  font-family: var(--mono);
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  opacity: .6; margin-top: .15rem;
}
.submit:hover { transform: translateY(-1px); }
.submit:active { transform: translateY(0); }
.submit[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.error {
  margin: 0 0 1rem;
  color: var(--signal);
  font-size: .85rem;
  border-left: 2px solid var(--signal);
  padding-left: .75rem;
}

.result {
  margin-top: 1.5rem;
  padding: 1.25rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--cover);
  border-radius: var(--r);
}
.result-ref { margin: 0 0 .3rem; font-size: .85rem; color: var(--ink-soft); }
.result-ref strong { font-family: var(--mono); font-size: 1rem; color: var(--ink); letter-spacing: .04em; }
.result-line { margin: 0 0 1rem; font-size: .85rem; color: var(--cover); }
.result-csv {
  display: inline-block;
  font-size: .85rem; font-weight: 500;
  color: var(--cover);
  border: 1px solid var(--cover); border-radius: var(--r);
  padding: .5rem .9rem;
  text-decoration: none;
}
.result-csv:hover { background: var(--cover-dim); }

.handoff { margin-top: 1.25rem; font-size: .8rem; }
.handoff summary { cursor: pointer; color: var(--ink-soft); }
.handoff p { color: var(--ink-soft); margin: .6rem 0; }
.handoff pre {
  font-family: var(--mono); font-size: .72rem; line-height: 1.7;
  background: var(--paper);
  border: 1px solid var(--edge); border-radius: var(--r);
  padding: .8rem .9rem; margin: 0;
  overflow-x: auto;
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--edge);
  padding-block: 1.5rem 2.5rem;
  font-size: .74rem;
  color: var(--ink-soft);
}
.foot p { margin: 0; }
.foot-dim { opacity: .7; margin-top: .25rem; font-family: var(--mono); font-size: .68rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
