:root {
  color-scheme: dark;
  --bg: #0f1216;
  --bg-soft: #161b21;
  --panel: linear-gradient(180deg, rgba(28, 32, 38, 0.94), rgba(17, 20, 24, 0.96));
  --panel-strong: #1b2026;
  --panel-alt: rgba(20, 24, 29, 0.84);
  --line: rgba(201, 160, 88, 0.18);
  --line-strong: rgba(201, 160, 88, 0.36);
  --text: #f4efe6;
  --muted: #b1a79a;
  --muted-strong: #d0c4b3;
  --accent: #c9a058;
  --accent-soft: #f0d6a2;
  --accent-strong: #8c6526;
  --success: #65c491;
  --danger: #ef8f75;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Aptos", "Segoe UI Variable Text", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(10, 12, 15, 0.72), rgba(7, 8, 10, 0.88)),
    radial-gradient(circle at top left, rgba(201, 160, 88, 0.16), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(201, 160, 88, 0.1), transparent 18%),
    url('/shared-assets/fondowhitelist.png') center center / cover fixed no-repeat,
    linear-gradient(180deg, #13171c 0%, #0b0d10 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(201, 160, 88, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 160, 88, 0.028) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 88%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
    radial-gradient(circle at 50% 0%, rgba(201, 160, 88, 0.12), transparent 34%);
  mix-blend-mode: screen;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 88px;
}

.masthead,
.hero-card,
.panel-card,
.feedback,
.note-box {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.masthead::before,
.hero-card::before,
.panel-card::before,
.feedback::before,
.note-box::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(201, 160, 88, 0.12), transparent 28%, transparent 72%, rgba(201, 160, 88, 0.07));
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 28px;
  align-items: center;
  padding: 34px 34px 30px;
  margin-bottom: 22px;
}

.masthead h1,
.hero-card h1,
.panel-card h2,
.sheet-section-head h3 {
  margin: 0;
  font-family: "Cormorant Garamond", "Georgia", serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 0.95;
}

.masthead h1,
.hero-card h1 {
  font-size: clamp(2.7rem, 5vw, 4.5rem);
}

.hero-card--start .hero-title-brand {
  font-size: clamp(3.8rem, 8vw, 6.8rem);
  line-height: 0.88;
  letter-spacing: 0.02em;
  text-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
}

.panel-card h2 {
  font-size: clamp(1.85rem, 2.6vw, 2.5rem);
}

.sheet-section-head h3 {
  font-size: 1.5rem;
}

.masthead p,
.hero-card p,
.panel-card p,
.sheet-section-head p,
.field span,
.status-meta,
.feedback,
.note-box p,
.step-pill,
.wait-card p {
  color: var(--muted);
  line-height: 1.65;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-soft);
}

.hero-subtitle {
  margin-top: 12px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--accent-soft);
}

.eyebrow::before {
  content: "";
  width: 36px;
  height: 2px;
  background: currentColor;
  opacity: 0.72;
}

.hero-card,
.panel-card {
  padding: 30px 32px;
}

.hero-card--status,
.panel-head,
.status-meta,
.step-strip,
.quiz-options,
.sheet-grid {
  display: grid;
  gap: 18px;
}

.hero-card--status,
.panel-head {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.hero-card--start,
.hero-card--loading,
.wait-card,
.success-card {
  text-align: center;
}

.hero-card--start {
  padding-top: 40px;
}

.hero-card--loading {
  padding: 72px 24px;
}

.spinner {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 4px solid rgba(201, 160, 88, 0.12);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

.feedback {
  margin-bottom: 18px;
  padding: 16px 20px;
  font-weight: 600;
}

.feedback.success {
  border-color: rgba(101, 196, 145, 0.26);
  color: var(--success);
  background: linear-gradient(180deg, rgba(27, 44, 36, 0.95), rgba(17, 28, 23, 0.96));
}

.feedback.error,
.field--error small {
  border-color: rgba(239, 143, 117, 0.24);
  color: var(--danger);
}

.feedback.error {
  background: linear-gradient(180deg, rgba(55, 25, 20, 0.95), rgba(33, 15, 14, 0.96));
}

.stack-form,
.sheet-form,
.quiz-form {
  display: grid;
  gap: 20px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.inline-actions--account {
  justify-content: end;
}

.auth-launcher {
  max-width: 860px;
  margin: 0 auto;
}

.masthead-brand,
.hero-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hero-brand--centered {
  justify-content: center;
  margin-bottom: 18px;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.brand-mark {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 36%, rgba(240, 198, 106, 0.20), rgba(14, 14, 15, 0.94) 72%);
  border: 1px solid rgba(240, 198, 106, 0.42);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-mark--large {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
}

.brand-mark--hero {
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
}

.brand-mark--small {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
}

label,
.field {
  display: grid;
  gap: 8px;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(201, 160, 88, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(16, 19, 24, 0.98), rgba(24, 28, 33, 0.95));
  padding: 15px 16px;
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(201, 160, 88, 0.62);
  box-shadow: 0 0 0 4px rgba(201, 160, 88, 0.12);
  background: linear-gradient(180deg, rgba(19, 23, 28, 1), rgba(27, 31, 36, 0.98));
}

textarea {
  resize: vertical;
  min-height: 120px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(240, 214, 162, 0.9) 50%),
    linear-gradient(135deg, rgba(240, 214, 162, 0.9) 50%, transparent 50%),
    linear-gradient(180deg, rgba(16, 19, 24, 0.98), rgba(24, 28, 33, 0.95));
  background-position:
    calc(100% - 24px) calc(50% - 2px),
    calc(100% - 18px) calc(50% - 2px),
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
  padding-right: 42px;
}

select option {
  color: #f4efe6;
  background: #1b2026;
}

input::placeholder,
textarea::placeholder {
  color: rgba(177, 167, 154, 0.58);
}

button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease, border-color 160ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
}

button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

button.primary,
button.ghost {
  padding: 14px 24px;
}

button.primary {
  background: linear-gradient(135deg, #f0d6a2 0%, #c79a4b 48%, #8c6526 100%);
  color: #18130b;
  box-shadow: 0 16px 32px rgba(92, 65, 24, 0.34);
}

button.ghost {
  border: 1px solid rgba(201, 160, 88, 0.14);
  background: rgba(18, 22, 27, 0.9);
  color: var(--muted-strong);
}

button.ghost:hover:not(:disabled) {
  border-color: rgba(201, 160, 88, 0.3);
  color: var(--text);
}

.step-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 22px 0 18px;
}

.step-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-radius: 999px;
  border: 1px solid rgba(201, 160, 88, 0.14);
  background: rgba(18, 22, 27, 0.82);
  font-size: 0.95rem;
}

.step-pill span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(201, 160, 88, 0.12);
  color: var(--accent-soft);
  font-weight: 700;
}

.step-pill.current {
  border-color: rgba(201, 160, 88, 0.42);
  background: linear-gradient(90deg, rgba(201, 160, 88, 0.16), rgba(201, 160, 88, 0.08));
  color: var(--accent-soft);
}

.step-pill.done span,
.success-badge {
  background: rgba(101, 196, 145, 0.16);
  color: var(--success);
}

.quiz-question {
  margin: 0;
  padding: 22px 20px 20px;
  border: 1px solid rgba(201, 160, 88, 0.12);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(15, 18, 22, 0.94), rgba(23, 26, 31, 0.9));
}

.quiz-question legend {
  padding: 0 12px;
  font-weight: 700;
  color: var(--muted-strong);
}

.quiz-options,
.sheet-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(201, 160, 88, 0.1);
  background: rgba(24, 28, 33, 0.88);
  color: var(--muted-strong);
}

.quiz-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.sheet-section + .sheet-section {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(201, 160, 88, 0.08);
}

.sheet-section-head {
  margin-bottom: 18px;
}

.sheet-section-head p {
  max-width: 70ch;
}

.field span {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--accent-soft);
}

.field small {
  font-size: 0.84rem;
}

.field--error input,
.field--error textarea,
.field--error select {
  border-color: rgba(239, 143, 117, 0.42);
  box-shadow: 0 0 0 4px rgba(239, 143, 117, 0.08);
}

.note-box {
  padding: 18px 20px;
  margin-bottom: 18px;
  border-style: solid;
  background: linear-gradient(180deg, rgba(23, 27, 32, 0.94), rgba(16, 18, 22, 0.94));
}

.note-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-soft);
}

.note-box a {
  color: var(--accent-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 160, 88, 0.35);
}

.note-box a:hover {
  color: var(--text);
  border-bottom-color: rgba(201, 160, 88, 0.7);
}

.status-meta {
  justify-items: end;
  align-content: start;
}

.status-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(201, 160, 88, 0.12);
  background: rgba(17, 21, 25, 0.9);
}

.success-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wait-card,
.success-card {
  padding-top: 38px;
  padding-bottom: 38px;
}

.panel-head p,
.wait-card p,
.success-card p,
.hero-card--start p {
  max-width: 62ch;
  margin-left: auto;
  margin-right: auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .masthead,
  .hero-card--status,
  .panel-head,
  .quiz-options,
  .sheet-grid,
  .step-strip {
    grid-template-columns: 1fr;
  }

  .status-meta {
    justify-items: stretch;
  }

  .inline-actions--account,
  .sheet-actions {
    justify-content: stretch;
  }

  .masthead-brand,
  .hero-brand {
    align-items: flex-start;
  }

  .inline-actions--account > *,
  .sheet-actions > * {
    flex: 1 1 100%;
  }

  .shell {
    width: min(100% - 22px, 1080px);
    padding-top: 20px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 18px, 1080px);
    padding-bottom: 56px;
  }

  .masthead,
  .hero-card,
  .panel-card,
  .feedback,
  .note-box {
    border-radius: 24px;
  }

  .masthead,
  .hero-card,
  .panel-card {
    padding: 24px 20px;
  }

  .masthead-brand,
  .hero-brand {
    gap: 14px;
  }

  .masthead h1,
  .hero-card h1 {
    font-size: clamp(2.3rem, 11vw, 3.5rem);
  }

  .hero-card--start .hero-title-brand {
    font-size: clamp(3.1rem, 14vw, 4.9rem);
  }

  .hero-subtitle {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
  }
}