/* components.css — reusable UI building blocks. */

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.skip-link:focus {
  left: 8px;
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space-3);
}
.container-narrow {
  max-width: var(--maxw-narrow);
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 60px;
  padding: 10px var(--space-3);
  max-width: var(--maxw);
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-decoration: none;
  color: var(--text);
  font-size: 1.05rem;
}
.brand__mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}
.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nav a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}
.nav a:hover,
.nav a:focus-visible {
  color: var(--text);
  background: var(--surface);
}
.theme-toggle {
  min-height: var(--tap);
  min-width: var(--tap);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  transition: transform 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}
.btn:hover {
  background: var(--surface-2);
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: linear-gradient(135deg, var(--fuslie), var(--valkyrae));
  color: #fff;
  border: none;
}
.btn-primary:hover {
  filter: brightness(1.06);
}
.btn-lg {
  padding: 15px 28px;
  font-size: 1.08rem;
}
.btn-block {
  width: 100%;
}
.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  text-decoration: underline;
  min-height: var(--tap);
  padding: 8px 4px;
}
.link-btn:hover {
  color: var(--text);
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Eyebrow + pills */
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent);
  padding: 5px 10px;
  border-radius: 999px;
}

/* Cards / surface */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}
.surface-grid {
  display: grid;
  gap: var(--space-3);
}
@media (min-width: 720px) {
  .surface-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .surface-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .surface-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Result archetype cards (home) */
.archetype {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent, var(--text-muted));
}
.archetype__icon {
  width: 46px;
  height: 46px;
  margin-bottom: 10px;
}
.archetype__name {
  font-size: 1.15rem;
  font-weight: 800;
}
.archetype__tag {
  color: var(--accent, var(--text-muted));
  font-weight: 700;
  font-size: 0.92rem;
}
.archetype__desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 8px;
}

/* Score bars (shared) */
.score-row { margin-bottom: 14px; }
.score-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  margin-bottom: 6px;
}
.score-label { font-weight: 600; }
.score-pct { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.bar {
  height: 12px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--text-muted);
  transition: width 0.4s ease;
}
.score-row.is-winner .bar-fill { background: var(--success); }
.score-row.is-winner .score-label { color: var(--success); }

/* Quiz options */
.quiz-fieldset { border: 0; }
.quiz-legend {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
  padding: 0;
}
.quiz-options { display: grid; gap: 12px; }
@media (min-width: 640px) {
  .quiz-options.cols-2 { grid-template-columns: 1fr 1fr; }
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  min-height: var(--tap);
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.08s ease;
}
.quiz-option:hover { background: var(--surface-alt); }
.quiz-option.is-selected {
  border-color: var(--valkyrae);
  background: color-mix(in srgb, var(--valkyrae) 14%, var(--surface));
}
.quiz-radio {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  accent-color: var(--valkyrae);
}
.quiz-option-text { flex: 1; }
.quiz-option-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex: 0 0 auto;
}
.quiz-option.is-selected .quiz-option-check {
  background: var(--valkyrae);
  border-color: var(--valkyrae);
}

/* Progress */
.progress {
  height: 10px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
  margin: 14px 0;
}
.progress-bar {
  height: 100%;
  width: 8%;
  background: linear-gradient(90deg, var(--fuslie), var(--valkyrae));
  border-radius: 999px;
  transition: width 0.3s ease;
}
.quiz-counter { font-weight: 700; color: var(--text-muted); }
.quiz-status {
  min-height: 1.2em;
  color: var(--warning);
  font-size: 0.9rem;
  margin-top: 10px;
}
.quiz-nav { display: flex; gap: 12px; margin-top: var(--space-2); }

/* FAQ */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 18px;
  margin-bottom: 12px;
}
.faq-q {
  cursor: pointer;
  font-weight: 700;
  padding: 14px 0;
  list-style: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: "+";
  float: right;
  color: var(--text-muted);
  font-weight: 700;
}
.faq-item[open] .faq-q::after { content: "\2212"; }
.faq-a { padding: 0 0 16px; color: var(--text-muted); }

/* Factor chips */
.factor-chip {
  display: inline-block;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  margin: 0 8px 8px 0;
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: var(--space-5);
  padding: var(--space-4) 0 var(--space-3);
  background: var(--surface);
}
.footer-cols {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .footer-cols { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
.footer-col h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.footer-col a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--text-muted);
  text-decoration: none;
}
.footer-col a:hover { color: var(--text); }
.legal-note {
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.7;
}
.legal-note p { margin-bottom: 8px; }

/* Comparison (challenge) */
.compare-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .compare-grid { grid-template-columns: 1fr 1fr; }
}
.compare-h { font-size: 1.05rem; margin-bottom: 10px; }
.compare-sub { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.compare-notes {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
  margin-top: var(--space-3);
}
@media (min-width: 640px) {
  .compare-notes { grid-template-columns: 1fr 1fr; }
}
.compare-notes ul { color: var(--text-muted); }
.compare-notes li { margin-bottom: 6px; }
.challenge-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--space-3); }
.challenge-note { color: var(--text-muted); font-size: 0.85rem; margin-top: 12px; }

/* Icon helpers */
.icon { display: inline-block; vertical-align: middle; }

/* Secondary match sub-label on the result title */
.secondary-match {
  font-size: 0.58em;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}
