/* ============================================================
   ToyFinder – Nytelse.no brand stylesheet
   Colors: #2B2433 (bg), #AB8CBF (lavender), #653577 (purple),
           #282828 (black), #FFFFFF (white)
   Fonts:  Playfair Display (headings), Inter (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #2B2433;
  --bg-card:   #342c3e;
  --lavender:  #AB8CBF;
  --purple:    #653577;
  --purple-dk: #4e2860;
  --white:     #FFFFFF;
  --white-60:  rgba(255,255,255,0.6);
  --white-20:  rgba(255,255,255,0.12);
  --black:     #282828;
  --radius:    12px;
  --radius-sm: 8px;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

img { display: block; max-width: 100%; height: auto; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Typography ── */
h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.2;
  font-weight: 600;
}

/* ── Layout ── */
.tf-wrap {
  max-width: 540px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header / logo ── */
.tf-header {
  padding: 28px 0 0;
  text-align: center;
}

.tf-logo {
  display: inline-block;
  line-height: 0;
}

.tf-logo-img {
  height: 48px;
  width: auto;
  max-width: 240px;
}

/* ── Landing page ── */
.tf-landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 0 64px;
}

.tf-landing h1 {
  font-size: clamp(32px, 6vw, 48px);
  margin-bottom: 16px;
  color: var(--white);
}

.tf-landing h1 em {
  font-style: italic;
  color: var(--lavender);
}

.tf-landing .tf-sub {
  font-size: 16px;
  color: var(--white-60);
  max-width: 340px;
  margin: 0 auto 40px;
  font-weight: 300;
  line-height: 1.7;
}

/* Trust badges */
.tf-trust {
  display: flex;
  gap: 28px;
  justify-content: center;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.tf-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--white-60);
  font-weight: 500;
}

.tf-trust-item svg {
  width: 28px;
  height: 28px;
  stroke: var(--lavender);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* CTA button */
.tf-btn {
  display: inline-block;
  background: var(--purple);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 16px 48px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.tf-btn:hover:not(:disabled)  { background: var(--purple-dk); transform: translateY(-1px); }
.tf-btn:active:not(:disabled) { transform: translateY(0); }
.tf-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.tf-btn-ghost {
  background: transparent;
  border: 1.5px solid var(--white-20);
  color: var(--white-60);
  font-size: 13px;
  padding: 10px 24px;
}

.tf-btn-ghost:hover { border-color: var(--white-60); color: var(--white); background: transparent; }

/* ── Progress bar ── */
.tf-progress {
  width: 100%;
  margin: 24px 0 36px;
}

.tf-progress-label {
  font-size: 12px;
  color: var(--white-60);
  margin-bottom: 8px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tf-progress-bar {
  height: 3px;
  background: var(--white-20);
  border-radius: 2px;
  overflow: hidden;
}

.tf-progress-fill {
  height: 100%;
  background: var(--lavender);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ── Question page ── */
.tf-question-wrap {
  padding: 20px 0 60px;
}

.tf-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--white-60);
  text-decoration: none;
  margin-bottom: 8px;
  transition: color 0.15s;
}

.tf-back:hover { color: var(--white); }

.tf-back svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.tf-question-wrap h2 {
  font-size: clamp(22px, 4vw, 30px);
  margin-bottom: 8px;
}

.tf-question-hint {
  font-size: 13px;
  color: var(--white-60);
  margin-bottom: 32px;
}

/* Answer grid */
.tf-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 32px;
}

.tf-answers.single-col {
  grid-template-columns: 1fr;
}

.tf-answer {
  background: var(--bg-card);
  border: 1.5px solid var(--white-20);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 15px;
  color: var(--white);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

.tf-answer:hover {
  border-color: var(--lavender);
  background: rgba(171,140,191,0.08);
}

.tf-answer.selected {
  border-color: var(--lavender);
  background: rgba(171,140,191,0.15);
  color: var(--white);
}

.tf-answer.selected .tf-answer-dot {
  background: var(--lavender);
  border-color: var(--lavender);
}

.tf-answer-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--white-20);
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

/* Next button bar */
.tf-nav {
  display: flex;
  justify-content: flex-end;
}

/* ── Loading screen ── */
.tf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  gap: 0;
}

.tf-loading h2 {
  font-size: 26px;
  margin-bottom: 12px;
}

.tf-loading-steps {
  list-style: none;
  margin: 28px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tf-loading-step {
  font-size: 14px;
  color: var(--white-60);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tf-loading-step .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--white-20);
  flex-shrink: 0;
}

.tf-loading-step.active { color: var(--white); }
.tf-loading-step.active .dot { background: var(--lavender); }
.tf-loading-step.done .dot { background: var(--lavender); opacity: 0.5; }

.tf-spinner {
  width: 36px;
  height: 36px;
  border: 2.5px solid var(--white-20);
  border-top-color: var(--lavender);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 32px auto 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Results page ── */
.tf-results { padding: 20px 0 60px; }

.tf-results-intro {
  text-align: center;
  margin-bottom: 40px;
}

.tf-results-intro .tf-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lavender);
  margin-bottom: 10px;
}

.tf-results-intro h2 {
  font-size: clamp(24px, 4vw, 32px);
  margin-bottom: 8px;
}

.tf-results-intro p {
  font-size: 14px;
  color: var(--white-60);
  max-width: 360px;
  margin: 0 auto;
}

/* Best match card */
.tf-best-match {
  background: var(--bg-card);
  border: 1.5px solid var(--lavender);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 32px;
  color: var(--white);
  text-decoration: none;
}

/* .tf-best-match-img replaced by .tf-img-wrap--lg */

.tf-best-match-body { flex: 1; }

.tf-best-match-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lavender);
  margin-bottom: 6px;
}

.tf-best-match-name {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  margin-bottom: 6px;
}

.tf-best-match-desc {
  font-size: 13px;
  color: var(--white-60);
  margin-bottom: 14px;
  line-height: 1.5;
}

.tf-best-match-price {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* Product grid */
.tf-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white-60);
  margin-bottom: 16px;
}

.tf-product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 40px;
}

.tf-product-card {
  background: var(--bg-card);
  border: 1.5px solid var(--white-20);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: var(--white);
  transition: border-color 0.15s, transform 0.15s;
  display: block;
}

.tf-product-card:hover {
  border-color: var(--lavender);
  transform: translateY(-2px);
}

.tf-product-card img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  margin-bottom: 12px;
}

.tf-product-card-name {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.3;
}

.tf-product-card-price {
  font-size: 13px;
  color: var(--lavender);
  font-weight: 600;
}

/* Restart link */
.tf-restart {
  text-align: center;
  margin-top: 16px;
}

.tf-restart a {
  font-size: 13px;
  color: var(--white-60);
  text-decoration: none;
}

.tf-restart a:hover { color: var(--white); }

/* ── Image wrapper (white bg for product images) ── */
.tf-img-wrap {
  background: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 12px;
}

.tf-img-wrap img {
  width: 100%;
  height: 120px;
  max-width: none;
  object-fit: contain;
}

.tf-img-wrap--lg {
  width: 110px;
  height: 134px;
  flex-shrink: 0;
  margin-bottom: 0;
}

.tf-img-wrap--lg img {
  width: 100%;
  height: 100%;
  max-width: none;
}

/* Hide bare img direct children — images must be wrapped in .tf-img-wrap */
.tf-product-card > img { display: none; }

/* ── Utility ── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
