/* Applicant page. Rail on the left (ink, build-plate grid), steps on the right. */

.shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(340px, 40%) 1fr; }

/* ── Rail ─────────────────────────────────────────────────────────────────── */
.rail {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
  padding: clamp(28px, 4vw, 56px);
  background-color: var(--ink); color: #f3f6fb;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 28px 28px;
  overflow: hidden;
}
.brand { font-family: var(--display); font-weight: 700; font-size: 1.125rem; text-decoration: none; letter-spacing: 0; }
.brand b { color: var(--heat); font-weight: 800; }
.intro { display: grid; gap: 18px; max-width: 30rem; }

.print { position: relative; font-size: clamp(2.5rem, 4.6vw, 4.25rem); font-stretch: 82%; line-height: 0.98; }
.print__text { display: block; clip-path: inset(100% 0 0 0); animation: printUp 1.05s steps(10, end) 0.2s forwards; }
.print__nozzle {
  position: absolute; left: -4px; right: -4px; top: 100%; height: 4px; border-radius: 2px;
  background: var(--heat); box-shadow: 0 0 16px 3px rgba(255, 91, 31, 0.7);
  animation: nozzleUp 1.05s steps(10, end) 0.2s forwards, nozzleOff 0.25s ease 1.3s forwards;
}
@keyframes printUp { to { clip-path: inset(0 0 0 0); } }
@keyframes nozzleUp { to { top: 0; } }
@keyframes nozzleOff { to { opacity: 0; } }

.sub { font-weight: 700; font-size: 1.125rem; color: #ffd2bf; }
.lede { color: #c9d2e4; font-size: 1rem; line-height: 1.55; max-width: 26rem; }

.rail__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.progress { font-size: 0.9688rem; color: #c9d2e4; max-width: 12rem; }
.progress b { color: #fff; font-weight: 700; display: block; font-size: 1.0625rem; }

/* print stack */
.stack { width: 168px; flex: none; }
.stack svg { width: 100%; height: auto; overflow: visible; }
.slab polygon { transition: opacity 0.4s, fill 0.4s; }
.slab .top { fill: var(--c); }
.slab .left { fill: color-mix(in srgb, var(--c) 72%, #000); }
.slab .right { fill: color-mix(in srgb, var(--c) 86%, #000); }
.slab.is-new { animation: drop 0.6s cubic-bezier(0.2, 1.5, 0.4, 1); }
.slab.is-ghost .top { fill: none; stroke: rgba(255, 255, 255, 0.28); stroke-width: 1.2; stroke-dasharray: 4 4; }
.slab.is-ghost .left, .slab.is-ghost .right { opacity: 0; }
.slab.is-active .top { fill: none; stroke: var(--heat); stroke-width: 2; stroke-dasharray: 5 4; animation: march 0.9s linear infinite; }
.slab.is-active .left, .slab.is-active .right { opacity: 0; }
@keyframes march { to { stroke-dashoffset: -18; } }
@keyframes drop { from { opacity: 0; transform: translateY(-26px); } }
.nozzle { animation: sweep 1.7s ease-in-out infinite alternate; }
.nozzle .tip { fill: var(--heat); filter: drop-shadow(0 0 5px rgba(255, 91, 31, 0.9)); }
.nozzle .body { fill: #fff; opacity: 0.92; }
@keyframes sweep { from { transform: translate(-30px, -15px); } to { transform: translate(30px, 15px); } }
.stack.is-done .nozzle { display: none; }

/* ── Main ─────────────────────────────────────────────────────────────────── */
.main { padding: clamp(24px, 5vw, 72px); display: flex; justify-content: flex-start; }
.stage { width: min(100%, 640px); min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; align-content: start; }
#stage { min-width: 0; }
.step { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; min-width: 0; animation: stepIn 0.45s var(--ease); }
.step.back { animation-name: stepBack; }
@keyframes stepIn { from { opacity: 0; transform: translateX(26px); } }
@keyframes stepBack { from { opacity: 0; transform: translateX(-26px); } }

.step__head { display: grid; gap: 8px; }
.step__head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-stretch: 88%; outline: none; }
.step__head p { color: var(--ink-3); max-width: 34rem; }

.group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; border: 0; padding: 0; margin: 0; min-width: 0; }
.group > legend, .group__title { font-weight: 700; font-size: 1.0625rem; padding: 0; margin-bottom: 2px; }
.group__title small { font-weight: 400; color: var(--ink-3); font-size: 0.9375rem; margin-left: 6px; }
.group.has-error .tiles { outline: 2px solid var(--red); outline-offset: 6px; border-radius: 10px; }
.group__error { display: none; color: var(--red); font-weight: 700; font-size: 0.9375rem; }
.group.has-error .group__error { display: block; animation: errIn 0.25s var(--ease); }

/* option tiles */
.tiles { display: grid; gap: 10px; }
.tiles--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { position: relative; display: block; }
.tile input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.tile__body {
  position: relative; display: flex; gap: 14px; align-items: flex-start; min-height: 64px; padding: 16px 18px;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper);
  overflow: hidden; isolation: isolate; transition: border-color 0.2s, color 0.25s;
}
.tile__body::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform 0.34s var(--ease);
}
.tile:hover .tile__body { border-color: #8e9ab0; }
.tile input:checked + .tile__body { color: #fff; border-color: var(--ink); }
.tile input:checked + .tile__body::before { transform: scaleX(1); }
.tile input:focus-visible + .tile__body { outline: 3px solid var(--heat); outline-offset: 2px; }
.tile__mark {
  flex: none; width: 22px; height: 22px; margin-top: 1px; border: 2px solid #8e9ab0; border-radius: 50%;
  display: grid; place-items: center; transition: background-color 0.2s, border-color 0.2s;
}
.tile--check .tile__mark { border-radius: 6px; }
.tile__mark::after {
  content: ''; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2.5px 2.5px;
  transform: rotate(-45deg) scale(0) translate(1px, -1px); transition: transform 0.2s var(--ease);
}
.tile input:checked + .tile__body .tile__mark { background: var(--heat); border-color: var(--heat); }
.tile input:checked + .tile__body .tile__mark::after { transform: rotate(-45deg) scale(1) translate(1px, -1px); }
.tile__text { display: grid; gap: 2px; min-width: 0; }
.tile__title { font-weight: 700; line-height: 1.25; }
.tile__sub { font-size: 0.9375rem; color: var(--ink-3); line-height: 1.4; transition: color 0.25s; }
.tile input:checked + .tile__body .tile__sub { color: #c9d2e4; }
.tile--place .tile__title { font-family: var(--display); font-size: 1.5rem; font-stretch: 90%; }

.reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s var(--ease); }
.reveal > div { overflow: hidden; min-height: 0; }
.reveal.is-open { grid-template-rows: 1fr; }
.reveal.is-open > div { padding: 4px 3px 6px; }

.form-grid { display: grid; gap: 20px; }

/* resume drop zone */
.drop {
  display: grid; gap: 4px; justify-items: start; padding: 18px; border: 1.5px dashed #8e9ab0; border-radius: var(--radius);
  background: var(--paper); cursor: pointer; transition: border-color 0.2s, background-color 0.2s;
}
.drop:hover, .drop.is-over { border-color: var(--ink); background: #fff; }
.drop input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.drop:focus-within { outline: 3px solid var(--heat); outline-offset: 2px; }
.drop__file { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; font-weight: 700; }
.drop__file small { color: var(--ink-3); font-weight: 400; }

/* ── Availability grid ────────────────────────────────────────────────────── */
.avail { display: grid; gap: 12px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.grid {
  display: grid; grid-template-columns: 82px repeat(7, minmax(0, 1fr)); gap: 6px;
  padding: 14px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.grid__day { text-align: center; font-weight: 700; font-size: 0.875rem; padding-bottom: 2px; }
.grid__row { align-self: center; font-size: 0.8125rem; line-height: 1.15; color: var(--ink-2); font-weight: 700; }
.grid__row small { display: block; font-weight: 400; color: var(--ink-3); font-size: 0.75rem; }
.cell {
  position: relative; height: 48px; padding: 0; border: 1.5px solid var(--line); border-radius: 7px; background: #fff; overflow: hidden;
  transition: border-color 0.15s;
}
.cell::before {
  content: ''; position: absolute; inset: 0; background: var(--ink); transform: scaleY(0); transform-origin: bottom;
  transition: transform 0.22s var(--ease);
}
.cell::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--heat);
  transform: translateY(-4px); transition: transform 0.22s var(--ease);
}
.cell:hover { border-color: var(--ink); }
.cell[aria-pressed='true'] { border-color: var(--ink); }
.cell[aria-pressed='true']::before { transform: scaleY(1); }
.cell[aria-pressed='true']::after { transform: translateY(0); }
.cell.ro { pointer-events: none; height: 34px; }
.grid__count { font-size: 0.9375rem; color: var(--ink-3); min-height: 1.5em; }
.grid__count b { color: var(--ink); }

/* ── Test run time ────────────────────────────────────────────────────────── */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin: 0 -2px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.day {
  flex: none; scroll-snap-align: start; display: grid; justify-items: center; gap: 0; width: 72px; padding: 10px 4px 9px;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper); transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.day:hover { border-color: var(--ink); }
.day small { font-size: 0.8125rem; color: var(--ink-3); font-weight: 700; }
.day b { font-family: var(--display); font-size: 1.75rem; line-height: 1.1; font-stretch: 90%; }
.day span { font-size: 0.75rem; color: var(--ink-3); }
.day[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }
.day[aria-pressed='true'] small, .day[aria-pressed='true'] span { color: #c9d2e4; }
.day.has-pick { box-shadow: inset 0 -4px 0 var(--heat); }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.slot {
  min-height: 50px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper);
  font-weight: 700; font-variant-numeric: tabular-nums; position: relative; overflow: hidden; isolation: isolate;
  transition: border-color 0.2s, color 0.2s;
  animation: slotIn 0.35s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 28ms);
}
@keyframes slotIn { from { opacity: 0; transform: translateY(8px); } }
.slot::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--ink); transform: scaleY(0); transform-origin: bottom; transition: transform 0.25s var(--ease); }
.slot:hover:not([disabled]) { border-color: var(--ink); }
.slot[aria-pressed='true'] { color: #fff; border-color: var(--ink); }
.slot[aria-pressed='true']::before { transform: scaleY(1); }
.slot[disabled] {
  cursor: not-allowed; color: #98a1b4; border-style: dashed; text-decoration: line-through;
  background: repeating-linear-gradient(135deg, transparent 0 7px, rgba(22, 32, 61, 0.05) 7px 8px);
}
.tznote { color: var(--ink-3); font-size: 0.9375rem; }
.picked {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border-left: 5px solid var(--heat); background: #fff; border-radius: 4px 10px 10px 4px; font-weight: 700;
}
.skeleton { height: 50px; border-radius: 10px; background: linear-gradient(100deg, #dfe4eb 30%, #eef1f5 50%, #dfe4eb 70%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.notice { padding: 14px 16px; border-radius: 10px; background: #fff; border: 1.5px solid var(--line); }
.notice b { display: block; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-weight: 700; font-size: 0.9375rem; }
.or::before, .or::after { content: ''; height: 1px; background: var(--line); flex: 1; }

/* ── Review ───────────────────────────────────────────────────────────────── */
.review { display: grid; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.rrow { display: grid; grid-template-columns: 9.5rem 1fr auto; gap: 8px 16px; align-items: start; padding: 16px 18px; }
.rrow + .rrow { border-top: 1.5px solid var(--line-2); }
.rrow dt { color: var(--ink-3); font-weight: 700; font-size: 0.9375rem; }
.rrow dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.rrow dd small { display: block; font-weight: 400; color: var(--ink-3); }
.link { background: none; border: 0; padding: 4px 2px; font-weight: 700; color: var(--heat-text); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--ink); }
.mini { grid-template-columns: 4px repeat(7, 1fr); padding: 0; border: 0; background: none; max-width: 330px; gap: 4px; touch-action: auto; }
.mini .cell { height: 16px; border-radius: 4px; }
.mini .grid__day { font-size: 0.6875rem; }

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 6px; }
.nav .btn--primary { min-width: 180px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── Success ──────────────────────────────────────────────────────────────── */
.done { display: grid; gap: 26px; animation: stepIn 0.5s var(--ease); }
.done h2 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-stretch: 80%; }
.ticket { display: grid; gap: 4px; padding: 22px 24px; background: #fff; border-radius: var(--radius); border-left: 6px solid var(--heat); }
.ticket__when { font-family: var(--display); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; font-stretch: 88%; line-height: 1.1; }
.ticket__where { color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.expect { display: grid; gap: 10px; padding-left: 0; list-style: none; margin: 0; }
.expect li { position: relative; padding-left: 28px; }
.expect li::before { content: ''; position: absolute; left: 4px; top: 0.55em; width: 12px; height: 3px; background: var(--heat); border-radius: 2px; }

/* ── Small screens ────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .shell { display: block; }
  .rail { position: relative; height: auto; display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 14px 12px; padding: 20px 20px 24px; }
  .brand { grid-column: 1 / -1; }
  .intro { grid-column: 1; gap: 10px; }
  .print { font-size: clamp(2.2rem, 11vw, 3.2rem); }
  .lede { display: none; }
  [data-step='0'] .lede { display: block; font-size: 0.9688rem; }
  .rail__foot { grid-column: 2; grid-row: 2; flex-direction: column; align-items: flex-end; }
  .stack { width: 96px; }
  .progress { display: none; }
  .main { padding: 22px 18px 120px; }
  .stage { gap: 24px; }
  .nav {
    position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    background: rgba(231, 235, 239, 0.94); backdrop-filter: blur(10px); border-top: 1.5px solid var(--line);
  }
  .nav .btn--primary { flex: 1; }
  .tiles--2 { grid-template-columns: 1fr; }
  .rrow { grid-template-columns: 1fr auto; }
  .rrow dt { grid-column: 1 / -1; }
  .toasts { bottom: 96px; }
}
@media (max-width: 420px) {
  .grid { padding: 10px; gap: 4px; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
  .grid__row { font-size: 0.71rem; }
  .grid__row small { display: none; }
  .cell { height: 44px; }
  .slots { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .print__text { clip-path: none; animation: none; }
  .print__nozzle { display: none; }
  .nozzle { animation: none; }
}
