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

:root {
  --purple: #534AB7;
  --purple-light: #EEEDFE;
  --purple-dark: #3C3489;
  --teal: #0F6E56;
  --teal-light: #E1F5EE;
  --coral: #993C1D;
  --coral-light: #FAECE7;
  --blue: #185FA5;
  --blue-light: #E6F1FB;
  --green: #3B6D11;
  --green-light: #EAF3DE;
  --amber: #854F0B;
  --amber-light: #FAEEDA;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: #fafaf9;
  min-height: 100vh;
}

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

/* === Landing === */
.landing .container { text-align: center; }

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 4px 14px;
  border-radius: 20px;
  background: var(--purple-light);
  color: var(--purple-dark);
  margin-bottom: 20px;
}

h1 {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text);
}

.subtitle {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.btn-primary {
  display: inline-block;
  background: var(--purple);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--purple-dark); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.social-proof {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
}

.type-previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 40px;
}

.type-card {
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: left;
}
.type-card.purple  { background: var(--purple-light); }
.type-card.teal    { background: var(--teal-light); }
.type-card.coral   { background: var(--coral-light); }
.type-card.blue    { background: var(--blue-light); }
.type-card.green   { background: var(--green-light); }
.type-card.amber   { background: var(--amber-light); }

.type-name { font-size: 13px; font-weight: 500; }
.type-card.purple .type-name { color: var(--purple-dark); }
.type-card.teal .type-name   { color: var(--teal); }
.type-card.coral .type-name  { color: var(--coral); }
.type-card.blue .type-name   { color: var(--blue); }
.type-card.green .type-name  { color: var(--green); }
.type-card.amber .type-name  { color: var(--amber); }

.type-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* === Quiz === */
.quiz-page .container { padding-top: 32px; }

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.progress-label { font-size: 13px; color: var(--text-muted); }
.progress-pct   { font-size: 13px; color: var(--purple); font-weight: 500; }

.progress-bar {
  height: 4px;
  background: #e5e5e5;
  border-radius: 2px;
  margin-bottom: 36px;
}
.progress-fill {
  height: 4px;
  background: var(--purple);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.question-text {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 24px;
}

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

.option {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  background: white;
}
.option:hover { border-color: var(--purple); }
.option.selected {
  border-color: var(--purple);
  background: var(--purple-light);
  color: var(--purple-dark);
  font-weight: 500;
}

/* === Result === */
.result-page .container { padding-top: 48px; }

.result-header { text-align: center; margin-bottom: 28px; }

.result-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px;
}

.result-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--purple);
  font-weight: 500;
  margin-bottom: 6px;
}

h2 { font-size: 28px; font-weight: 600; margin-bottom: 6px; }

.result-traits { font-size: 14px; color: var(--text-muted); }

.result-intro {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.free-section {
  background: white;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.free-section h3 { font-size: 15px; font-weight: 500; margin-bottom: 10px; }
.free-section ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.free-section li { font-size: 14px; color: var(--text-muted); padding-left: 16px; position: relative; }
.free-section li::before { content: '✓'; position: absolute; left: 0; color: var(--purple); font-weight: 600; }

/* Locked section */
.locked-section { position: relative; margin-bottom: 28px; }

.blur-content {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  background: white;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
}

.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(2px);
}

.lock-icon { font-size: 28px; margin-bottom: 8px; }
.lock-title { font-size: 17px; font-weight: 600; margin-bottom: 12px; }

.lock-features {
  list-style: none;
  text-align: left;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lock-features li { font-size: 13px; color: var(--text-muted); padding-left: 18px; position: relative; }
.lock-features li::before { content: '✓'; position: absolute; left: 0; color: var(--purple); font-weight: 600; }

/* Share */
.share-section { text-align: center; }
.share-label { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.share-row { display: flex; gap: 8px; justify-content: center; }

.share-btn {
  flex: 1;
  max-width: 140px;
  background: white;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
}
.share-btn:hover { border-color: var(--purple); }

/* === Top Nav === */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 0.5px solid var(--border);
  background: #fafaf9;
}
.logo {
  font-size: 15px;
  font-weight: 600;
  color: var(--purple);
  text-decoration: none;
}

/* === Lang Switcher === */
.lang-switcher { position: relative; }

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: white;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}
.lang-btn:hover { border-color: var(--purple); }
.lang-chevron { font-size: 10px; color: var(--text-muted); }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: white;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
}
.lang-dropdown.hidden { display: none; }

.lang-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 14px;
  font-size: 13px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
}
.lang-option:hover { background: var(--purple-light); }
.lang-option.active { color: var(--purple); font-weight: 500; }

/* === RTL Support === */
[dir="rtl"] .landing .container { text-align: right; }
[dir="rtl"] .progress-header { flex-direction: row-reverse; }
[dir="rtl"] .option { text-align: right; }
[dir="rtl"] .free-section li,
[dir="rtl"] .lock-features li { padding-left: 0; padding-right: 16px; }
[dir="rtl"] .free-section li::before,
[dir="rtl"] .lock-features li::before { left: auto; right: 0; }
[dir="rtl"] .share-row { flex-direction: row-reverse; }
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }

/* === Analysing Overlay === */
.analysing-overlay {
  position: fixed;
  inset: 0;
  background: #fafaf9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  gap: 16px;
}
.analysing-overlay.hidden { display: none; }

.analysing-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--purple-light);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.analysing-text {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
}
.analysing-subtext {
  font-size: 14px;
  color: var(--text-muted);
}

/* === Free Timer Banner === */
.free-timer-banner {
  background: var(--purple);
  color: white;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
}
.free-timer-banner.hidden { display: none; }

/* === Live Counter === */
.live-counter {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* === Mobile === */
@media (max-width: 480px) {
  h1 { font-size: 26px; }
  .type-previews { grid-template-columns: repeat(2, 1fr); }
  .share-row { flex-direction: column; align-items: stretch; }
  .share-btn { max-width: none; }
}
