/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  background: #0a0a0a;
  color: #ffffff;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* === Screens === */
.screen {
  display: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  min-height: 100vh;
  min-height: 100dvh;
}
.screen.active { display: flex; opacity: 1; }
.screen.fade-in { opacity: 1; }
.screen.fade-out { opacity: 0; }

/* === Welcome === */
.welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  margin: auto;
  max-width: 480px;
  width: 100%;
  min-width: 0;
}
.logo-placeholder {
  display: none;
}
.logo-img {
  width: 220px;
  height: auto;
  object-fit: contain;
  border-radius: 0;
  background: none;
  margin: 24px 0 20px;
  mix-blend-mode: lighten;
  max-width: 60vw;
}
.welcome-container h1 {
  font-family: 'Bebas Neue', 'Inter', sans-serif;
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
  line-height: 1.1;
}
.welcome-desc {
  color: #e0e0e0;
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  max-width: 340px;
  letter-spacing: 0.01em;
  text-align: center;
}

/* === Buttons === */
.btn-primary {
  background: #2A2A2A;
  color: #ffffff;
  border: 1px solid #3A3A3A;
  border-radius: 12px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s, transform 0.1s;
  width: 100%;
  max-width: 360px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-primary:hover { background: #3A3A3A; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}
.btn-secondary {
  background: transparent;
  color: #a1a1aa;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-secondary:hover { border-color: #555; color: #fff; }

/* === Progress Bar === */
.progress-bar-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: #2A2A2A;
  z-index: 100;
}
.progress-bar {
  height: 100%;
  background: #ffffff;
  width: 0%;
  transition: width 0.4s ease;
  border-radius: 0 3px 3px 0;
}

/* === Question === */
.question-container {
  display: flex;
  flex-direction: column;
  padding: 3.5rem 1.5rem 2rem;
  margin: 0 auto;
  max-width: 520px;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}
.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #AAAAAA;
}
.question-counter {
  font-size: 0.8rem;
  color: #555;
}
.question-text {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 1.5rem;
}
.question-body {
  flex: 1;
}

/* === Choice Options === */
.option-card {
  background: #1A1A1A;
  border: 2px solid #333333;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.45;
  min-height: 52px;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}
.option-card:hover { border-color: #555; background: #1f1f1f; }
.option-card.selected {
  border-color: #ffffff;
  background: #222222;
}
.option-card .option-indicator {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #444;
  margin-right: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.option-card.selected .option-indicator {
  border-color: #ffffff;
  background: #ffffff;
}
.option-card.selected .option-indicator::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #000;
}
.option-label { flex: 1; }

/* === Slider === */
.slider-container {
  padding: 1rem 0;
}
.slider-value-display {
  text-align: center;
  font-size: 3rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.5rem;
}
.slider-track {
  width: 100%;
  position: relative;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #2A2A2A;
  outline: none;
  cursor: pointer;
  touch-action: pan-y;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #0a0a0a;
  box-shadow: none;
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #0a0a0a;
  box-shadow: none;
  cursor: pointer;
}
.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #666;
}

/* === Text / Multi-text === */
.text-field {
  margin-bottom: 1rem;
}
.text-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #a1a1aa;
  margin-bottom: 0.5rem;
}
.text-field textarea {
  width: 100%;
  min-height: 80px;
  background: #1A1A1A;
  border: 2px solid #333333;
  border-radius: 12px;
  padding: 12px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 1rem; /* 16px min prevents iOS zoom on focus */
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.text-field textarea::placeholder { color: #555; }
.text-field textarea:focus { outline: none; border-color: #ffffff; }

/* === Nav Buttons === */
.nav-buttons {
  display: flex;
  gap: 12px;
  margin-top: 1.5rem;
  padding-bottom: env(safe-area-inset-bottom, 2rem);
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 2rem);
}
.nav-buttons .btn-primary { flex: 1; }
.nav-buttons .btn-secondary { flex-shrink: 0; }

/* === Submitting === */
.submitting-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: auto;
  padding: 2rem;
}
.submitting-container h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
.submitting-container p { color: #a1a1aa; font-size: 0.95rem; }
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #2A2A2A;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Results === */
.results-container {
  padding: 3rem 1.5rem 2rem;
  margin: 0 auto;
  max-width: 520px;
  width: 100%;
}
.results-container h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}
.result-section {
  background: #1A1A1A;
  border-radius: 14px;
  padding: 1.25rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid #333333;
}
.result-section h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #AAAAAA;
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.result-section p, .result-section li {
  color: #d4d4d8;
  font-size: 0.95rem;
  line-height: 1.6;
}
.result-section ul {
  list-style: none;
  padding: 0;
}
.result-section ul li {
  padding: 6px 0;
  padding-left: 1.25rem;
  position: relative;
}
.result-section ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #ffffff;
  font-weight: 700;
}
/* === Archetype Card === */
.archetype-card {
  background: linear-gradient(135deg, #1A1A1A 0%, #222222 100%);
  border: 1px solid #444;
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.25rem;
  text-align: center;
}
.archetype-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #888;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.archetype-name {
  font-family: 'Bebas Neue', 'Inter', sans-serif;
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  line-height: 1.1;
}
.archetype-headline {
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.archetype-body {
  color: #c0c0c0;
  font-size: 0.92rem;
  line-height: 1.65;
}

/* === Alternatives (won't / instead) === */
.alt-pair {
  padding: 12px 0;
  border-bottom: 1px solid #2a2a2a;
}
.alt-pair:last-child { border-bottom: none; }
.alt-wont {
  color: #888;
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 6px;
  text-decoration: line-through;
  text-decoration-color: #555;
}
.alt-instead {
  color: #e0e0e0;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.5;
}

/* === Predictions list === */
.predictions-list {
  list-style: none;
  padding: 0;
}
.predictions-list li {
  padding: 8px 0;
  padding-left: 1.25rem;
  position: relative;
  color: #d4d4d8;
  font-size: 0.95rem;
  line-height: 1.6;
}
.predictions-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #ffffff;
  font-weight: 700;
}

.cta-box {
  text-align: center;
  margin-top: 2rem;
  padding: 1.5rem;
  background: #1A1A1A;
  border: 1px solid #333333;
  border-radius: 14px;
}
.cta-box p {
  font-size: 1rem;
  font-weight: 600;
}

/* === Responsive — desktop === */
@media (min-width: 480px) {
  .welcome-container h1 { font-size: 2rem; }
  .question-text { font-size: 1.35rem; }
}

/* === Mobile tweaks === */
@media (max-width: 479px) {
  .welcome-container h1 { font-size: 1.7rem; }
  .question-text { font-size: 1.05rem; }
  .logo-img { width: 160px; }
  .slider-value-display { font-size: 2.5rem; }
  .question-container { padding: 3rem 1.25rem 2rem; }
  .results-container { padding: 2.5rem 1.25rem 2rem; }
}
