/* ==========================================================
   Lewis brand tokens, pulled from the Lewis OS deck.
   Freight Display Pro / Sohne are licensed. If you have the OTF
   files, drop them in /public/fonts and add @font-face rules
   above the fallback stack below. Until then this uses the
   documented web fallbacks (Georgia / Helvetica Neue).
   ========================================================== */
:root {
  --red: #FF2C3F;
  --red-press: #E01F31;
  --charcoal: #373638;
  --charcoal-80: #5A595B;
  --charcoal-50: #9B9A9C;
  --white: #FFFFFF;
  --cream: #F5F3EF;
  --cream-deep: #EBE7E0;
  --ink: #121114; /* deck's near-black background */
  --font-display: "Freight Display Pro", Georgia, "Times New Roman", serif;
  --font-sans: "Sohne", "Helvetica Neue", Arial, sans-serif;
  --radius-md: 12px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  color: var(--white);
  background: var(--ink);
  max-width: 780px;
  margin: 0 auto;
  padding: 64px 24px 100px;
  -webkit-font-smoothing: antialiased;
}

body.register-stage-active {
  max-width: none;
  min-height: 100dvh;
  padding: 24px;
  display: grid;
  place-items: center;
}
body.register-stage-active .logo-mark,
body.register-stage-active #progress-bar {
  display: none;
}
body.register-stage-active #step-register {
  width: min(100%, 460px);
}

#progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.12);
  z-index: 10;
}
#progress-fill {
  height: 100%;
  width: 0%;
  background: var(--red);
  transition: width 0.4s ease;
}

.logo-mark { width: 40px; height: 40px; margin-bottom: 32px; }
.logo-mark img { width: 100%; height: 100%; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 20px;
  display: block;
}

.step { display: none; }
.step.active { display: block; animation: rise 0.6s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 2.4rem;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--white);
  margin: 0 0 12px;
}
h1 .ital { font-style: italic; color: var(--red); }

p { line-height: 1.55; color: rgba(255,255,255,0.75); margin: 0 0 20px; }

.register-form {
  display: grid;
  gap: 12px;
  margin: 28px 0 16px;
}
.register-form label {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
}
.register-form input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  font-size: 1rem;
  font-family: var(--font-sans);
  background: rgba(255,255,255,0.04);
  color: var(--white);
}
.register-form button { justify-self: start; }

.media-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  margin: 24px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.media-frame iframe, .media-frame video { width: 100%; height: 100%; border: none; }

#step-deck-1.active,
#step-deck-2.active {
  position: fixed;
  inset: 0;
  z-index: 5;
  width: 100vw;
  max-width: none;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #000;
}
#step-deck-1 .media-frame,
#step-deck-2 .media-frame {
  position: absolute;
  inset: 0 0 78px;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
}
.deck-completion-bar {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  min-height: 78px;
  padding: 12px max(20px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.12);
}
.deck-completion-bar p {
  margin: 0;
  color: rgba(255,255,255,0.68);
  font-size: 0.85rem;
  text-align: right;
}
.deck-completion-bar button {
  flex: 0 0 auto;
  padding: 11px 22px;
}
.deck-stage-active .logo-mark,
.deck-stage-active #progress-bar {
  display: none;
}

@media (max-width: 560px) {
  #step-deck-1 .media-frame,
  #step-deck-2 .media-frame {
    bottom: 92px;
  }
  .deck-completion-bar {
    min-height: 92px;
    gap: 10px;
  }
  .deck-completion-bar p {
    max-width: 170px;
    font-size: 0.76rem;
  }
}

#step-videos.active {
  position: fixed;
  inset: 0;
  z-index: 5;
  width: 100vw;
  max-width: none;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 24px 24px max(24px, env(safe-area-inset-bottom));
  background: #000;
}
#step-videos .media-frame {
  position: relative;
  inset: auto;
  flex: 1;
  min-height: 0;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  margin: 0 0 14px;
  border: 0;
  border-radius: 0;
}
#step-videos .media-frame #video-player { width: 100%; height: 100%; }
#step-videos .hint {
  position: relative;
  z-index: 1;
  margin: 0 0 14px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(18,17,20,0.78);
  color: rgba(255,255,255,0.86);
  text-align: center;
}
#step-videos #video-continue, #step-videos #video-retry {
  position: relative;
  z-index: 1;
}
#step-videos #video-retry:not([hidden]) { margin-bottom: 12px; }

button, .branch-btn {
  padding: 14px 28px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease;
}
button:hover:not(:disabled) { background: var(--red-press); }
button:disabled { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.4); cursor: not-allowed; }

.sign-block { margin-top: 28px; }
.sign-intro {
  margin: 0 0 18px;
  max-width: 680px;
  color: rgba(255,255,255,0.72);
  line-height: 1.5;
}
.sign-block input[type="text"], .sign-block textarea {
  width: 100%;
  padding: 12px 14px;
  margin: 8px 0 18px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  font-size: 1rem;
  font-family: var(--font-sans);
  background: rgba(255,255,255,0.04);
  color: var(--white);
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: rgba(255,255,255,0.8);
  font-size: 0.92rem;
}
.checkbox-row input { width: auto; }

.branch-options {
  display: grid;
  gap: 0;
  margin-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.2);
}
.branch-instruction {
  margin-bottom: 0;
  color: rgba(255,255,255,0.68);
  font-size: 0.92rem;
}
.branch-btn {
  position: relative;
  width: 100%;
  background: none;
  color: var(--white);
  text-align: left;
  border-radius: 0;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding: 28px 44px 28px 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.3rem;
}
.branch-btn:hover:not(:disabled) { background: none; color: var(--red); }
.branch-btn.selected { color: var(--red); }
.branch-check {
  position: absolute;
  top: 30px;
  right: 2px;
  width: 21px;
  height: 21px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 4px;
}
.branch-btn.selected .branch-check {
  border-color: var(--red);
  background: var(--red);
}
.branch-btn.selected .branch-check::after {
  content: "✓";
  display: block;
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
}
.branch-btn .label {
  display: block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--white);
}

.hidden { display: none; }
.error { color: #FF8A80; font-size: 0.9rem; }
.hint { color: var(--charcoal-50); font-size: 0.9rem; }
.response-block { margin-top: 24px; }
.response-block label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
}
.response-block textarea {
  display: block;
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  resize: vertical;
  font-size: 1rem;
  font-family: var(--font-sans);
  background: rgba(255,255,255,0.04);
  color: var(--white);
}
#branch-submit { margin-top: 24px; }
#branch-error { margin-top: 12px; }
