/* ============================================
   Soul Reader - Global Styles
   Purple/Dark Theme - Mobile First
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --purple-dark: #4C1D95;
  --purple-main: #6B21A8;
  --purple-mid: #7C3AED;
  --purple-light: #9333EA;
  --purple-lighter: #A855F7;
  --purple-glow: rgba(147, 51, 234, 0.3);
  --bg-dark: #0F0A1A;
  --bg-card: #1A1128;
  --bg-card-light: #241836;
  --text-white: #FFFFFF;
  --text-light: #E2D9F3;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --gold: #FFD700;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-purple: 0 4px 24px rgba(147, 51, 234, 0.25);
  --transition: all 0.3s ease;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-white);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- Background Gradient --- */
.bg-gradient {
  background: linear-gradient(180deg, var(--bg-dark) 0%, #1A0F2E 50%, var(--bg-dark) 100%);
  min-height: 100vh;
}

/* --- Container --- */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Navigation --- */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 10, 26, 0.9);
  backdrop-filter: blur(10px);
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple-lighter), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-lang {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-white);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.nav-lang:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --- Buttons --- */
.btn-primary {
  display: block;
  width: 100%;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--purple-main), var(--purple-light));
  color: var(--text-white);
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  text-decoration: none;
  box-shadow: var(--shadow-purple);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(147, 51, 234, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: block;
  width: 100%;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-white);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

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

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* --- LANDING PAGE --- */
.hero {
  text-align: center;
  padding: 40px 0 30px;
}

.hero-illustration {
  width: 200px;
  height: 200px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, var(--purple-mid), var(--purple-lighter));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  box-shadow: 0 0 60px rgba(147, 51, 234, 0.4);
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 40px rgba(147, 51, 234, 0.3); }
  50% { box-shadow: 0 0 80px rgba(147, 51, 234, 0.5); }
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero p {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 32px;
  padding: 0 10px;
}

/* Badges */
.badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 28px 0;
  flex-wrap: wrap;
}

.badge {
  background: rgba(147, 51, 234, 0.15);
  border: 1px solid rgba(147, 51, 234, 0.3);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--purple-lighter);
  white-space: nowrap;
}

/* Testimonials */
.testimonials {
  padding: 20px 0 40px;
}

.testimonials h2 {
  text-align: center;
  font-size: 1.3rem;
  margin-bottom: 20px;
}

.testimonial-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.testimonial-stars {
  color: var(--gold);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.testimonial-text {
  color: var(--text-light);
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 8px;
}

.testimonial-name {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Footer */
.footer {
  text-align: center;
  padding: 30px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer a {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-decoration: none;
  margin: 0 12px;
  transition: var(--transition);
}

.footer a:hover {
  color: var(--text-light);
}

/* --- QUIZ PAGE --- */
.quiz-container {
  padding: 20px 0;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
}

.progress-bar-wrapper {
  margin-bottom: 24px;
}

.progress-text {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple-main), var(--purple-lighter));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Quiz Question */
.quiz-question {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-20px); }
}

.quiz-question h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.quiz-question .subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 24px;
}

/* Option Buttons */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.options-grid.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.options-grid.grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.option-btn {
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--text-white);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.option-btn:hover {
  border-color: var(--purple-mid);
  background: var(--bg-card-light);
}

.option-btn.selected {
  border-color: var(--purple-light);
  background: rgba(147, 51, 234, 0.2);
  box-shadow: 0 0 16px rgba(147, 51, 234, 0.2);
}

.option-btn .emoji {
  font-size: 1.3rem;
}

/* Multi-select */
.option-btn.multi.selected::after {
  content: '✓';
  margin-left: 8px;
  color: var(--purple-lighter);
  font-weight: 700;
}

/* Likert Scale */
.likert-container {
  padding: 20px 0;
}

.likert-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255,255,255,0.1), var(--purple-light));
  outline: none;
  margin: 20px 0;
}

.likert-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--purple-lighter);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(147, 51, 234, 0.5);
}

.likert-labels {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Date Picker */
.date-input {
  width: 100%;
  padding: 16px;
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  color: var(--text-white);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.date-input:focus {
  border-color: var(--purple-mid);
}

/* Interlude */
.interlude {
  text-align: center;
  padding: 40px 0;
  animation: fadeIn 0.5s ease;
}

.interlude-icon {
  font-size: 60px;
  margin-bottom: 20px;
}

.interlude h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.interlude p {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 32px;
  padding: 0 10px;
}

/* --- UPLOAD PAGE --- */
.upload-container {
  text-align: center;
  padding: 30px 0;
}

.upload-container h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.upload-container .subtitle {
  color: var(--text-light);
  margin-bottom: 30px;
}

.upload-instructions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 30px;
}

.instruction-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.instruction-card.good {
  border-color: rgba(16, 185, 129, 0.3);
}

.instruction-card.bad {
  border-color: rgba(239, 68, 68, 0.3);
}

.instruction-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.instruction-label {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.instruction-card.good .instruction-label { color: var(--success); }
.instruction-card.bad .instruction-label { color: var(--error); }

.instruction-tips {
  list-style: none;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.instruction-tips li {
  margin-bottom: 2px;
}

.upload-preview {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  margin: 0 auto 24px;
  overflow: hidden;
  border: 3px solid var(--purple-mid);
  display: none;
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-preview.visible {
  display: block;
}

.upload-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

#file-input {
  display: none;
}

/* --- ANALYSIS PAGE --- */
.analysis-container {
  text-align: center;
  padding: 40px 0;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.analysis-circle {
  width: 200px;
  height: 200px;
  position: relative;
  margin: 0 auto 30px;
}

.analysis-circle svg {
  width: 200px;
  height: 200px;
  transform: rotate(-90deg);
}

.analysis-circle .bg-circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 8;
}

.analysis-circle .progress-circle {
  fill: none;
  stroke: url(#purpleGradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 565;
  stroke-dashoffset: 565;
  transition: stroke-dashoffset 0.5s ease;
}

.analysis-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  font-weight: 800;
}

.analysis-steps {
  width: 100%;
  max-width: 320px;
  text-align: left;
  margin-bottom: 20px;
}

.analysis-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  color: var(--text-dim);
  font-size: 0.9rem;
  transition: var(--transition);
}

.analysis-step.active {
  color: var(--text-white);
}

.analysis-step.done {
  color: var(--success);
}

.step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.analysis-step.done .step-icon {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.analysis-step.active .step-icon {
  border-color: var(--purple-lighter);
  animation: spin 1s linear infinite;
}

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

/* Analysis Popup */
.analysis-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.analysis-popup-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.analysis-popup {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  border: 1px solid rgba(147, 51, 234, 0.3);
}

.analysis-popup h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.analysis-popup p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.popup-buttons {
  display: flex;
  gap: 10px;
}

.popup-btn {
  flex: 1;
  padding: 12px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.popup-btn.yes {
  background: linear-gradient(135deg, var(--purple-main), var(--purple-light));
  color: white;
}

.popup-btn.no {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
}

/* --- EMAIL PAGE --- */
.email-container {
  text-align: center;
  padding: 60px 0;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.email-container h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.email-container .subtitle {
  color: var(--text-light);
  margin-bottom: 32px;
}

.email-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.email-form {
  text-align: left;
}

.email-input {
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  color: var(--text-white);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  margin-bottom: 16px;
}

.email-input:focus {
  border-color: var(--purple-mid);
}

.email-input::placeholder {
  color: var(--text-dim);
}

.email-error {
  color: var(--error);
  font-size: 0.8rem;
  margin-top: -10px;
  margin-bottom: 12px;
  display: none;
}

.email-error.visible {
  display: block;
}

.newsletter-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  cursor: pointer;
}

.newsletter-opt input[type="checkbox"] {
  accent-color: var(--purple-light);
  width: 18px;
  height: 18px;
}

.newsletter-opt label {
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
}

/* --- PAYMENT PAGE --- */
.payment-container {
  padding: 20px 0 40px;
}

.payment-container h1 {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 4px;
}

.payment-container .subtitle {
  color: var(--text-light);
  text-align: center;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

/* Timer */
.countdown-timer {
  text-align: center;
  margin-bottom: 24px;
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius);
}

.timer-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.timer-value {
  color: var(--error);
  font-size: 1.4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Blurred Preview */
.sketch-preview {
  width: 200px;
  height: 200px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-mid), var(--purple-lighter));
  filter: blur(20px);
  opacity: 0.7;
}

/* Plan Cards */
.plans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.plan-card {
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.plan-card:hover {
  border-color: var(--purple-mid);
}

.plan-card.selected {
  border-color: var(--purple-light);
  background: rgba(147, 51, 234, 0.15);
}

.plan-card.popular {
  border-color: var(--purple-light);
}

.plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--purple-main), var(--purple-light));
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  white-space: nowrap;
}

.plan-price {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.plan-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.plan-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Features */
.features-list {
  margin-bottom: 24px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 0.9rem;
  color: var(--text-light);
}

.feature-check {
  color: var(--success);
  font-weight: 700;
}

/* Guarantee */
.guarantee {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.guarantee-icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

/* Press Logos */
.press-logos {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 16px 0;
  opacity: 0.4;
  flex-wrap: wrap;
}

.press-logo {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- RESULT PAGE --- */
.result-container {
  text-align: center;
  padding: 30px 0;
}

.result-container h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.result-container .subtitle {
  color: var(--text-light);
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.result-image {
  width: 280px;
  height: 280px;
  border-radius: var(--radius-lg);
  margin: 0 auto 24px;
  overflow: hidden;
  border: 3px solid var(--purple-mid);
  box-shadow: 0 0 40px rgba(147, 51, 234, 0.3);
}

.result-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.traits-list {
  text-align: left;
  margin-bottom: 24px;
}

.trait-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.trait-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.trait-value {
  font-size: 1rem;
  font-weight: 600;
}

.more-readings {
  margin-top: 32px;
}

.more-readings h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.reading-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.reading-card:hover {
  border-color: var(--purple-mid);
}

.reading-icon {
  font-size: 1.5rem;
}

.reading-name {
  font-weight: 600;
  font-size: 0.9rem;
}

/* --- Utility Classes --- */
.hidden { display: none !important; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }

/* --- Loading Spinner --- */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--purple-lighter);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

/* --- Responsive --- */
@media (min-width: 640px) {
  .container {
    max-width: 540px;
  }
  .hero h1 {
    font-size: 2.4rem;
  }
}
