/* =========================================================
   includes/forms.css — VioLev "Adventure / Labs" → Forms exhibit

   /adventure/forms/ — a live demonstration of the form patterns VioLev
   builds, shown side by side: the simple inline form, the layered
   multi-step assessment (the SecureLynx pattern, in violet), and a
   slide-in drawer capture. Three ways to ask, one set of bones.

   Unlike the room (adventure.css) this page SCROLLS — it's an inner
   exhibit, not the fit-to-viewport flashlight stage. So it does NOT
   load adventure.css and does NOT inherit the 100dvh flex lock; the
   footer simply follows the content (like the History case pages).

   Progressive enhancement (house rule — Invisible Friction): every
   form is usable with JS off. JS only LAYERS the polish:
     - simple  : JS shows the inline success card; off, it's a plain form.
     - wizard  : off, all steps stack into one long form (CSS fallback);
                 on, JS drives steps / progress / branching / the summary.
     - drawer  : off, :target opens it (same trick as the privacy modal);
                 on, JS adds focus-trap + Escape + a clean URL.

   Spam defense is shown, not hidden: the honeypot + time-trap ship on
   the simple form exactly as they do on the live Journey contact form.

   Bones at rest; violet earned on interaction — the house thesis.
   ========================================================= */

/* ---- page frame ---------------------------------------------------- */
.forms-hero .lead { max-width: 60ch; }
.forms-note {
  margin-top: 18px; max-width: 60ch;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .04em;
  line-height: 1.7; color: var(--text-muted);
}
.forms-note strong { color: var(--haze); font-weight: 400; }
.forms-back { margin-top: 26px; }

.forms-exhibits { padding-top: 0; }
.forms-wrap { display: flex; flex-direction: column; gap: clamp(40px, 7vh, 84px); max-width: 880px; }

/* ---- one exhibit block (number · label · title · caption · the form) - */
.exhibit { display: grid; grid-template-columns: auto 1fr; gap: clamp(18px, 3vw, 34px); align-items: start; }
.exhibit-num {
  font-family: var(--mono); font-size: 1rem; font-weight: 700; letter-spacing: .06em;
  color: var(--violet-bright); line-height: 1; padding-top: 6px;
  text-shadow: var(--glow-violet-soft);
}
.exhibit-head .label { display: block; margin-bottom: 10px; }
.exhibit-head h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.5rem, 3.2vw, 2.1rem); color: var(--mist); letter-spacing: -.015em;
}
.exhibit-cap { margin-top: 12px; max-width: 58ch; color: var(--text-secondary); font-size: .98rem; line-height: 1.65; }
.exhibit-cap a { color: var(--violet-bright); }
.exhibit-body { grid-column: 1 / -1; margin-top: clamp(18px, 2.6vh, 26px); }

@media (max-width: 620px) {
  .exhibit { grid-template-columns: 1fr; gap: 10px; }
  .exhibit-num { padding-top: 0; }
  .exhibit-body { margin-top: 18px; }
}

/* ---- the surface every form sits on -------------------------------- */
.form-card {
  background: var(--bg-panel); border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3.4vw, 36px);
  box-shadow: 0 30px 70px -50px rgba(0,0,0,.8);
}

/* =========================================================
   SHARED FIELD STYLING (forks the journey .cform look, scoped here
   so the exhibit is self-contained and never depends on journey.css)
   ========================================================= */
.vform { display: flex; flex-direction: column; gap: 16px; }
.vfield { display: flex; flex-direction: column; gap: 6px; }
.vfield label {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--haze);
}
.vfield label .opt { color: var(--text-muted); letter-spacing: .06em; }
.vfield input, .vfield textarea, .vfield select {
  width: 100%; font-family: var(--body); font-size: .95rem; color: var(--mist);
  background: rgba(6,4,12,.6); border: 1px solid var(--border-primary); border-radius: var(--radius-sm);
  padding: 11px 13px; transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.vfield textarea { resize: vertical; min-height: 104px; line-height: 1.55; }
.vfield select { cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--haze) 50%), linear-gradient(135deg, var(--haze) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px;
}
.vfield input:focus, .vfield textarea:focus, .vfield select:focus {
  outline: none; border-color: var(--violet); box-shadow: var(--glow-violet-soft);
}
.vfield input::placeholder, .vfield textarea::placeholder { color: rgba(185,175,212,.4); }
.vfield.is-invalid input, .vfield.is-invalid textarea, .vfield.is-invalid select { border-color: rgba(255,120,120,.55); }
.vfield .err-msg { font-family: var(--mono); font-size: .64rem; letter-spacing: .04em; color: #ff9a9a; min-height: 0; }
.vfield.is-invalid .err-msg { min-height: 1em; }

/* radio / check chips (used by the wizard) */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 15px; border: 1px solid var(--border-primary); border-radius: var(--radius-pill);
  font-size: .9rem; color: var(--text-secondary); cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip .dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--border-active); flex: 0 0 auto; transition: all var(--transition-fast); }
.chip:hover { border-color: var(--border-active); color: var(--mist); }
.chip:has(input:checked) { border-color: var(--violet); color: var(--mist); background: rgba(139,92,255,.10); }
.chip:has(input:checked) .dot { background: var(--violet-bright); border-color: var(--violet-bright); box-shadow: var(--glow-violet-soft); }
.chip:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 3px; }

/* honeypot: off-screen, never seen by a human; a filled value = a bot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.vform .btn-primary, .form-card .btn-primary { align-self: flex-start; }

/* ---- the success / status card (shared) ---------------------------- */
.form-done {
  display: none; border: 1px solid var(--border-active); border-radius: var(--radius-md);
  background: rgba(139,92,255,.08); padding: clamp(18px, 2.6vw, 26px); text-align: left;
}
.form-done.show { display: block; animation: doneIn 380ms ease; }
@keyframes doneIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.form-done .label { display: block; margin-bottom: 8px; color: var(--violet-bright); }
.form-done h3 { font-family: var(--display); font-weight: 600; font-size: 1.2rem; color: var(--mist); margin-bottom: 8px; }
.form-done p { color: var(--text-secondary); font-size: .95rem; line-height: 1.6; }
.form-done .restart {
  margin-top: 16px; font-family: var(--mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--haze); background: none; border: 0; cursor: pointer; padding: 0;
  border-bottom: 1px solid var(--border-active); transition: color var(--transition-fast);
}
.form-done .restart:hover { color: var(--violet-bright); }

/* the demo tell — a small mono caption under each form */
.demo-tell {
  margin-top: 16px; font-family: var(--mono); font-size: .64rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
}

/* =========================================================
   2 · THE LAYERED FORM — multi-step assessment wizard
   (the SecureLynx pattern: Snapshot → Footprint → Concerns → Review →
   a generated guidance summary. JS-off: all steps stack.)
   ========================================================= */
.wizard { padding-top: clamp(20px, 3vw, 30px); }

/* progress: a thin violet bar + numbered dots */
.wiz-progress { margin-bottom: clamp(22px, 3vh, 30px); }
.wiz-bar { height: 3px; border-radius: 3px; background: var(--border-secondary); overflow: hidden; }
.wiz-bar span { display: block; height: 100%; width: 25%; background: var(--violet);
  box-shadow: var(--glow-violet-soft); border-radius: 3px; transition: width var(--transition-medium); }
.wiz-dots { display: flex; justify-content: space-between; margin-top: 12px; gap: 8px; }
.wiz-dots li {
  flex: 1 1 0; list-style: none; text-align: center;
  font-family: var(--mono); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); transition: color var(--transition-fast);
}
.wiz-dots li.is-current { color: var(--violet-bright); }
.wiz-dots li.is-done { color: var(--haze); }

/* steps: only the current one shows (JS). off-JS fallback re-stacks them. */
.wiz-step { display: none; }
.wiz-step.is-active { display: block; animation: stepIn 280ms ease; }
@keyframes stepIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.wiz-step h3 { font-family: var(--display); font-weight: 600; font-size: 1.16rem; color: var(--mist); margin-bottom: 4px; }
.wiz-step .step-sub { color: var(--text-muted); font-size: .9rem; margin-bottom: 20px; line-height: 1.55; }
.wiz-step .vform { gap: 18px; }
.wiz-fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.wiz-fieldset legend {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--haze); padding: 0; margin-bottom: 4px;
}

/* a conditional follow-up that the branching reveals */
.wiz-branch { display: none; padding-top: 4px; }
.wiz-branch.show { display: flex; flex-direction: column; gap: 10px; animation: doneIn 300ms ease; }

/* nav row */
.wiz-nav { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: clamp(22px, 3vh, 30px); }
/* .btn forces display:inline-flex, which would defeat the [hidden] attribute —
   so re-assert the hide here for every nav button (Back / Next / Submit). */
.wiz-nav .btn[hidden] { display: none; }
.wiz-step-count { font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }

/* the generated guidance summary */
.wiz-result { display: none; }
.wiz-result.show { display: block; animation: doneIn 420ms ease; }
.wiz-result .label { display: block; margin-bottom: 10px; color: var(--violet-bright); }
.wiz-result h3 { font-family: var(--display); font-weight: 600; font-size: 1.4rem; color: var(--mist); margin-bottom: 6px; }
.wiz-result .result-lead { color: var(--text-secondary); font-size: .96rem; line-height: 1.6; margin-bottom: 20px; }
.summary-grid { display: grid; gap: 1px; background: var(--border-secondary);
  border: 1px solid var(--border-secondary); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 22px; }
.summary-grid .srow { display: grid; grid-template-columns: 38% 1fr; background: var(--bg-panel-strong); }
.summary-grid .srow dt {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); padding: 13px 16px;
}
.summary-grid .srow dd { margin: 0; color: var(--mist); font-size: .92rem; padding: 13px 16px; line-height: 1.5; }
.flags { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.flag { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start;
  padding: 13px 15px; border: 1px solid var(--border-primary); border-radius: var(--radius-sm);
  background: rgba(139,92,255,.05); }
.flag .flag-mark { color: var(--violet-bright); font-family: var(--mono); font-weight: 700; line-height: 1.4; }
.flag p { color: var(--text-secondary); font-size: .9rem; line-height: 1.55; }
.flag p strong { color: var(--mist); font-weight: 600; }

/* =========================================================
   3 · THE SLIDE-IN DRAWER — off-canvas right; :target (no-JS) + JS polish
   ========================================================= */
.slidein-card { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.slidein-card p { color: var(--text-secondary); font-size: .96rem; line-height: 1.6; max-width: 54ch; }

.drawer {
  position: fixed; inset: 0; z-index: 3000; visibility: hidden; pointer-events: none;
}
.drawer:target, .drawer.is-open { visibility: visible; pointer-events: auto; }
body.drawer-open { overflow: hidden; }

.drawer-backdrop {
  position: absolute; inset: 0; background: rgba(4,2,9,.74); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity var(--transition-medium); cursor: pointer;
}
.drawer:target .drawer-backdrop, .drawer.is-open .drawer-backdrop { opacity: 1; }

.drawer-panel {
  position: absolute; top: 0; right: 0; height: 100%;
  width: min(420px, 92vw);
  display: flex; flex-direction: column;
  background: var(--bg-panel-strong); border-left: 1px solid var(--violet-deep);
  box-shadow: -40px 0 90px -40px rgba(0,0,0,.85), var(--glow-violet-soft);
  transform: translateX(100%); transition: transform var(--transition-medium);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.drawer:target .drawer-panel, .drawer.is-open .drawer-panel { transform: none; }

.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: clamp(24px, 4vh, 34px) clamp(22px, 5vw, 30px) 16px;
  border-bottom: 1px solid var(--border-secondary);
}
.drawer-head .label { display: block; margin-bottom: 8px; }
.drawer-head h2 { font-family: var(--display); font-weight: 600; font-size: 1.5rem; color: var(--mist); letter-spacing: -.015em; }
.drawer-close {
  flex: 0 0 auto; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-primary); border-radius: var(--radius-sm); color: var(--haze);
  font-size: 1.2rem; line-height: 1; cursor: pointer; text-decoration: none;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
.drawer-close:hover, .drawer-close:focus-visible { color: var(--mist); border-color: var(--border-active); background: rgba(139,92,255,.10); }
.drawer-body { padding: clamp(20px, 3vh, 28px) clamp(22px, 5vw, 30px) clamp(28px, 4vh, 36px); }
.drawer-body .drawer-intro { color: var(--text-secondary); font-size: .95rem; line-height: 1.6; margin-bottom: 20px; }

/* reduced motion: no slide, just appear (drawer + steps) */
@media (prefers-reduced-motion: reduce) {
  .drawer-panel, .drawer-backdrop { transition: none; }
  .wiz-step.is-active, .form-done.show, .wiz-result.show, .wiz-branch.show { animation: none; }
}

/* =========================================================
   JS-OFF FALLBACKS — the page must work with no script (house rule)
   ========================================================= */
/* wizard: with no JS, drop the chrome and stack every step as one form */
html:not(.js) .wiz-progress,
html:not(.js) .wiz-nav,
html:not(.js) .wiz-result { display: none; }
html:not(.js) .wiz-step { display: block; margin-bottom: 30px; }
html:not(.js) .wiz-branch { display: flex; flex-direction: column; gap: 10px; }
html:not(.js) .wiz-stack-submit { display: inline-flex !important; }
.wiz-stack-submit { display: none; }   /* only shown in the no-JS stacked view */
