/* ════════════════════════════════════════════════════════════════════════════
   LATTICE — apply.css
   Stylesheet for the Application form page.
   Built on the Liquid Glass design system. See assets/css/tokens.css.
   ════════════════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────────
   TOKENS — Color, type, layout, and Liquid Glass tokens
   ────────────────────────────────────────────────────────────────── */
:root {
    --bg: #0a0908;
    --bg-soft: #12100e;
    --bg-card: #161310;
    --ink: #f5f1eb;
    --ink-soft: #a8a29a;
    --ink-mute: #9b9489;
    --line: rgba(245, 241, 235, 0.08);
    --line-strong: rgba(245, 241, 235, 0.18);
    --accent: #c4f542;
    --accent-glow: rgba(196, 245, 66, 0.35);
    --warn: #ff7849;
    --serif: 'Fraunces', 'Times New Roman', serif;
    --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
    --maxw: 1320px;
    --gutter: clamp(1.25rem, 3vw, 2.5rem);

    /* ====== Liquid Glass tokens ====== */
    --lg-radius-sm: 10px;
    --lg-radius: 18px;
    --lg-radius-lg: 26px;
    --lg-radius-pill: 999px;
    --lg-bg: rgba(20, 17, 15, 0.42);
    --lg-bg-light: rgba(245, 241, 235, 0.05);
    --lg-bg-strong: rgba(20, 17, 15, 0.62);
    --lg-border: rgba(245, 241, 235, 0.14);
    --lg-border-strong: rgba(245, 241, 235, 0.24);
    --lg-blur: blur(20px) saturate(180%);
    --lg-blur-lg: blur(28px) saturate(200%);
    --lg-shadow: inset 0 1px 0 rgba(245, 241, 235, 0.10), inset 0 -1px 0 rgba(0, 0, 0, 0.20), 0 8px 32px rgba(0, 0, 0, 0.40);
    --lg-shadow-lg: inset 0 1px 0 rgba(245, 241, 235, 0.12), inset 0 -1px 0 rgba(0, 0, 0, 0.25), 0 18px 50px rgba(0, 0, 0, 0.50);
    --lg-accent-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.15), 0 6px 22px rgba(196, 245, 66, 0.28);
    --lg-accent-shadow-hover: inset 0 1px 0 rgba(255, 255, 255, 0.30), inset 0 -1px 0 rgba(0, 0, 0, 0.15), 0 14px 44px rgba(196, 245, 66, 0.45);
  }

/* ──────────────────────────────────────────────────────────────────
   RESET — Universal box-sizing / margin / padding
   ────────────────────────────────────────────────────────────────── */
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }

  body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.55;
    overflow-x: hidden;
    min-height: 100vh;
    cursor: none;
  }
  body::before {
    content: ""; position: fixed; inset: 0;
    pointer-events: none; z-index: 100;
    opacity: 0.05; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  }

/* ──────────────────────────────────────────────────────────────────
   SELECTION — Lime selection over warm-black
   ────────────────────────────────────────────────────────────────── */
  ::selection { background: var(--accent); color: var(--bg); }

  a { color: inherit; text-decoration: none; }
  button { font: inherit; color: inherit; background: none; border: none; cursor: none; }
  .cursor-dot, .cursor-ring {
    position: fixed; pointer-events: none; z-index: 9999;
    top: 0; left: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s;
  }
  .cursor-dot { width: 4px; height: 4px; background: var(--accent); border-radius: 50%; }
  .cursor-ring {
    width: 32px; height: 32px;
    border: 1px solid rgba(245, 241, 235, 0.4);
    border-radius: 50%;
    transition: width 0.25s, height 0.25s, border-color 0.25s, background 0.25s;
  }
  .cursor-ring.hover {
    width: 56px; height: 56px;
    border-color: var(--accent);
    background: rgba(196, 245, 66, 0.06);
  }

  /* NAV — floating liquid glass pill */

/* ──────────────────────────────────────────────────────────────────
   NAVIGATION — Floating Liquid Glass pill nav
   ────────────────────────────────────────────────────────────────── */
  .nav {
    position: sticky; top: 0; z-index: 50;
    display: flex; justify-content: center;
    padding: 1rem var(--gutter);
    pointer-events: none;
  }
  .nav::before {
    content: "";
    position: absolute; inset: 0; bottom: -1px;
    background: linear-gradient(180deg, var(--bg) 0%, transparent 100%);
    pointer-events: none;
    z-index: -1;
  }
  .nav-pill {
    pointer-events: auto;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1.5rem;
    width: 100%; max-width: 1100px;
    padding: 0.6rem 1.4rem;
    background: var(--lg-bg);
    backdrop-filter: var(--lg-blur);
    -webkit-backdrop-filter: var(--lg-blur);
    border: 1px solid var(--lg-border);
    border-radius: var(--lg-radius-pill);
    box-shadow: var(--lg-shadow);
  }
  .nav-brand {
    display: flex; align-items: center; gap: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    font-size: 0.82rem;
    text-transform: uppercase;
  }
  .nav-mark {
    width: 22px; height: 22px;
    position: relative;
  }
  .nav-mark::before, .nav-mark::after {
    content: ""; position: absolute; inset: 0;
    border: 1.5px solid var(--ink);
    transition: transform 0.7s cubic-bezier(.2,.7,.2,1);
  }
  .nav-mark::after { transform: rotate(45deg) scale(0.7); border-color: var(--accent); }
  .nav-brand:hover .nav-mark::before { transform: rotate(45deg); }
  .nav-brand:hover .nav-mark::after { transform: rotate(0) scale(1); }

  .nav-meta {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-mute);
    display: flex; align-items: center; gap: 1rem;
  }
  .nav-meta .step {
    color: var(--accent);
  }
  .back-link {
    display: inline-flex; align-items: center; gap: 0.5rem;
    color: var(--ink-soft);
    font-size: 0.85rem;
    transition: color 0.3s, transform 0.4s cubic-bezier(.2,.7,.2,1);
  }
  .back-link:hover { color: var(--ink); transform: translateX(-3px); }
  @media (max-width: 720px) {
    .nav-meta .step { display: none; }
  }

  /* HEADER */
  .head {
    padding: clamp(4rem, 10vh, 7rem) var(--gutter) clamp(2rem, 6vh, 4rem);
    max-width: var(--maxw);
    margin: 0 auto;
    width: 100%;
    border-bottom: 1px solid var(--line);
    position: relative;
  }
  .head::before {
    content: "";
    position: absolute;
    bottom: -1px; left: var(--gutter);
    width: 80px; height: 1px;
    background: var(--accent);
    box-shadow: 0 0 14px var(--accent-glow);
  }
  .head-eyebrow {
    display: inline-flex; align-items: center; gap: 0.75rem;
    padding: 0.55rem 0.95rem 0.55rem 0.85rem;
    background: var(--lg-bg);
    backdrop-filter: var(--lg-blur);
    -webkit-backdrop-filter: var(--lg-blur);
    border: 1px solid var(--lg-border);
    border-radius: var(--lg-radius-pill);
    box-shadow: var(--lg-shadow);
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 1.6rem;
    width: fit-content;
    opacity: 0; animation: fadeUp 0.9s 0.1s cubic-bezier(.2,.7,.2,1) forwards;
  }
  .head-eyebrow .dot {
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 14px var(--accent-glow);
  }
  .head-title {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(2.6rem, 7vw, 6rem);
    line-height: 0.96;
    letter-spacing: -0.03em;
    max-width: 14ch;
    opacity: 0; animation: fadeUp 1s 0.2s cubic-bezier(.2,.7,.2,1) forwards;
  }
  .head-title em {
    font-style: italic;
    color: var(--accent);
    font-weight: 300;
  }
  .head-sub {
    margin-top: 1.8rem;
    color: var(--ink-soft);
    font-size: 1rem;
    max-width: 56ch;
    opacity: 0; animation: fadeUp 1s 0.4s cubic-bezier(.2,.7,.2,1) forwards;
  }

  /* BODY GRID */
  .body {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: clamp(3rem, 7vh, 5rem) var(--gutter) clamp(4rem, 8vh, 6rem);
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: clamp(2.5rem, 6vw, 6rem);
    align-items: start;
  }
  @media (max-width: 920px) {
    .body { grid-template-columns: 1fr; }
  }

  /* SIDEBAR */
  .aside {
    position: sticky;
    top: 6rem;
    align-self: start;
  }
  @media (max-width: 920px) {
    .aside { position: static; }
  }
  .aside-label {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--line);
  }
  .aside-label::before { content: "§ "; color: var(--accent); }

  .stage {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem 1.4rem;
    padding: 1.4rem 0;
    border-bottom: 1px dashed var(--line);
    position: relative;
    transition: padding 0.4s;
  }
  .stage.active .stage-num { color: var(--accent); }
  .stage.active::before {
    content: "";
    position: absolute;
    left: -1rem; top: 50%;
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 14px var(--accent-glow);
  }
  .stage-num {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--ink-mute);
    letter-spacing: 0.04em;
    transition: color 0.4s;
  }
  .stage-time {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-mute);
    grid-column: 2;
    margin-top: -0.3rem;
  }
  .stage-name {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.25rem;
    line-height: 1.15;
    color: var(--ink);
  }
  .stage-desc {
    grid-column: 2;
    font-size: 0.86rem;
    color: var(--ink-soft);
    line-height: 1.5;
  }

  .aside-quote {
    margin-top: 2.5rem;
    padding: 1.5rem 0 0;
    border-top: 1px solid var(--line);
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 1.1rem;
    line-height: 1.4;
    color: var(--ink);
  }
  .aside-quote::before {
    content: "“";
    color: var(--accent);
    font-size: 2.6rem;
    line-height: 0;
    vertical-align: -0.4em;
    margin-right: 0.2rem;
  }
  .aside-attr {
    margin-top: 1rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-mute);
  }
  .aside-attr::before {
    content: "—";
    color: var(--accent);
    margin-right: 0.5rem;
  }

  /* FORM */
  .form {
    display: flex; flex-direction: column;
    gap: 0;
  }

  .form-progress {
    height: 1px;
    background: var(--line);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
  }
  .form-progress-fill {
    position: absolute;
    top: 0; left: 0; height: 100%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
    width: 0;
    transition: width 0.5s cubic-bezier(.2,.7,.2,1);
  }

  .form-section {
    border-top: 1px solid var(--line);
    padding: 2.4rem 0 1rem;
    margin-bottom: 0;
  }
  .form-section:first-of-type { border-top: none; padding-top: 0; }

  .form-section-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 2rem;
  }
  .form-section-num {
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-mute);
  }
  .form-section-num em {
    color: var(--accent);
    font-style: normal;
  }
  .form-section-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.6rem;
    letter-spacing: -0.01em;
  }

  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  @media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; gap: 0; }
  }

/* ──────────────────────────────────────────────────────────────────
   FORM FIELDS — Glass field with floating label
   ────────────────────────────────────────────────────────────────── */
  .field {
    position: relative;
    padding: 1.6rem 1.2rem 0.85rem;
    background: var(--lg-bg-light);
    backdrop-filter: var(--lg-blur);
    -webkit-backdrop-filter: var(--lg-blur);
    border: 1px solid var(--lg-border);
    border-radius: var(--lg-radius);
    box-shadow: inset 0 1px 0 rgba(245, 241, 235, 0.05);
    margin-bottom: 1rem;
    transition: border-color 0.4s, background 0.4s, box-shadow 0.4s;
  }
  .field:focus-within {
    border-color: rgba(196, 245, 66, 0.5);
    background: rgba(196, 245, 66, 0.04);
    box-shadow:
      inset 0 1px 0 rgba(245, 241, 235, 0.08),
      0 0 30px rgba(196, 245, 66, 0.15);
  }
  .field.filled {
    border-color: var(--lg-border-strong);
  }

  .field label {
    position: absolute;
    top: 1.55rem; left: 1.2rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: var(--ink-mute);
    pointer-events: none;
    transition: top 0.35s cubic-bezier(.2,.7,.2,1), font-size 0.35s, color 0.35s, letter-spacing 0.35s;
  }
  .field:focus-within label,
  .field.filled label {
    top: 0.45rem;
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }
  .field:focus-within label {
    color: var(--accent);
  }

  .field input,
  .field textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1.05rem;
    padding: 0;
    outline: none;
    line-height: 1.4;
    resize: none;
    cursor: none;
  }
  .field input::placeholder,
  .field textarea::placeholder { color: transparent; }

  .field textarea {
    min-height: 5rem;
    padding-top: 0.2rem;
  }

  .field-meta {
    position: absolute;
    bottom: 0.7rem; right: 1.2rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--ink-mute);
    pointer-events: none;
    transition: color 0.3s;
  }
  .field-meta.warn { color: var(--warn); }

  /* RADIO */
  .radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.6rem;
  }
  @media (max-width: 600px) {
    .radio-group { grid-template-columns: 1fr; }
  }

/* ──────────────────────────────────────────────────────────────────
   RADIO BUTTONS — Card-style custom radio
   ────────────────────────────────────────────────────────────────── */
  .radio {
    position: relative;
    padding: 1.2rem 1.3rem;
    background: var(--lg-bg-light);
    backdrop-filter: var(--lg-blur);
    -webkit-backdrop-filter: var(--lg-blur);
    border: 1px solid var(--lg-border);
    border-radius: var(--lg-radius);
    box-shadow: inset 0 1px 0 rgba(245, 241, 235, 0.05);
    cursor: none;
    transition: border-color 0.4s, background 0.4s, transform 0.4s, box-shadow 0.4s;
    display: flex; align-items: center; gap: 0.9rem;
  }
  .radio:hover {
    border-color: var(--lg-border-strong);
    background: var(--lg-bg);
    transform: translateY(-1px);
  }
  .radio input { position: absolute; opacity: 0; pointer-events: none; }
  .radio-mark {
    width: 14px; height: 14px;
    border: 1px solid var(--ink-mute);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: border-color 0.3s;
  }
  .radio-mark::after {
    content: "";
    position: absolute; inset: 3px;
    border-radius: 50%;
    background: var(--accent);
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(.2,.7,.2,1);
  }
  .radio input:checked ~ .radio-mark { border-color: var(--accent); }
  .radio input:checked ~ .radio-mark::after { transform: scale(1); }
  .radio:has(input:checked) {
    border-color: rgba(196, 245, 66, 0.5);
    background: rgba(196, 245, 66, 0.08);
    box-shadow:
      inset 0 1px 0 rgba(245, 241, 235, 0.08),
      0 0 30px rgba(196, 245, 66, 0.15);
  }
  .radio-label {
    display: flex; flex-direction: column; gap: 0.2rem;
  }
  .radio-name {
    font-family: var(--serif);
    font-size: 1.05rem;
    color: var(--ink);
  }
  .radio-sub {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-mute);
  }

  /* SUBMIT */
  .form-foot {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.5rem;
  }
  .submit {
    display: inline-flex; align-items: center; gap: 0.8rem;
    padding: 1.1rem 1.8rem;
    background: var(--accent);
    color: var(--bg);
    font-family: var(--sans);
    font-weight: 500;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    border: 1px solid rgba(196, 245, 66, 0.5);
    border-radius: var(--lg-radius-pill);
    box-shadow: var(--lg-accent-shadow);
    position: relative; overflow: hidden;
    transition: transform 0.4s cubic-bezier(.2,.7,.2,1), box-shadow 0.4s, opacity 0.3s;
  }
  .submit:hover {
    box-shadow: var(--lg-accent-shadow-hover);
    transform: translateY(-2px);
  }
  .submit svg { transition: transform 0.4s cubic-bezier(.2,.7,.2,1); }
  .submit:hover svg { transform: translate(4px, -4px); }
  .submit[disabled] { opacity: 0.4; }
  .submit[disabled]:hover { transform: none; box-shadow: none; }

  .form-foot-note {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-mute);
    max-width: 30ch;
  }

  /* SUCCESS */
  .success {
    display: none;
    padding: 4rem 0 1rem;
    text-align: left;
  }
  .success.show {
    display: block;
    animation: fadeUp 0.9s cubic-bezier(.2,.7,.2,1) both;
  }
  .success-mark {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 4rem;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 1.5rem;
  }
  .success-title {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 1.2rem;
    max-width: 18ch;
  }
  .success-title em { font-style: italic; color: var(--accent); }
  .success-body {
    color: var(--ink-soft);
    max-width: 50ch;
    margin-bottom: 2rem;
  }
  .success-meta {
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-mute);
    display: flex; flex-direction: column; gap: 0.4rem;
    padding: 1.2rem 1.4rem;
    background: var(--lg-bg-light);
    backdrop-filter: var(--lg-blur);
    -webkit-backdrop-filter: var(--lg-blur);
    border: 1px solid var(--lg-border);
    border-radius: var(--lg-radius);
    box-shadow: var(--lg-shadow);
    margin-bottom: 2.5rem;
  }
  .success-meta strong { color: var(--accent); font-weight: 500; }

  .form.hide { display: none; }
/* ──────────────────────────────────────────────────────────────────
   FOOTER — Mono uppercase footer strip
   ────────────────────────────────────────────────────────────────── */
  footer {
    border-top: 1px solid var(--line);
    padding: 2rem var(--gutter);
    max-width: var(--maxw);
    margin: 0 auto;
    width: 100%;
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-mute);
  }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }

/* ──────────────────────────────────────────────────────────────────
   REDUCED MOTION — Disable animations + restore system cursor
   ────────────────────────────────────────────────────────────────── */
  @media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
    body { cursor: auto; }
    .cursor-dot, .cursor-ring { display: none; }
    a, button, .radio, .submit { cursor: pointer; }
  }
