/* ============================================================
   MISE — shared waitlist / lead-gen intake styles
   Used by /waitlist/, /terracotta/waitlist/,
   and /banking/waitlist/. Each page sets its accent theme via :root
   (--accent, --accent-deep, --accent-light, --accent-wash) plus the
   shared neutral tokens below, then includes this file + waitlist.js.
   ============================================================ */

:root {
  --ground:        #FDFBF7;
  --cream:     #F3EBE0;
  --cream-50:  #F8F3EC;
  --white:         #FFFFFF;          /* literal white — text on accent, etc. */
  --surface:       #FFFFFF;          /* form-panel / input focus surface (themed) */
  --charcoal:      #373029;
  --smoke:         #7A726A;
  --smoke-light:   #9B938A;
  --terracotta:    #B85C38;          /* error / warm accent */
  /* Accent — overridden per page. Defaults to Mise blue. */
  --accent:        #2B5799;
  --accent-deep:   #1E3F73;
  --accent-light:  #4673B8;
  --accent-wash:   rgba(43, 87, 153, 0.08);
  --accent-line:   rgba(43, 87, 153, 0.16);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Jost', 'Helvetica Neue', sans-serif;
  --ease:     cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font-body); background: var(--ground); color: var(--charcoal); min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }

/* NAV */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 72px; display: flex; align-items: center; padding: 0 48px; border-bottom: 1px solid var(--accent-line); background: rgba(253, 251, 247, 0.94); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.nav-inner { width: 100%; max-width: 1280px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.nav-left { display: flex; align-items: center; gap: 16px; }
.nav-brand { font-family: var(--font-display); font-size: 26px; font-weight: 400; letter-spacing: 0.22em; text-transform: uppercase; color: var(--charcoal); text-decoration: none; transition: color 0.2s var(--ease); display: flex; align-items: center; gap: 11px; }
.nav-brand:hover { color: var(--accent); }
.nav-mark { height: 28px; width: auto; flex-shrink: 0; }
.nav-breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.nav-sep { color: var(--smoke); font-size: 10px; }
.nav-crumb-link { color: var(--smoke); text-decoration: none; transition: color 0.2s var(--ease); }
.nav-crumb-link:hover { color: var(--accent); }
.nav-crumb-current { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 28px; }
.nav-login { font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); text-decoration: none; transition: color 0.2s var(--ease); white-space: nowrap; }
.nav-login:hover { color: var(--accent-deep); }
.nav-back { font-size: 12px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; color: var(--smoke); text-decoration: none; display: flex; align-items: center; gap: 8px; transition: color 0.2s var(--ease); }
.nav-back:hover { color: var(--charcoal); }

/* REVEAL */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.26s; }

/* LAYOUT */
.page { flex: 1; display: flex; flex-direction: column; padding-top: 72px; }
.page-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 72px); }

/* LEFT EDITORIAL PANEL */
.panel-left { position: relative; padding: 72px 64px; display: flex; flex-direction: column; justify-content: space-between; background: var(--accent-deep); overflow: hidden; }
.panel-left::before { content: ''; position: absolute; bottom: -10%; right: -15%; width: 500px; height: 500px; background: radial-gradient(ellipse, rgba(255,255,255,0.18) 0%, transparent 65%); pointer-events: none; }
.panel-left::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--terracotta), var(--accent-light), transparent); }
.panel-content { position: relative; z-index: 1; }
.panel-eyebrow { font-size: 10px; font-weight: 400; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent-light); margin-bottom: 28px; display: flex; align-items: center; gap: 10px; }
.panel-eyebrow::before { content: ''; width: 24px; height: 1px; background: var(--accent-light); }
.panel-headline { font-family: var(--font-display); font-size: clamp(40px, 4vw, 62px); font-weight: 300; line-height: 1.06; color: var(--cream); margin-bottom: 26px; }
.panel-headline em { font-style: italic; color: var(--accent-light); }
.panel-body { font-size: 16px; font-weight: 300; line-height: 1.78; color: rgba(243, 235, 224, 0.78); max-width: 440px; }
.panel-list { position: relative; z-index: 1; margin-top: 44px; display: flex; flex-direction: column; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 4px; overflow: hidden; }
.panel-list-row { display: grid; grid-template-columns: 100px 1fr; align-items: baseline; gap: 16px; padding: 15px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.panel-list-row:last-child { border-bottom: none; }
.panel-list-name { font-family: var(--font-display); font-size: 19px; font-weight: 400; color: var(--white); }
.panel-list-desc { font-size: 13px; font-weight: 300; color: rgba(243, 235, 224, 0.72); line-height: 1.45; }
.panel-footer { position: relative; z-index: 1; padding-top: 36px; margin-top: auto; }
.panel-footer p { font-size: 12px; font-weight: 300; line-height: 1.7; color: rgba(243, 235, 224, 0.55); }

/* RIGHT FORM PANEL */
.panel-right { padding: 64px; display: flex; flex-direction: column; justify-content: center; background: var(--surface); position: relative; }
.form-wrap { max-width: 500px; width: 100%; margin: 0 auto; }
.form-header { margin-bottom: 36px; }
.form-eyebrow { font-size: 10px; font-weight: 400; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.form-title { font-family: var(--font-display); font-size: clamp(28px, 3vw, 40px); font-weight: 400; line-height: 1.16; color: var(--charcoal); margin-bottom: 12px; }
.form-sub { font-size: 14px; font-weight: 300; line-height: 1.7; color: var(--smoke); }

.form { display: flex; flex-direction: column; gap: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-group { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 11px; font-weight: 400; letter-spacing: 0.16em; text-transform: uppercase; color: var(--smoke); transition: color 0.2s var(--ease); }
.field-group:focus-within .field-label { color: var(--accent); }
.field-input, .field-select { width: 100%; height: 52px; background: var(--cream-50); border: 1px solid var(--accent-line); border-radius: 3px; padding: 0 18px; font-family: var(--font-body); font-size: 15px; font-weight: 300; color: var(--charcoal); outline: none; transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease); appearance: none; -webkit-appearance: none; }
.field-input::placeholder { color: var(--smoke-light); }
.field-input:hover, .field-select:hover { border-color: var(--accent); background: var(--surface); }
.field-input:focus, .field-select:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-wash); }
.field-input.error, .field-select.error { border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(184, 92, 56, 0.1); }
.select-wrap { position: relative; }
.select-arrow { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--smoke); }
.select-wrap:focus-within .select-arrow { color: var(--accent); }
.field-error { font-size: 12px; font-weight: 300; color: var(--terracotta); display: none; margin-top: -2px; }
.field-error.visible { display: block; }

/* UPSELL / CROSS-SELL BLOCK */
.upsell { margin-top: 4px; padding: 20px; border: 1px solid var(--accent-line); border-radius: 5px; background: var(--accent-wash); display: flex; flex-direction: column; gap: 14px; }
.upsell-head { display: flex; align-items: flex-start; gap: 12px; }
.upsell-badge { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--white); display: flex; align-items: center; justify-content: center; }
.upsell-copy h3 { font-family: var(--font-display); font-size: 21px; font-weight: 500; line-height: 1.2; color: var(--charcoal); margin-bottom: 4px; }
.upsell-copy p { font-size: 13px; font-weight: 300; line-height: 1.55; color: var(--smoke); }
.upsell-copy sup { color: var(--accent); font-weight: 500; }

.btn-submit { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 56px; background: var(--accent); border: none; border-radius: 3px; font-family: var(--font-body); font-size: 13px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--white); cursor: pointer; transition: background 0.22s var(--ease), transform 0.22s var(--ease), box-shadow 0.22s var(--ease); margin-top: 6px; }
.btn-submit:hover { background: var(--accent-deep); transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-wash); }
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-submit .spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: var(--white); border-radius: 50%; animation: spin 0.7s linear infinite; display: none; }
.btn-submit.loading .btn-label { display: none; }
.btn-submit.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.footnote { margin-top: 14px; display: flex; align-items: flex-start; gap: 10px; }
.footnote svg { flex-shrink: 0; width: 13px; height: 13px; color: var(--smoke-light); margin-top: 2px; }
.footnote p { font-size: 11px; font-weight: 300; line-height: 1.6; color: var(--smoke); }
.footnote sup { color: var(--accent); }

/* SUCCESS */
.success-state { display: none; flex-direction: column; }
.success-state.visible { display: flex; animation: success-appear 0.6s var(--ease-out) forwards; }
@keyframes success-appear { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.success-mark { width: 52px; height: 52px; border-radius: 50%; background: var(--accent-wash); border: 1px solid var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 26px; color: var(--accent); }
.success-headline { font-family: var(--font-display); font-size: clamp(32px, 3.5vw, 46px); font-weight: 400; line-height: 1.1; color: var(--charcoal); margin-bottom: 14px; }
.success-headline em { font-style: italic; color: var(--accent); }
.success-body { font-size: 16px; font-weight: 300; line-height: 1.7; color: var(--smoke); max-width: 430px; margin-bottom: 32px; }
.success-back { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; color: var(--smoke); text-decoration: none; transition: color 0.2s var(--ease); }
.success-back:hover { color: var(--charcoal); }

/* FOOTER */
.footer { padding: 30px 48px; background: var(--accent-deep); border-top: 1px solid rgba(255, 255, 255, 0.08); }
.footer-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.footer-brand { font-family: var(--font-display); font-size: 18px; font-weight: 400; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cream); text-decoration: none; opacity: 0.85; transition: opacity 0.2s var(--ease); display: flex; align-items: center; gap: 10px; }
.footer-brand:hover { opacity: 1; }
.footer-mark { height: 20px; width: auto; flex-shrink: 0; }
.footer-legal { font-size: 12px; font-weight: 300; color: rgba(243, 235, 224, 0.6); }
.footer-links { display: flex; gap: 24px; }
.footer-link { font-size: 11px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(243, 235, 224, 0.6); text-decoration: none; transition: color 0.2s var(--ease); }
.footer-link:hover { color: var(--white); }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .page-grid { grid-template-columns: 1fr; }
  .panel-left { padding: 56px 32px; min-height: auto; }
  .panel-right { padding: 56px 32px; }
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
  .footer-links { justify-content: center; }
}
@media (max-width: 768px) {
  .nav { padding: 0 20px; }
  .nav-breadcrumb, .nav-back { display: none; }
  .nav-right { gap: 22px; }
  .panel-left { padding: 44px 20px; }
  .panel-right { padding: 44px 20px; }
  .field-row { grid-template-columns: 1fr; }
  .footer { padding: 26px 20px; }
}

/* ============================================================
   DARK THEME — opt in with <body class="theme-dark">.
   Flips neutral surfaces/text to a charcoal palette; the page
   still sets its own --accent tokens. Used by Terracotta to
   match its dark landing page.
   ============================================================ */
body.theme-dark {
  --ground:       #0C0B09;   /* page background */
  --surface:      #1C1A17;   /* form panel + input focus surface */
  --cream-50: #252220;   /* input background */
  --cream:    #F2EDE6;   /* light editorial text (unchanged, reads as cream) */
  --charcoal:     #F2EDE6;   /* primary text → cream */
  --smoke:        #B3AAA0;   /* muted text */
  --smoke-light:  #8A817A;   /* placeholder text */
}
body.theme-dark .nav { background: rgba(12, 11, 9, 0.9); }
body.theme-dark .field-input,
body.theme-dark .field-select { color: var(--charcoal); }
/* On a dark page the bordered input reads better than a near-black fill swap. */
body.theme-dark .field-input:hover, body.theme-dark .field-select:hover,
body.theme-dark .field-input:focus, body.theme-dark .field-select:focus { background: #2A2623; }
