/* =====================================================================
   JDMIS /signup — LearnStack-styled course registration
   Design tokens from the LearnStack portal (learn.jdmis.edu.sg).
   LIGHT and DARK are both first-class: default follows the system,
   .theme-dark / .theme-light body classes force a scheme, toggle persists.
   ===================================================================== */

:root {
  --orange: #e38a2e;
  --gold: #c8a44e;
  --gold-light: #dfc278;
  --gold-dark: #a88532;
  --lime: #acc73b;
  --blue: #008fce;
  --pink: #cf6698;
  --red: #da4030;

  --charcoal: #1f2121;
  --gray: #625c7c;
  --cream: #fffbf5;

  /* light scheme surfaces */
  --bg-base: #fffbf5;
  --bg-soft: #f7f0e4;
  --surface-card: #ffffff;
  --surface-hover: #fdf6ea;
  --border-muted: rgba(31, 33, 33, 0.12);
  --border-strong: rgba(31, 33, 33, 0.22);
  --text-primary: #1f2121;
  --text-secondary: #625c7c;
  --glow-a: rgba(227, 138, 46, 0.14);
  --glow-b: rgba(200, 164, 78, 0.12);
  --chip-bg: rgba(200, 164, 78, 0.14);
  --sk-a: rgba(31, 33, 33, 0.06);
  --sk-b: rgba(31, 33, 33, 0.12);

  --font-display: "Roboto Slab", Georgia, serif;
  --font-body: "Mulish", system-ui, -apple-system, sans-serif;

  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 4px rgba(31, 33, 33, 0.08);
  --shadow-md: 0 8px 16px rgba(31, 33, 33, 0.10);
  --shadow-lg: 0 20px 40px rgba(31, 33, 33, 0.15);
  --dur-fast: 0.15s;
  --dur: 0.3s;
  --dur-slow: 0.5s;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

body.theme-dark {
  --bg-base: #0f1012;
  --bg-soft: #14171b;
  --surface-card: #1a1d23;
  --surface-hover: #212632;
  --border-muted: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.26);
  --text-primary: #f8f6f2;
  --text-secondary: #b9bfd0;
  --glow-a: rgba(227, 138, 46, 0.18);
  --glow-b: rgba(172, 199, 59, 0.10);
  --chip-bg: rgba(223, 194, 120, 0.12);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.55);
  --sk-a: rgba(255, 255, 255, 0.05);
  --sk-b: rgba(255, 255, 255, 0.11);
}
/* scheme handling: html.dark-forced/.light-forced pin via body classes set
   server-side; without them, media query picks the default. */
@media (prefers-color-scheme: dark) {
  html:not(.light-forced) body:not(.theme-light):not(.theme-dark) {
    --bg-base: #0f1012; --bg-soft: #14171b;
    --surface-card: #1a1d23; --surface-hover: #212632;
    --border-muted: rgba(255, 255, 255, 0.14);
    --border-strong: rgba(255, 255, 255, 0.26);
    --text-primary: #f8f6f2; --text-secondary: #b9bfd0;
    --glow-a: rgba(227, 138, 46, 0.18); --glow-b: rgba(172, 199, 59, 0.10);
    --chip-bg: rgba(223, 194, 120, 0.12);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.55);
    --sk-a: rgba(255, 255, 255, 0.05); --sk-b: rgba(255, 255, 255, 0.11);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-size: 17px;
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

/* ambient glows */
.bg-glow {
  position: fixed; border-radius: 50%; filter: blur(90px); z-index: 0; pointer-events: none;
}
.bg-glow-a { width: 520px; height: 520px; top: -180px; right: -140px; background: var(--glow-a); }
.bg-glow-b { width: 420px; height: 420px; bottom: -160px; left: -120px; background: var(--glow-b); }

/* ---------------- top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg-base) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-muted);
}
.brand { display: flex; align-items: center; gap: 14px; color: var(--text-primary); }
.brand:hover { text-decoration: none; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-logo-dark { display: none; }
body.theme-dark .brand-logo-light { display: none; }
body.theme-dark .brand-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  html:not(.light-forced) body:not(.theme-light):not(.theme-dark) .brand-logo-light { display: none; }
  html:not(.light-forced) body:not(.theme-light):not(.theme-dark) .brand-logo-dark { display: block; }
}
.brand-name { font-family: var(--font-body); font-weight: 800; font-size: 0.92rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-secondary); border-left: 1px solid var(--border-muted); padding-left: 14px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border-muted);
  background: var(--surface-card); color: var(--text-primary); cursor: pointer;
  display: grid; place-items: center; transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast);
}
.icon-btn:hover { border-color: var(--gold); transform: translateY(-1px); }
.icon-btn .i-moon { display: none; }
body.theme-dark .icon-btn .i-moon { display: block; }
body.theme-dark .icon-btn .i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  html:not(.light-forced) body:not(.theme-light) .icon-btn .i-moon { display: block; }
  html:not(.light-forced) body:not(.theme-light) .icon-btn .i-sun { display: none; }
}

/* ---------------- shell ---------------- */
.shell { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) clamp(14px, 4vw, 32px) 60px; }
.foot {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: center;
  padding: 22px 16px 34px; color: var(--text-secondary); font-size: 0.8rem;
  border-top: 1px solid var(--border-muted);
}

h1.page-title {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -0.01em;
}
.page-sub { color: var(--text-secondary); margin-top: 8px; max-width: 680px; font-size: 1.05rem; }

/* ---------------- skeletons ---------------- */
.sk {
  border-radius: var(--radius); position: relative; overflow: hidden;
  background: linear-gradient(100deg, var(--sk-a) 40%, var(--sk-b) 50%, var(--sk-a) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -80% 0; } }
.sk-hero { height: 120px; margin-bottom: 26px; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.sk-card { height: 220px; }
.skeleton-page.fade-out { opacity: 0; transition: opacity var(--dur) var(--ease); }

/* ---------------- entrance motion ---------------- */
.rise { opacity: 0; transform: translateY(14px); animation: rise var(--dur-slow) var(--ease) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------------- course list ---------------- */
.list-head { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 8px; }
.list-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 22px; }
.search-box {
  flex: 1 1 260px; max-width: 380px; display: flex; align-items: center; gap: 8px;
  background: var(--surface-card); border: 1px solid var(--border-muted); border-radius: 999px;
  padding: 9px 16px; transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.search-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
.search-box input { border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; width: 100%; }
.search-box svg { color: var(--text-secondary); flex: none; }
.facets { display: flex; flex-wrap: wrap; gap: 8px; }
.facet {
  border: 1px solid var(--border-muted); background: var(--surface-card); color: var(--text-secondary);
  border-radius: 999px; padding: 8px 16px; font-size: 0.92rem; font-weight: 700; cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.facet:hover { border-color: var(--gold); color: var(--text-primary); }
.facet.on { background: var(--chip-bg); border-color: var(--gold); color: var(--text-primary); }

.kept-strip { display: none; }
.kept-strip.has { display: block; margin: 4px 0 18px; }
.kept-strip-inner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px dashed color-mix(in srgb, var(--gold) 55%, transparent);
  background: var(--chip-bg); border-radius: var(--radius); padding: 12px 16px; font-size: 1rem;
}
.kept-pill {
  display: inline-flex; align-items: center; gap: 6px; background: var(--surface-card);
  color: var(--text-primary); font-family: var(--font-body);
  border: 1px solid var(--border-muted); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: border-color var(--dur-fast);
}
.kept-pill:hover { border-color: var(--gold); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.course-card {
  position: relative; text-align: left; border: 1px solid var(--border-muted); border-radius: var(--radius-lg);
  background: var(--surface-card); color: var(--text-primary); overflow: hidden; cursor: pointer; padding: 0;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur);
  will-change: transform;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--gold) 60%, var(--border-muted)); }
.course-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.cc-img {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: linear-gradient(135deg, var(--gd-a, #f4e9d8), var(--gd-b, #c8a44e));
}
.cc-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.6s var(--ease);
}
.course-card:hover .cc-img img { transform: scale(1.05); }
.cc-next {
  position: absolute; top: 12px; left: 12px;
  background: color-mix(in srgb, var(--bg-base) 88%, transparent); backdrop-filter: blur(6px);
  color: var(--text-primary); border: 1px solid var(--border-muted);
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em;
  padding: 4px 10px; border-radius: 999px;
}
.cc-kept {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
  background: color-mix(in srgb, var(--bg-base) 85%, transparent); backdrop-filter: blur(6px);
  border: 1px solid var(--border-muted); display: grid; place-items: center; cursor: pointer;
  color: var(--text-secondary); transition: transform var(--dur-fast) var(--ease), color var(--dur-fast), border-color var(--dur-fast);
  z-index: 2;
}
.cc-kept:hover { color: var(--pink); transform: scale(1.12); }
.cc-kept.on { color: var(--pink); border-color: var(--pink); }
.cc-kept.on svg { animation: heartpop 0.35s var(--ease); }
@keyframes heartpop { 0% { transform: scale(0.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.cc-body { padding: 14px 16px 16px; }
.cc-title { font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; line-height: 1.35; }
.cc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--chip-bg); color: var(--text-secondary); border-radius: 999px; padding: 3px 9px;
}
.chip.code { color: #8a6a24; }
body.theme-dark .chip.code { color: var(--gold-light); }
.cc-price { margin-top: 12px; font-weight: 800; font-size: 1.08rem; }
.cc-price small { color: var(--text-secondary); font-weight: 600; }
.cc-price .from { color: var(--orange); }
.cc-cta {
  margin-top: 14px; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 0.98rem; color: var(--orange);
}
.cc-cta svg { transition: transform var(--dur-fast) var(--ease); }
.course-card:hover .cc-cta svg { transform: translateX(4px); }

/* ---------------- course view ---------------- */
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary);
  font-size: 0.95rem; font-weight: 700; background: none; border: 0; cursor: pointer; padding: 0; margin-bottom: 14px; }
.crumb:hover { color: var(--orange); }

.course-hero {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; margin-bottom: 26px;
  border: 1px solid var(--border-muted); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface-card); box-shadow: var(--shadow-sm);
}
.ch-media { flex: 0 1 320px; min-height: 190px; position: relative;
  background: linear-gradient(135deg, var(--gd-a, #f4e9d8), var(--gd-b, #c8a44e)); }
.ch-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ch-body { flex: 1 1 340px; padding: 20px 22px; display: flex; flex-direction: column; }
.ch-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.45rem, 3vw, 1.9rem); line-height: 1.3; }
.ch-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.ch-next {
  margin-top: auto; padding-top: 14px; color: var(--text-secondary); font-size: 1.02rem;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.ch-next b { color: var(--text-primary); }
.ch-keep {
  align-self: flex-start; margin-top: 12px; display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border-muted); background: var(--surface-card); color: var(--text-secondary);
  border-radius: 999px; padding: 9px 18px; font-weight: 800; font-size: 0.95rem; cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.ch-keep:hover { border-color: var(--pink); color: var(--pink); }
.ch-keep.on { background: color-mix(in srgb, var(--pink) 12%, transparent); border-color: var(--pink); color: var(--pink); }

/* ---------------- steps ---------------- */
.steps { display: flex; flex-direction: column; gap: 14px; }
.step {
  border: 1px solid var(--border-muted); border-radius: var(--radius-lg);
  background: var(--surface-card); overflow: clip; transition: border-color var(--dur);
}
.step.active { border-color: color-mix(in srgb, var(--gold) 45%, var(--border-muted)); }
.step-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: default;
}
.step-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--chip-bg); color: var(--gold-dark); font-weight: 800; font-size: 0.85rem;
  transition: background var(--dur), color var(--dur);
}
body.theme-dark .step-num { color: var(--gold-light); }
.step.active .step-num { background: linear-gradient(135deg, var(--orange), var(--gold)); color: #fff; }
.step.done .step-num { background: var(--lime); color: #fff; }
.step-title { font-weight: 800; font-size: 1.15rem; }
.step-hint { margin-left: auto; color: var(--text-secondary); font-size: 0.95rem; font-weight: 600;
  display: flex; align-items: center; gap: 6px; }
.step-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-slow) var(--ease); }
.step.active .step-body { grid-template-rows: 1fr; }
.step-body > div { overflow: hidden; }
.step-pad { padding: 4px 18px 18px 58px; }
@media (max-width: 560px) { .step-pad { padding-left: 18px; } }

/* ---------------- tiers ---------------- */
.tier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tier {
  position: relative; text-align: left; border: 1.5px solid var(--border-muted); border-radius: var(--radius);
  background: var(--surface-card); color: var(--text-primary); padding: 14px 15px; cursor: pointer;
  transition: transform var(--dur) var(--ease), border-color var(--dur-fast), box-shadow var(--dur);
}
.tier:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tier.on { border-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 16%, transparent); }
.tier.locked { opacity: 0.55; cursor: not-allowed; }
.tier-flag {
  position: absolute; top: -9px; right: 12px; background: linear-gradient(135deg, var(--orange), var(--gold));
  color: #fff; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}
.tier-name { font-weight: 800; font-size: 1.12rem; }
.tier-tag { color: var(--gold-dark); font-size: 0.82rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; margin-top: 2px; }
body.theme-dark .tier-tag { color: var(--gold-light); }
.tier-desc { color: var(--text-secondary); font-size: 0.95rem; margin-top: 8px; line-height: 1.5; }
.tier-foot { display: flex; align-items: baseline; justify-content: space-between; margin-top: 10px; gap: 8px; }
.tier-price { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; }
.tier-hours { color: var(--text-secondary); font-size: 0.82rem; font-weight: 700; }
.tier-incl { margin-top: 9px; font-size: 0.85rem; font-weight: 800; color: #4a7d2a; }
body.theme-dark .tier-incl { color: var(--lime); }
@media (prefers-color-scheme: dark) {
  html:not(.light-forced) body:not(.theme-light):not(.theme-dark) .tier-incl { color: var(--lime); }
}
.tier-check {
  position: absolute; top: 10px; left: 12px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--orange); color: #fff; display: none; place-items: center;
}
.tier.on .tier-check { display: grid; animation: heartpop 0.3s var(--ease); }

/* ---------------- schedule picker ---------------- */
.sched-list { display: flex; flex-direction: column; gap: 8px; }
.sched {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; width: 100%; text-align: left;
  border: 1.5px solid var(--border-muted); border-radius: var(--radius); background: var(--surface-card);
  color: var(--text-primary); font-family: var(--font-body);
  padding: 11px 14px; cursor: pointer; transition: border-color var(--dur-fast), transform var(--dur-fast) var(--ease);
}
.sched:hover { border-color: var(--gold); transform: translateX(2px); }
.sched.on { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 7%, var(--surface-card)); }
.sched .rdot { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); transition: all var(--dur-fast) var(--ease); }
.sched.on .rdot { border-color: var(--orange); background: radial-gradient(circle, var(--orange) 42%, transparent 48%); }
.sched-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sched-line1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.sched-dates { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; }
.sched-dates .we { color: var(--gold-dark); font-style: normal; font-weight: 800; }
body.theme-dark .sched-dates .we { color: var(--gold-light); }
@media (prefers-color-scheme: dark) {
  html:not(.light-forced) body:not(.theme-light):not(.theme-dark) .sched-dates .we { color: var(--gold-light); }
}
.sched-date { font-weight: 800; min-width: 170px; font-size: 1.05rem; }
.sched-sub { color: var(--text-secondary); font-size: 0.92rem; }
.sched-badge { margin-left: auto; font-size: 0.78rem; font-weight: 800; color: var(--gold-dark);
  background: var(--chip-bg); padding: 3px 10px; border-radius: 999px; }
body.theme-dark .sched-badge { color: var(--gold-light); }
.empty-note { color: var(--text-secondary); font-size: 1rem; padding: 8px 2px; line-height: 1.5; }

/* ---------------- segmented controls ---------------- */
.seg { display: flex; gap: 0; border: 1.5px solid var(--border-muted); border-radius: var(--radius); overflow: hidden; max-width: 560px; }
.seg button {
  flex: 1; border: 0; background: var(--surface-card); color: var(--text-secondary);
  padding: 11px 10px; cursor: pointer; font-weight: 800; font-size: 0.95rem;
  border-right: 1px solid var(--border-muted); transition: background var(--dur-fast), color var(--dur-fast);
}
.seg button:last-child { border-right: 0; }
.seg button small { display: block; font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); margin-top: 1px; }
.seg button.on { background: var(--chip-bg); color: var(--text-primary); }
.seg button.on small { color: var(--gold-dark); }
body.theme-dark .seg button.on small { color: var(--gold-light); }
.seg-extra { margin-top: 10px; display: grid; gap: 10px; max-width: 560px; }
.rate-line {
  display: flex; justify-content: space-between; gap: 10px; align-items: center; width: 100%; text-align: left;
  border: 1.5px solid var(--border-muted); background: var(--surface-card); border-radius: var(--radius);
  color: var(--text-primary); font-family: var(--font-body);
  padding: 9px 13px; cursor: pointer; transition: border-color var(--dur-fast);
}
.rate-line.on { border-color: var(--orange); }
.rate-line b { font-size: 1rem; }
.rate-line span { color: var(--text-secondary); font-size: 0.85rem; display: block; }
.rate-line .rp { font-weight: 800; white-space: nowrap; }

/* ---------------- form ---------------- */
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 640px; }
.fgrid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .fgrid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 0.9rem; font-weight: 800; letter-spacing: 0.02em; }
.field input, .field select, .field textarea {
  border: 1.5px solid var(--border-muted); border-radius: 10px; background: var(--surface-card);
  color: var(--text-primary); font: inherit; font-size: 1rem; padding: 12px 14px; outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent);
}
.field select option, .field select optgroup { background: var(--surface-card); color: var(--text-primary); }
.field .err { color: var(--red); font-size: 0.85rem; font-weight: 700; display: none; }
.field.invalid input { border-color: var(--red); }
.field.invalid .err { display: block; }
.search-box input::placeholder, .field input::placeholder, .field textarea::placeholder {
  color: var(--text-secondary); opacity: 1;
}
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

/* ---------------- summary + pay ---------------- */
.summary { border: 1px solid var(--border-muted); border-radius: var(--radius); padding: 14px 16px; max-width: 640px; }
.summary h4 { font-size: 0.88rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary);
  margin-bottom: 10px; }
.inv-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 1rem;
  border-bottom: 1px dashed var(--border-muted); }
.inv-line span { color: var(--text-secondary); }
.inv-line b { white-space: nowrap; }
.inv-line.total { border-bottom: 0; padding-top: 12px; font-size: 1.15rem; }
.inv-line.total span { color: var(--text-primary); font-weight: 800; }
.inv-line.total b { font-family: var(--font-display); font-size: 1.45rem; }

.paybar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.pay-note { color: var(--text-secondary); font-size: 0.92rem; max-width: 380px; line-height: 1.5; }
.btn-gold {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 9px;
  background: linear-gradient(135deg, var(--orange), var(--gold-dark));
  color: #fff; font-weight: 800; font-size: 1.05rem; border: 0; border-radius: 999px;
  padding: 15px 30px; cursor: pointer; box-shadow: var(--shadow-md);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast), filter var(--dur-fast);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); filter: brightness(1.05); }
.btn-gold:active { transform: translateY(0); }
.btn-gold::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -70%; width: 46%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg); transition: left 0.55s var(--ease);
}
.btn-gold:hover::after { left: 130%; }
.btn-gold:disabled { opacity: 0.6; cursor: wait; transform: none; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--border-muted);
  background: var(--surface-card); color: var(--text-primary); font-weight: 800; font-size: 0.95rem;
  border-radius: 999px; padding: 12px 22px; cursor: pointer; transition: border-color var(--dur-fast), transform var(--dur-fast);
}
.btn-ghost:hover { border-color: var(--gold); transform: translateY(-1px); }

.fineprint { margin-top: 14px; color: var(--text-secondary); font-size: 0.9rem; max-width: 600px; }
.inline-msg { margin-top: 12px; font-size: 0.95rem; font-weight: 700; display: none; }
.inline-msg.show { display: block; }
.inline-msg.err { color: var(--red); }
.inline-msg.ok { color: var(--lime); }

/* success card */
.done-card {
  border: 1px solid color-mix(in srgb, var(--lime) 45%, var(--border-muted));
  background: color-mix(in srgb, var(--lime) 8%, var(--surface-card));
  border-radius: var(--radius-lg); padding: 26px 26px; max-width: 640px;
}
.done-card h2 { font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 10px; }
.done-card p { color: var(--text-secondary); font-size: 1.02rem; margin: 8px 0; }

/* toast */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px);
  background: var(--charcoal); color: var(--cream); border-radius: 999px;
  padding: 13px 26px; font-weight: 700; font-size: 1rem; opacity: 0; pointer-events: none;
  transition: opacity var(--dur), transform var(--dur) var(--ease); z-index: 50;
  box-shadow: var(--shadow-lg); max-width: 90vw; text-align: center;
}
body.theme-dark .toast { background: #39414e; color: var(--text-primary); }
@media (prefers-color-scheme: dark) {
  html:not(.light-forced) body:not(.theme-light):not(.theme-dark) .toast { background: #39414e; color: var(--text-primary); }
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* noscript */
.noscript-card { border: 1px solid var(--border-muted); border-radius: var(--radius-lg); padding: 26px; background: var(--surface-card); }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .rise { opacity: 1; transform: none; animation: none; }
  html { scroll-behavior: auto; }
}
