﻿/* ============================================================================
   Serendib - Compatibility Profile styles.
   Extends styles.css (same palette, same type system, same "$10K" restraint).
   Only NEW component classes live here - nothing here redefines the brand.
   ========================================================================== */

.compat-header {
  text-align: center;
  padding: clamp(2.4rem, 7vh, 4rem) var(--pad) 0;
}
.compat-back {
  display: inline-block; margin-bottom: 1.6rem;
  font-family: var(--label); font-size: 0.68rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
}
.compat-back:hover { color: var(--gold); }

.compat-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--pad) clamp(4rem, 10vh, 7rem);
}

/* The browser's default `[hidden]{display:none}` rule is easily beaten by
   any later same-specificity author rule (e.g. `.quiz-nav{display:flex}`
   below) - so it must be reinforced here, or "hidden" stops hiding once a
   display value is set on the same element elsewhere in this file. */
[hidden] { display: none !important; }

/* ---- Progress ---------------------------------------------------------- */
.quiz-progress {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  margin: 0 0 clamp(2rem, 5vh, 3rem);
}
.quiz-progress-label {
  font-family: var(--label); font-size: 0.66rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.quiz-progress-track {
  flex: 1; max-width: 220px; height: 2px; border-radius: 2px;
  background: var(--line); overflow: hidden;
}
.quiz-progress-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  transition: width .4s ease;
}
@media (prefers-reduced-motion: reduce) { .quiz-progress-fill { transition: none; } }

/* ---- Steps -------------------------------------------------------------- */
.quiz-step {
  display: none;
  opacity: 0; transform: translateY(10px);
  transition: opacity .5s ease, transform .5s ease;
}
.quiz-step.active { display: block; }
.quiz-step.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .quiz-step { transition: none; } }

.quiz-step-inner { text-align: center; }
.quiz-eyebrow { display: block; margin-bottom: 1rem; }
.quiz-question {
  font-size: clamp(1.5rem, 3.6vw, 2.1rem);
  line-height: 1.18; margin: 0 auto;
  max-width: 30ch;
}
.quiz-help {
  color: var(--muted); margin: 0.85rem auto 0; max-width: 46ch;
  font-size: clamp(0.96rem, 0.92rem + 0.2vw, 1.05rem);
}

/* ---- Intro screen --------------------------------------------------------- */
.quiz-intro-title {
  font-size: clamp(2rem, 6vw, 3rem);
  margin: 0.6rem 0 0;
}
.quiz-intro-lead {
  color: var(--muted); max-width: 42ch; margin: 1.2rem auto 0;
  font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.16rem);
}
.quiz-intro-note {
  margin-top: 1.4rem; font-size: 0.86rem; color: var(--muted);
}
.quiz-start-btn { margin-top: clamp(2rem, 5vh, 2.6rem); }

/* ---- Options (single-choice buttons) --------------------------------- */
.option-list {
  display: grid; gap: 0.7rem;
  margin: clamp(1.8rem, 5vh, 2.6rem) auto 0;
}
.option {
  position: relative;
  display: block;
  text-align: left;
  width: 100%;
  font-family: var(--body); font-size: 1rem; color: var(--cream);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.95rem 1.15rem;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .15s ease;
}
.option:hover { border-color: rgba(232,199,126,0.5); transform: translateY(-1px); }
.option:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.option[aria-pressed="true"] {
  border-color: var(--gold);
  background: rgba(232,199,126,0.10);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.option[aria-pressed="true"]::after {
  content: "✓";
  position: absolute; right: 1.05rem; top: 50%; transform: translateY(-50%);
  color: var(--gold); font-weight: 700;
}
html[data-theme="light"] .option { background: #FFFFFF; }

/* ---- Q1 form fields (native selects/inputs, reuse .signup look) ------- */
.quiz-fields {
  display: grid; gap: 0.85rem;
  margin: clamp(1.8rem, 5vh, 2.6rem) auto 0;
  text-align: left;
}
.quiz-field label {
  display: block; margin-bottom: 0.35rem;
  font-family: var(--label); font-size: 0.66rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
}
.quiz-field select,
.quiz-field input[type="text"],
.quiz-field textarea {
  width: 100%;
  font-family: var(--body); font-size: 1rem; color: var(--cream);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1.05rem;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.quiz-field select { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23E8C77E' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center;
  padding-right: 2.4rem;
}
.quiz-field select option { background: var(--ink-2); color: var(--cream); }
.quiz-field textarea { resize: vertical; min-height: 84px; font-family: var(--body); line-height: 1.5; }
.quiz-field select:focus, .quiz-field input:focus, .quiz-field textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,199,126,0.16);
}
html[data-theme="light"] .quiz-field select,
html[data-theme="light"] .quiz-field input,
html[data-theme="light"] .quiz-field textarea { background: #FFFFFF; }

/* ---- Q7 rank chips (top 3 of 8) --------------------------------------- */
.rank-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem;
  margin: clamp(1.8rem, 5vh, 2.6rem) auto 0;
}
.rank-chip {
  position: relative;
  font-family: var(--body); font-size: 0.96rem; color: var(--cream);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 0.9rem 0.85rem 2.4rem;
  cursor: pointer; text-align: left;
  transition: border-color .2s ease, background .2s ease;
}
.rank-chip:hover { border-color: rgba(232,199,126,0.5); }
.rank-chip[aria-pressed="true"] { border-color: var(--gold); background: rgba(232,199,126,0.10); }
.rank-badge {
  position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--label); font-size: 0.64rem; color: transparent;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.rank-chip[aria-pressed="true"] .rank-badge {
  color: #1B0710; background: var(--gold); border-color: var(--gold);
}
.quiz-rank-hint { margin-top: 0.9rem; font-size: 0.84rem; color: var(--muted); min-height: 1.2em; }
@media (max-width: 560px) { .rank-grid { grid-template-columns: 1fr; } }

/* ---- Q9 deal-breakers (multi-select) ----------------------------------- */
.multi-grid { display: grid; gap: 0.6rem; margin: clamp(1.8rem, 5vh, 2.6rem) auto 0; text-align: left; }
.multi-chip {
  display: flex; align-items: center; gap: 0.7rem;
  font-family: var(--body); font-size: 0.96rem; color: var(--cream);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 0.8rem 1rem; cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.multi-chip:hover { border-color: rgba(232,199,126,0.5); }
.multi-chip[aria-pressed="true"] { border-color: var(--gold); background: rgba(232,199,126,0.10); }
.multi-check {
  flex: none; width: 18px; height: 18px; border-radius: 4px;
  border: 1px solid var(--line); position: relative;
}
.multi-chip[aria-pressed="true"] .multi-check { border-color: var(--gold); background: var(--gold); }
.multi-chip[aria-pressed="true"] .multi-check::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 9px;
  border: solid #1B0710; border-width: 0 2px 2px 0; transform: rotate(40deg);
}

/* ---- Nav ---------------------------------------------------------------- */
.quiz-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-top: clamp(2.2rem, 6vh, 3rem);
}
.quiz-back-btn {
  font-family: var(--label); font-size: 0.76rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
  background: none; border: none; cursor: pointer; padding: 0.6rem 0;
}
.quiz-back-btn:hover { color: var(--gold); }
.quiz-back-btn:disabled { visibility: hidden; }
.quiz-next-btn {
  font-family: var(--label); text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 0.82rem; color: #1B0710;
  background: linear-gradient(180deg, #F6E7C0, var(--gold) 55%, var(--gold-deep));
  border: 1px solid var(--gold);
  border-radius: 8px; padding: 0.95rem 1.6rem;
  cursor: pointer; margin-left: auto;
  transition: transform .2s ease, box-shadow .25s ease, opacity .2s ease;
}
.quiz-next-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(232,199,126,0.22); }
.quiz-next-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- Results -------------------------------------------------------------- */
.result-kicker { text-align: center; }
.result-card {
  margin: clamp(1.6rem, 4vh, 2.2rem) auto 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(1.8rem, 5vw, 2.8rem) clamp(1.4rem, 5vw, 2.4rem);
  background: rgba(255,255,255,0.025);
  box-shadow: 0 26px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(232,199,126,0.06);
  text-align: center;
}
html[data-theme="light"] .result-card { background: rgba(255,255,255,0.6); }
.result-wordmark {
  font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700;
  font-size: 1.1rem; color: var(--gold); letter-spacing: 0.02em;
}
.result-type-label {
  display: block; margin-top: 1.1rem;
}
.result-type-name {
  font-size: clamp(1.9rem, 5.4vw, 2.7rem);
  margin: 0.4rem 0 0;
}
.result-desc {
  color: var(--muted); max-width: 48ch; margin: 1.1rem auto 0;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
}
.result-match {
  margin: 1.3rem auto 0; max-width: 48ch;
  font-family: var(--display); font-style: italic; color: var(--cream);
  font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.18rem);
}
.result-recognition {
  margin: 1.4rem auto 0; max-width: 48ch;
  padding-top: 1.2rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.94rem; font-style: italic;
}

.result-actions {
  display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap;
  margin: clamp(1.6rem, 4vh, 2.2rem) 0 0;
}
.result-share-btn {
  font-family: var(--label); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.72rem; color: var(--gold);
  border: 1px solid var(--gold); border-radius: 8px;
  padding: 0.75rem 1.2rem; background: none; cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.result-share-btn:hover { background: var(--gold); color: #1B0710; }
.result-share-msg { min-height: 1.2em; font-size: 0.82rem; color: var(--gold); margin-top: 0.6rem; text-align: center; }

/* ---- The door: waitlist form on the results screen --------------------- */
.result-door {
  margin: clamp(2.6rem, 6vh, 3.4rem) auto 0;
  max-width: 460px; text-align: center;
}
.result-door-title { font-size: clamp(1.3rem, 3vw, 1.7rem); }
.result-capacity {
  margin: 0.6rem auto 0; color: var(--gold); font-weight: 600; font-size: 0.92rem;
}
.result-capacity-bar {
  max-width: 260px; height: 3px; margin: 0.8rem auto 0; border-radius: 3px;
  background: var(--line); overflow: hidden;
}
.result-capacity-fill {
  height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold));
}
.result-form { margin: 1.5rem auto 0; max-width: 400px; display: grid; gap: 0.7rem; }
.result-form input[type="email"] {
  width: 100%; font-family: var(--body); font-size: 1rem; color: var(--cream);
  background: rgba(255,255,255,0.03); border: 1px solid var(--line);
  border-radius: 8px; padding: 0.95rem 1.05rem;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.result-form input[type="email"]:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,199,126,0.16);
}
html[data-theme="light"] .result-form input[type="email"] { background: #FFFFFF; }

/* ---- Post-submit success ---------------------------------------------- */
.quiz-success { display: none; }
.quiz-success.active { display: block; }

@media (max-width: 560px) {
  .quiz-progress-track { max-width: 120px; }
  .quiz-nav { flex-wrap: wrap; }
}
