/* =========================================================
   Testly — IQ & Self-Assessment Tests
   Modern light theme · Single shared stylesheet for the site.
   ========================================================= */

:root {
  /* Surfaces */
  --bg:           #ffffff;
  --bg-2:         #f8fafc;
  --surface:      #ffffff;
  --surface-2:    #fafbfc;
  --border:       #e5e7eb;
  --border-strong:#d1d5db;

  /* Text */
  --text:         #0f172a;
  --text-2:       #1f2937;
  --muted:        #64748b;

  /* Brand */
  --primary:      #0d9488;   /* teal-600 — main accent */
  --primary-hover:#0f766e;   /* teal-700 */
  --primary-2:    #14b8a6;   /* teal-500 — gradient stop */
  --primary-3:    #06b6d4;   /* cyan-500 — gradient stop */
  --accent:       #f59e0b;   /* amber for occasional highlight */

  /* Status */
  --good:         #10b981;
  --warn:         #f59e0b;
  --bad:          #ef4444;

  /* Shadow / radius */
  --shadow-sm:    0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow:       0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg:    0 12px 28px -8px rgba(15, 23, 42, 0.10), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
  --shadow-xl:    0 24px 48px -12px rgba(15, 23, 42, 0.14);
  --radius:       12px;
  --radius-lg:    18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background:
    radial-gradient(1100px 500px at 85% -8%, rgba(13, 148, 136, 0.06), transparent 60%),
    radial-gradient(800px 420px at -10% 0%, rgba(6, 182, 212, 0.05), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, var(--bg-2) 100%);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------------------- Layout ---------------------- */

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border);
}

/* ----- Language button & dropdown ----- */
.lang-btn-wrap {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1;
}
.lang-btn:hover {
  background: var(--bg-2);
  border-color: var(--border-strong);
}

.lang-chevron {
  color: var(--muted);
  flex-shrink: 0;
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 170px;
  z-index: 100;
  flex-direction: column;
}
.lang-dropdown.open {
  display: flex;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  transition: background 0.12s;
  width: 100%;
}
.lang-option:hover { background: var(--bg-2); }
.lang-option.active {
  background: #d1fae5;
  color: var(--primary);
  font-weight: 600;
}
.lang-option-flag { font-size: 16px; line-height: 1; }
.lang-option-name { font-size: 14px; }

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 20px;
  color: var(--text);
}
.logo:hover { text-decoration: none; }

.logo svg {
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(5, 150, 105, 0.30));
}

.nav {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav a {
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
}
.nav a:hover { color: var(--text); text-decoration: none; }

/* ---------------------- Hero ---------------------- */

.hero {
  padding: 88px 0 48px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.22);
  color: var(--primary-hover);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.05;
  margin: 18px 0 14px;
  letter-spacing: -0.025em;
  color: var(--text);
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--primary-3), var(--primary-2), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  max-width: 660px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.hero-cta {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------------------- Buttons ---------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(13, 148, 136, 0.28);
}
.btn.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 10px 22px rgba(13, 148, 136, 0.34);
}

.btn.ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn.ghost:hover {
  border-color: var(--border-strong);
  background: var(--bg-2);
}

.btn.large {
  padding: 14px 26px;
  font-size: 16px;
}

/* ---------------------- Sections ---------------------- */

.section {
  padding: 56px 0;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 26px;
  gap: 20px;
  flex-wrap: wrap;
}

.section-header h2 {
  font-size: 30px;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-header p {
  color: var(--muted);
  margin: 6px 0 0;
}

/* ---------------------- Cards Grid ---------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.card .badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--muted);
}

.card .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: rgba(13, 148, 136, 0.10);
}
.card[data-theme="iq"]   .icon { background: rgba(6, 182, 212, 0.12); }
.card[data-theme="eq"]   .icon { background: rgba(244, 114, 182, 0.14); }
.card[data-theme="self"] .icon { background: rgba(16, 185, 129, 0.12); }
.card[data-theme="fun"]  .icon { background: rgba(245, 158, 11, 0.16); }

.card h3 { margin: 0; font-size: 18px; letter-spacing: -0.01em; color: var(--text); }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; flex-grow: 1; }

.card .meta {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.card .meta span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------------------- Quiz Page ---------------------- */

.quiz-shell {
  max-width: 760px;
  margin: 40px auto;
  padding: 0 24px;
}

.quiz-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.quiz-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.quiz-header .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 22px;
  background: rgba(13, 148, 136, 0.10);
}
.quiz-header h1 { margin: 0; font-size: 22px; letter-spacing: -0.01em; color: var(--text); }

.quiz-sub {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 20px;
}

.progress {
  height: 8px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--border);
}
.progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-3), var(--primary-2), var(--primary));
  transition: width 0.3s ease;
  border-radius: 999px;
}

.q-num {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-weight: 700;
}

.q-prompt {
  font-size: 22px;
  margin: 8px 0 22px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.06s ease;
  font-size: 15px;
  color: var(--text);
  text-align: left;
  width: 100%;
}
.option:hover {
  background: rgba(13, 148, 136, 0.05);
  border-color: var(--primary);
}
.option.selected {
  background: rgba(13, 148, 136, 0.08);
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.option .bullet {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: grid;
  place-items: center;
  background: var(--surface);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.option.selected .bullet {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.18);
}
.option .bullet::after {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: white;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.option.selected .bullet::after { opacity: 1; }

.option-letter {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  flex: 0 0 auto;
}
.option.selected .option-letter {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.q-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 26px;
  gap: 12px;
}

/* ---------------------- Results ---------------------- */

.result-card { text-align: center; }

.score-ring {
  width: 220px;
  height: 220px;
  margin: 10px auto 18px;
  position: relative;
  display: grid;
  place-items: center;
}
.score-ring svg { transform: rotate(-90deg); }
.score-ring .score-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.score-ring .score-value {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--primary-3), var(--primary-2), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.score-ring .score-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-top: 4px;
}

.result-tier {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
  background: rgba(13, 148, 136, 0.10);
  color: var(--primary-hover);
  border: 1px solid rgba(13, 148, 136, 0.28);
}

.result-headline {
  font-size: 28px;
  letter-spacing: -0.015em;
  margin: 10px 0;
  color: var(--text);
}

.result-body {
  color: var(--muted);
  line-height: 1.65;
  max-width: 580px;
  margin: 0 auto;
}

.result-tips {
  text-align: left;
  margin: 28px auto 0;
  max-width: 580px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
}
.result-tips h4 {
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}
.result-tips ul { margin: 0; padding-left: 20px; }
.result-tips li { margin: 6px 0; color: var(--text); }

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 26px;
}

/* ---------------------- FAQ ---------------------- */

.faq-section { background: var(--bg-2); border-top: 1px solid var(--border); }

.faq-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 64px;
  align-items: start;
}
.faq-heading h2 {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  margin: 0;
  position: sticky;
  top: 100px;
}
.faq-list { display: flex; flex-direction: column; }

.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:first-child { border-top: 1px solid var(--border); }

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 22px 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  transition: color .15s;
}
.faq-q:hover { color: var(--primary); }
.faq-q[aria-expanded="true"] { color: var(--primary); }
.faq-q[aria-expanded="true"] .faq-chevron { transform: rotate(180deg); }

.faq-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform .25s ease, color .15s;
}
.faq-q[aria-expanded="true"] .faq-chevron { color: var(--primary); }

.faq-a {
  max-height: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  padding: 0 4px;
  transition: max-height .35s ease, padding .2s;
}
.faq-q[aria-expanded="true"] + .faq-a { padding-bottom: 22px; }

@media (max-width: 700px) {
  .faq-layout { grid-template-columns: 1fr; gap: 28px; }
  .faq-heading h2 { position: static; font-size: 28px; }
}

/* ---------------------- Site Footer ---------------------- */

.site-footer {
  background: #071427;
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  margin-top: 0;
  padding: 60px 0 0;
}
.site-footer a { color: rgba(255,255,255,0.55); text-decoration: none; }
.site-footer a:hover { color: #ffffff; text-decoration: none; }

.sf-top {
  display: grid;
  grid-template-columns: 1fr 220px 180px 180px;
  gap: 48px;
  padding-bottom: 48px;
  align-items: start;
}

/* Brand column */
.sf-logo { color: #fff !important; font-size: 20px; font-weight: 700; }
.sf-logo:hover { opacity: 0.85; }
.sf-socials { display: flex; gap: 14px; margin-top: 20px; }
.sf-social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  transition: background .18s, color .18s;
}
.sf-social:hover { background: rgba(255,255,255,0.16); color: #fff; }

/* Columns */
.sf-col { display: flex; flex-direction: column; gap: 4px; }
.sf-col-head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin: 0 0 14px;
}
.sf-link {
  padding: 5px 0;
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  transition: color .15s;
}
.sf-link:hover { color: #fff; }

/* Support button */
.sf-support-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .18s, background .18s, color .18s;
  width: 100%;
  text-align: left;
  margin-top: 4px;
}
.sf-support-btn:hover {
  border-color: rgba(13,148,136,0.6);
  background: rgba(13,148,136,0.08);
  color: #fff;
}

/* Divider */
.sf-divider { height: 1px; background: rgba(255,255,255,0.08); }

/* Bottom bar */
.sf-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 28px;
  flex-wrap: wrap;
}
.sf-copy {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  max-width: 560px;
  color: rgba(255,255,255,0.3);
}
.sf-payments { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sf-payments svg { border-radius: 5px; opacity: 0.75; }
.pm-card { width: 52px; height: 34px; }

@media (max-width: 860px) {
  .sf-top { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 540px) {
  .sf-top { grid-template-columns: 1fr; gap: 28px; }
  .sf-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------------------- Chat widget ---------------------- */

.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* FAB button */
.chat-fab {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(13,148,136,0.38);
  transition: transform .2s, box-shadow .2s;
}
.chat-fab:hover { transform: scale(1.08); box-shadow: 0 10px 28px rgba(13,148,136,0.46); }

/* Panel */
.chat-panel {
  width: 360px;
  max-height: 520px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(15,23,42,0.18), 0 4px 12px rgba(15,23,42,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(135deg, #0d9488, #06b6d4);
  color: #fff;
}
.chat-panel-info { display: flex; align-items: center; gap: 10px; }
.chat-avatar-wrap {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
}
.chat-agent-name { font-weight: 700; font-size: 15px; }
.chat-agent-status { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 5px; }
.chat-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}
.chat-close {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.8); padding: 4px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: background .15s;
}
.chat-close:hover { background: rgba(255,255,255,0.15); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg { max-width: 82%; }
.chat-msg p {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
}
.chat-msg.bot  { align-self: flex-start; }
.chat-msg.bot p { background: var(--bg-2); color: var(--text); border-bottom-left-radius: 4px; }
.chat-msg.user { align-self: flex-end; }
.chat-msg.user p { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }

/* Typing indicator */
.chat-typing {
  display: flex; gap: 4px; align-items: center;
  padding: 10px 14px;
  background: var(--bg-2);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.chat-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: chatBounce .9s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes chatBounce {
  0%,60%,100% { transform: translateY(0); }
  30%          { transform: translateY(-5px); }
}

/* Suggestion chips */
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.chat-chip {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.chat-chip:hover { border-color: var(--primary); color: var(--primary); background: #f0fdfa; }

/* Input row */
.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 9px 16px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.chat-input:focus { border-color: var(--primary); }
.chat-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s, transform .1s;
}
.chat-send:hover { background: var(--primary-hover); transform: scale(1.05); }

@media (max-width: 420px) {
  .chat-widget { bottom: 16px; right: 16px; }
  .chat-panel { width: calc(100vw - 32px); }
}

/* ---------------------- Misc ---------------------- */

.kbd {
  display: inline-block;
  padding: 1px 6px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------------- Responsive ---------------------- */

@media (max-width: 640px) {
  .hero { padding: 56px 0 24px; }
  .quiz-card { padding: 22px; }
  .q-prompt { font-size: 19px; }
  .nav a { display: none; } /* hide nav links on mobile, keep language button */
  .footer .container { justify-content: center; text-align: center; }
}

/* =========================================================
   Results extras — IQ breakdown + certificate
   ========================================================= */

.result-extra,
.cert-card { margin-top: 20px; }

.section-mini-head {
  font-size: 18px; font-weight: 700;
  color: var(--text); margin: 0 0 6px;
}

/* ----- IQ Stats row ----- */
.iq-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.iq-stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}
.iq-stat-card.primary {
  background: linear-gradient(135deg, var(--primary-3), var(--primary-2));
  border-color: transparent;
}
.iq-stat-icon { font-size: 24px; margin-bottom: 8px; }
.iq-stat-value {
  font-size: 36px; font-weight: 800; line-height: 1;
  margin-bottom: 4px; color: var(--primary);
}
.iq-stat-card.primary .iq-stat-value { color: white; }
.iq-stat-label {
  font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px;
}
.iq-stat-card.primary .iq-stat-label { color: rgba(255,255,255,0.9); }
.iq-stat-sub { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.4; }
.iq-stat-card.primary .iq-stat-sub { color: rgba(255,255,255,0.8); }

/* ----- Bell curve ----- */
.bell-wrap { margin-top: 8px; padding-top: 16px; }

/* ----- Cognitive Blueprint ----- */
.blueprint-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.blueprint-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
}
.blueprint-icon  { font-size: 22px; margin-bottom: 6px; }
.blueprint-name  { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.blueprint-score {
  font-size: 28px; font-weight: 800; color: var(--primary);
  line-height: 1; margin-bottom: 8px;
}
.blueprint-score span { font-size: 14px; font-weight: 400; color: var(--muted); }
.blueprint-bar   { height: 6px; background: var(--border); border-radius: 3px; margin-bottom: 10px; }
.blueprint-fill  {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--primary-3), var(--primary));
  transition: width 0.8s ease;
}
.blueprint-feedback { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }

/* ----- Historical Figures ----- */
.figures-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.figure-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
}
.figure-initial {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-3), var(--primary));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: white;
  margin: 0 auto 10px;
}
.figure-photo {
  width: 72px; height: 72px; border-radius: 50%;
  overflow: hidden; margin: 0 auto 12px;
  border: 2px solid var(--border);
  background: linear-gradient(135deg, var(--primary-3), var(--primary));
}
.figure-photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  display: block;
}
.figure-initial-fallback {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-3), var(--primary));
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; color: white;
  margin: 0 auto 12px;
}
.figure-name  { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.figure-years { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.figure-trait {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  background: #e0fdf4; color: var(--primary);
  font-size: 12px; font-weight: 600; margin-bottom: 10px;
}
.figure-desc { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; text-align: left; }

/* ----- Question Review ----- */
.q-review-list { display: flex; flex-direction: column; gap: 10px; }
.review-header:hover .review-toggle-btn { color: var(--primary); }
.review-toggle-btn {
  flex-shrink: 0; font-size: 13px; font-weight: 600;
  color: var(--muted); padding: 6px 14px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--bg-2);
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.review-header:hover .review-toggle-btn {
  border-color: var(--primary); color: var(--primary);
}
.q-review-row {
  display: flex; gap: 14px;
  padding: 14px; border-radius: var(--radius);
  background: var(--bg-2); border: 1px solid var(--border);
}
.q-review-row.correct   { border-left: 3px solid var(--good); }
.q-review-row.incorrect { border-left: 3px solid var(--bad); }
.q-review-num  { flex-shrink: 0; width: 28px; font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 2px; }
.q-review-q    { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.q-review-answers { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-badge       { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-correct { background: #dcfce7; color: #16a34a; }
.badge-wrong   { background: #fee2e2; color: #dc2626; }
.q-review-right { font-size: 13px; color: var(--muted); }

/* ----- Paywall ----- */
.paywall-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-xl);
  padding: 40px 36px 32px; max-width: 520px; margin: 0 auto;
  text-align: center;
}
.paywall-header { margin-bottom: 28px; }
.paywall-badge {
  display: inline-block; padding: 6px 16px; border-radius: 20px;
  background: #fff7ed; color: #c2410c; font-size: 13px; font-weight: 700;
  border: 1px solid #fed7aa; margin-bottom: 16px;
}
.paywall-title {
  font-size: 26px; font-weight: 800; color: var(--text);
  line-height: 1.25; margin: 0 0 10px;
}
.paywall-sub { font-size: 15px; color: var(--muted); margin: 0; }

/* Blurred preview ring */
.paywall-preview { margin-bottom: 20px; }
.paywall-ring-wrap {
  position: relative; display: inline-block; margin-bottom: 12px;
}
.paywall-ring-text {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.paywall-score-blur {
  font-size: 36px; font-weight: 800; color: var(--text);
  filter: blur(8px); user-select: none; letter-spacing: 2px;
}
.paywall-score-label { font-size: 13px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.paywall-range-pill {
  display: inline-block; padding: 5px 16px; border-radius: 20px;
  background: linear-gradient(135deg, #e0f2fe, #d1fae5);
  color: var(--primary); font-size: 13px; font-weight: 700;
}

/* Timer */
.paywall-timer-wrap {
  background: #fef3c7; border: 1px solid #fde68a; border-radius: 10px;
  padding: 12px 20px; margin-bottom: 24px;
}
.paywall-timer-label { font-size: 13px; font-weight: 600; color: #92400e; margin: 0 0 4px; }
.paywall-timer {
  font-size: 32px; font-weight: 800; color: #b45309;
  font-variant-numeric: tabular-nums; letter-spacing: 2px;
}

/* Features */
.paywall-features {
  background: var(--bg-2); border-radius: 12px; border: 1px solid var(--border);
  padding: 20px 24px; margin-bottom: 24px; text-align: left;
}
.paywall-features-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.paywall-feature-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.paywall-feature-list li { font-size: 14px; color: var(--text-2); display: flex; align-items: center; gap: 10px; }
.pf-check {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  background: #d1fae5; color: #059669;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
}

/* Promo banner */
.paywall-promo {
  display: flex; align-items: center; gap: 12px;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
  padding: 12px 16px; margin-bottom: 14px; text-align: left;
}
.paywall-promo-icon { font-size: 22px; flex-shrink: 0; }
.paywall-promo-text { flex: 1; }
.paywall-promo-text strong { display: block; font-size: 14px; color: #1e3a5f; }
.paywall-promo-text span { font-size: 12px; color: #3b82f6; }
.paywall-promo-badge {
  background: #3b82f6; color: white; font-size: 13px; font-weight: 800;
  padding: 4px 10px; border-radius: 20px; flex-shrink: 0;
}

/* Due today row */
.paywall-due {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 4px; margin-bottom: 16px; border-top: 1px solid var(--border);
}
.paywall-due-label { font-size: 15px; font-weight: 700; color: var(--text); }
.paywall-due-price { display: flex; align-items: baseline; gap: 8px; }
.paywall-original { font-size: 15px; color: var(--muted); text-decoration: line-through; }
.paywall-price { font-size: 22px; font-weight: 800; color: var(--text); }

/* Payment buttons */
.paywall-pay-btns { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.pay-btn {
  width: 100%; padding: 14px 20px; border-radius: 10px; border: none;
  font-size: 16px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: opacity 0.15s, transform 0.1s;
}
.pay-btn:hover { opacity: 0.9; }
.pay-btn:active { transform: scale(0.98); }
.pay-paypal { background: #ffc439; color: #003087; }
.pay-apple  { background: #000000; color: #ffffff; }
.pay-gpay   { background: #000000; color: #ffffff; }
.pay-card   { background: var(--primary); color: #ffffff; }
.paypal-word { line-height: 1; }

.paywall-guarantee { font-size: 12px; color: var(--muted); margin: 0 0 20px; text-align: center; }

/* Social proof */
.paywall-social {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  border-top: 1px solid var(--border); padding-top: 18px;
}
.paywall-social-avatars { display: flex; gap: -4px; font-size: 22px; }
.paywall-social p { font-size: 13px; color: var(--muted); margin: 0; }
.paywall-social strong { color: var(--text); }

/* ----- Card entry form ----- */
.card-form-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  margin-bottom: 24px;
  transition: background 0.15s;
}
.card-form-back:hover { background: var(--bg-2); }

.card-form-body { display: flex; flex-direction: column; gap: 18px; }

.card-form-field { display: flex; flex-direction: column; gap: 7px; }

.card-form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.card-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.card-form-input-wrap { position: relative; }

.card-form-input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
}
.card-form-input::placeholder { color: #b0bac7; }
.card-form-input:focus { border-color: var(--primary); }

.card-form-brand-icons {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 6px;
  align-items: center;
  pointer-events: none;
}
.card-form-brand-icons svg { border-radius: 4px; }

/* CVC icon with badge */
.card-form-cvc-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}
.cvc-badge {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: -4px;
  top: -6px;
}

/* #cardNumber, #cardCvc need right padding to not overlap icons */
#cardNumber { padding-right: 100px; }
#cardCvc    { padding-right: 56px; }

.card-pay-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  border-radius: 12px;
  margin-top: 4px;
}

/* ----- Account / sign-in form error ---- */
.acct-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  text-align: center;
}

/* ----- Auth modal overlay ----- */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}
.auth-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 36px 32px 32px;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-xl);
}
.auth-modal-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--text);
}
.auth-modal-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}
.auth-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: background 0.15s;
}
.auth-modal-close:hover { background: var(--border); }

/* ----- Auth nav button ----- */
.auth-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  position: relative;
}
.auth-nav-btn:hover { background: var(--bg-2); border-color: var(--border-strong); }
.auth-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-3), var(--primary));
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-nav-label { font-size: 13px; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.auth-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 10px;
  min-width: 200px;
  z-index: 200;
}
.auth-user-email { font-size: 12px; color: var(--muted); padding: 2px 6px 6px; word-break: break-all; }
.auth-menu-item {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
}
.auth-menu-item:hover { background: var(--bg-2); }

/* ----- Share box ----- */
.share-card { }
.share-link-row { margin-bottom: 18px; }
.share-link-box {
  display: flex;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  gap: 10px;
}
.share-link-text {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-copy-btn {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.share-copy-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.share-socials {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 4px 0 0;
}
.share-social-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  text-decoration: none;
  transition: transform 0.15s, opacity 0.15s;
}
.share-social-btn:hover { transform: scale(1.1); opacity: 0.88; text-decoration: none; }
.share-twitter  { background: #000; }
.share-linkedin { background: #0077b5; }
.share-facebook { background: #1877f2; }

/* ----- Train Your Brain card ----- */
.train-card { }
.train-card-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.train-card-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 200px;
}
.train-card-icon { font-size: 36px; line-height: 1; flex-shrink: 0; }
.train-card-btn { white-space: nowrap; }
.train-games-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.train-game-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

/* ----- Certificate card ----- */
.cert-heading {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.cert-input-row {
  margin-bottom: 22px;
}

.cert-name-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 18px;
  font-family: inherit;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: var(--text);
  background: var(--surface);
  box-sizing: border-box;
}
.cert-name-input:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.cert-name-input::placeholder {
  color: var(--muted);
}

/* Certificate SVG preview container */
.cert-container {
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  line-height: 0; /* removes inline gap under SVG */
}
.cert-container svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Action buttons row */
.cert-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .cert-actions {
    flex-direction: column;
  }
  .cert-actions .btn {
    width: 100%;
    text-align: center;
  }
}
