:root {
  --black: #050505;
  --near-black: #101010;
  --ink: #151515;
  --white: #f8f5ed;
  --paper: #f4efe2;
  --muted: #b7ab92;
  --gold: #c9a227;
  --gold-soft: #ead98b;
  --red: #a72b21;
  --line: rgba(248, 245, 237, 0.18);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  --radius: 22px;
  --max: 760px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(201, 162, 39, 0.15), transparent 32%),
    radial-gradient(circle at 90% 18%, rgba(167, 43, 33, 0.12), transparent 28%),
    linear-gradient(180deg, #050505 0%, #111 48%, #050505 100%);
  color: var(--white);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  line-height: 1.5;
}

button, input, textarea, select { font: inherit; }

button { cursor: pointer; }

.app-shell {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 18px 16px 180px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.brand-mark {
  display: inline-grid;
  gap: 3px;
  line-height: 0.9;
  letter-spacing: -0.05em;
  font-weight: 900;
  font-size: clamp(30px, 8vw, 54px);
  text-transform: uppercase;
}

.brand-row { display: flex; align-items: center; gap: 7px; }
.brand-bar { display: block; height: 16px; width: 52px; background: var(--white); }
.brand-bar.short { width: 34px; }
.brand-bar.long { width: 96px; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold-soft);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0; line-height: 1.05; letter-spacing: -0.035em; }
h1 { font-size: clamp(42px, 12vw, 76px); text-transform: uppercase; }
h2 { font-size: clamp(30px, 8vw, 48px); }
h3 { font-size: 24px; }

p { margin: 0; }

.card {
  background: rgba(248, 245, 237, 0.07);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-pad { padding: 22px; }

.hero-card {
  position: relative;
  min-height: 430px;
  padding: 28px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.44), rgba(0, 0, 0, 0.82)),
    repeating-linear-gradient(0deg, rgba(244, 239, 226, 0.05) 0 1px, transparent 1px 32px),
    linear-gradient(135deg, #15100d, #050505);
}

.hero-card::after {
  content: "SECRET";
  position: absolute;
  top: 22px;
  right: -18px;
  color: rgba(167, 43, 33, 0.42);
  border: 3px solid rgba(167, 43, 33, 0.34);
  padding: 3px 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
  transform: rotate(12deg);
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 360px;
  align-content: space-between;
}

.big-line { color: var(--white); }
.big-line span { color: var(--gold); }

.subcopy {
  margin-top: 18px;
  color: rgba(248, 245, 237, 0.82);
  font-size: 20px;
  max-width: 35rem;
}

.form-stack { display: grid; gap: 16px; margin-top: 22px; padding-bottom: 80px; }

label { display: block; font-weight: 800; margin-bottom: 8px; }

input[type="text"], textarea, input[list], select {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid transparent;
  border-radius: 14px;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.16);
}

textarea {
  min-height: 180px;
  resize: vertical;
}

.help-text { color: var(--muted); font-size: 15px; }

.primary-btn, .secondary-btn, .ghost-btn {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.primary-btn {
  background: var(--gold);
  color: #080808;
}

.secondary-btn {
  background: var(--white);
  color: #080808;
}

.ghost-btn {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--line);
}

.primary-btn:disabled, .secondary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.progress-card { padding: 14px; margin: 18px 0; }
.progress-map {
  width: 100%;
  display: block;
  border-radius: 16px;
  background: #000;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.zone-card { margin-top: 18px; margin-bottom: 120px; }
.question-block {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.question-block:first-child { border-top: 0; padding-top: 0; }
.question-text { font-size: 21px; font-weight: 900; margin-bottom: 14px; }
.options-grid { display: grid; gap: 10px; }
.option-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 14px;
  color: var(--white);
  background: rgba(248, 245, 237, 0.08);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.option-card input { width: 22px; height: 22px; accent-color: var(--gold); }
.option-card:has(input:checked) {
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.16);
}

.status-msg {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(248, 245, 237, 0.08);
  color: var(--white);
}
.status-msg.error { border: 1px solid rgba(167, 43, 33, 0.7); }
.status-msg.success { border: 1px solid rgba(201, 162, 39, 0.75); }

.sticky-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, #050505 18%, #050505 100%);
}
.sticky-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
  display: grid;
  gap: 8px;
}
.sticky-inner button { width: 100%; }

.file-input {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  padding: 16px;
  border: 2px dashed rgba(201, 162, 39, 0.65);
  border-radius: 18px;
  background: rgba(201, 162, 39, 0.08);
}
.file-input span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.file-input input {
  color: var(--white);
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  white-space: normal;
}
#photoPreview {
  max-width: 100%;
  overflow: hidden;
}
.preview-img { max-width: 100%; height: auto; border-radius: 14px; margin-top: 12px; }

.completion-card { text-align: center; padding: 32px 22px; }
.completion-card h2 { margin-bottom: 14px; }

.pdf-root {
  position: fixed;
  top: 0;
  left: -99999px;
  width: 794px;
  background: #fff;
  color: #111;
}

.pdf-page {
  width: 794px;
  min-height: 1123px;
  padding: 56px;
  background: #fff;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  page-break-after: always;
}
.pdf-page:last-child { page-break-after: auto; }
.pdf-page h1 { color: #111; font-size: 42px; }
.pdf-page h2 { color: #111; font-size: 28px; margin: 22px 0 10px; }
.pdf-page p { color: #111; margin: 8px 0; }
.pdf-kicker { color: #8a6a00 !important; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.pdf-answer { border-left: 5px solid #c9a227; padding: 8px 0 8px 14px; margin: 10px 0 18px; }

.hidden { display: none !important; }

@media (max-width: 520px) {
  .app-shell { padding-left: 12px; padding-right: 12px; padding-bottom: 220px; }
  .hero-card { min-height: 400px; padding: 22px; }
  .card-pad { padding: 18px; }
  .brand-bar.long { width: 72px; }
}

/* MCQ feedback states */
.option-card.selected.correct,
.option-card.correct-answer {
  border-color: #C9A227;
  background: rgba(201, 162, 39, 0.18);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.35);
}

.option-card.selected.incorrect {
  border-color: #800000;
  background: rgba(128, 0, 0, 0.22);
  box-shadow: 0 0 0 2px rgba(128, 0, 0, 0.4);
}

.mcq-feedback {
  margin-top: 0.75rem;
  font-weight: 800;
  line-height: 1.35;
}

.correct-feedback {
  color: #C9A227;
}

.incorrect-feedback {
  color: #fff;
}

.correct-answer-chip {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid #C9A227;
  background: rgba(201, 162, 39, 0.2);
  color: #fff;
}

.source-warning {
  display: block;
  margin-top: 0.4rem;
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  font-weight: 500;
}

.name-picker {
  position: relative;
}

.name-results {
  position: relative;
  z-index: 20;
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 10px;
  padding: 10px;
  background: rgba(5, 5, 5, 0.96);
  border: 1px solid var(--line);
  border-radius: 14px;
  -webkit-overflow-scrolling: touch;
}

.name-option {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid transparent;
  border-radius: 12px;
  font-weight: 800;
  text-align: left;
}

.name-option:active,
.name-option:focus {
  border-color: var(--gold);
  background: var(--gold-soft);
  outline: none;
}

.help-text.compact {
  margin-top: 8px;
  font-size: 14px;
}
