/* ══════════════════════════════════════════
     RINAYA BREAKUP QUIZ
     Matching texting-simulation design system
  ══════════════════════════════════════════ */

:root {
  /* Brand */
  --sky: #3fa8d0;
  --sky-light: #6dc5e8;
  --lavender: #b88fd4;
  --sky-dim: rgba(63, 168, 208, 0.12);
  --lav-dim: rgba(184, 143, 212, 0.12);

  /* Light surface palette */
  --bg: #e8f6fc;
  --surface: #ffffff;
  --surface2: #f0f9fd;
  --surface3: #ddf0f8;
  --surface4: #c4e5f4;
  --border: rgba(63, 168, 208, 0.15);
  --border-soft: rgba(63, 168, 208, 0.25);

  /* Text */
  --text: #0d2d3d;
  --text-dim: #2d5a72;
  --text-muted: #6a9bb5;

  /* Status */
  --green: #1aab57;
  --amber: #d4880a;
  --red: #d13030;
  --blue: #3fa8d0;

  /* Radii */
  --r-xl: 22px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --r-pill: 999px;

  /* Fonts */
  --font: "Inter", system-ui, sans-serif;
  --font-head: "DM Sans", "Inter", sans-serif;
}

/* ── RESET ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: #cceaf5;
  color: var(--text);
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── PHONE SHELL ── */
.phone {
  width: 100%;
  max-width: 393px;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

@media (min-width: 480px) {
  .phone {
    max-height: 860px;
    border-radius: 48px;
    box-shadow:
      0 0 0 1px rgba(63, 168, 208, 0.2),
      0 40px 80px rgba(63, 168, 208, 0.18),
      0 0 60px rgba(63, 168, 208, 0.1);
  }
}

/* ── iOS STATUS BAR ── */
#ios-bar {
  display: none;
  background: #e4f5fb;
  padding: 16px 28px 6px;
  flex-shrink: 0;
}
@media (min-width: 480px) {
  #ios-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}
.ios-time {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
.ios-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ios-signal {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 13px;
}
.ios-signal span {
  width: 3px;
  background: var(--text);
  border-radius: 1px;
}
.ios-signal span:nth-child(1) { height: 4px; }
.ios-signal span:nth-child(2) { height: 7px; }
.ios-signal span:nth-child(3) { height: 10px; }
.ios-signal span:nth-child(4) { height: 13px; opacity: 0.25; }
.ios-wifi { font-size: 13px; }
.ios-battery { display: flex; align-items: center; }
.ios-battery-body {
  width: 25px;
  height: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 3px;
  position: relative;
  display: flex;
  align-items: center;
  padding: 2px;
}
.ios-battery-body::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 5px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 0 1px 1px 0;
}
.ios-battery-fill {
  width: 72%;
  height: 100%;
  background: var(--green);
  border-radius: 1px;
}

/* ── APP CONTENT AREA ── */
#app-content {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* ── SCREENS ── */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 22px;
  text-align: center;
  overflow-y: auto;
  background: linear-gradient(180deg, #e4f5fb 0%, #d6eff9 100%);
  /* Slide transitions — slow glide */
  transform: translateX(105%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.screen::-webkit-scrollbar { display: none; }
.screen::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 320px;
  background: radial-gradient(ellipse at 50% 0%, rgba(63,168,208,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.screen.active {
  transform: translateX(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.screen.exit-left {
  transform: translateX(-40%) scale(0.94);
  opacity: 0;
  pointer-events: none;
}

.screen-inner {
  width: 100%;
  max-width: 340px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── HERO / LANDING ── */
.hero-emoji {
  font-size: 56px;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 12px rgba(63,168,208,0.2));
}
.hero-title {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 12px;
  background: linear-gradient(150deg, #0d2d3d 20%, var(--sky) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 28px;
  max-width: 300px;
}
.hero-sub strong { color: var(--text); font-weight: 600; }

/* ── TRUST LINE ── */
.trust-line {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.trust-line svg {
  width: 12px; height: 12px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
}

/* ── VISITOR COUNTER ── */
.visitor-counter {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
  opacity: 0.8;
}

/* ── THEME TOGGLE ── */
.theme-btn {
  margin-top: 16px;
  background: var(--surface2);
  border: 1.5px solid var(--border-soft);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.theme-btn:hover {
  color: var(--sky);
  background: var(--surface3);
  border-color: var(--sky);
  box-shadow: 0 2px 12px rgba(63,168,208,0.15);
}

/* ── CTA BUTTON ── */
.cta-btn {
  background: linear-gradient(135deg, #4faece 0%, var(--sky) 45%, var(--lavender) 100%);
  color: #05131a;
  font-weight: 800;
  font-family: var(--font-head);
  padding: 15px 36px;
  border-radius: var(--r-lg);
  border: none;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 8px 24px rgba(89, 183, 218, 0.32);
  letter-spacing: 0.01em;
  width: 100%;
  position: relative;
  z-index: 1;
}
.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(89, 183, 218, 0.44);
}
.cta-btn:active {
  transform: translateY(0);
}

/* ── PROGRESS PILLS ── */
.progress-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
}
.pill {
  width: 32px;
  height: 4px;
  border-radius: 99px;
  background: rgba(63,168,208,0.18);
  transition: all 0.3s ease;
}
.pill.done { background: var(--sky); opacity: 0.5; }
.pill.active {
  background: linear-gradient(90deg, var(--sky), var(--lavender));
  width: 48px;
}

/* ── QUESTION ── */
.question-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.question-text {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 24px;
}

/* ── OPTION CARDS ── */
.options-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.option-card {
  width: 100%;
  padding: 16px 18px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(89,183,218,0.15);
  border-radius: var(--r-lg);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(63,168,208,0.06);
  position: relative;
  z-index: 1;
}
.option-card:hover {
  transform: scale(1.02);
  border-color: rgba(89,183,218,0.35);
  box-shadow: 0 6px 18px rgba(63,168,208,0.14);
  background: #ffffff;
}
.option-card:active {
  transform: scale(0.98);
}
.option-card.selected {
  border-color: var(--sky);
  background: rgba(63,168,208,0.12);
  box-shadow: 0 0 0 2px rgba(63,168,208,0.25);
  transform: scale(1.02);
}

/* ── MODAL OVERLAY ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 40, 60, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: #ffffff;
  padding: 28px 22px;
  border-radius: 28px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  border: 1px solid rgba(63, 168, 208, 0.18);
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.45s cubic-bezier(0.34, 1.4, 0.64, 1) both;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(89, 183, 218, 0.2),
    0 32px 80px rgba(0, 0, 0, 0.25),
    0 0 60px rgba(89, 183, 218, 0.07);
}
.modal::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(89,183,218,0.4), transparent);
  border-radius: 28px 28px 0 0;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.88) translateY(28px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal::-webkit-scrollbar { display: none; }

.modal-icon {
  font-size: 44px;
  margin-bottom: 12px;
  display: block;
}
.modal h2 {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  line-height: 1.3;
  color: var(--text);
}

/* ── SCORE BAR ── */
.score-bar-bg {
  width: 100%;
  height: 4px;
  background: var(--surface4);
  border-radius: var(--r-pill);
  margin-bottom: 20px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  transition: width 1.2s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* Result text */
#result-text {
  text-align: left;
  margin-bottom: 20px;
}
#result-text p {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 12px;
}
#result-text p:last-child { margin-bottom: 0; }

/* ── EMAIL SECTION ── */
#email-section {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin-top: 6px;
}
.modal-section-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.55;
}
.input-field {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  transition: border-color 0.22s, box-shadow 0.22s;
  outline: none;
  margin-bottom: 12px;
}
.input-field:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(89, 183, 218, 0.18);
}
.input-field::placeholder { color: var(--text-muted); }

/* ── CONFIRMATION SECTION ── */
.confirm-msg {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: #1da851;
  color: #fff;
  font-weight: 700;
  font-family: var(--font);
  padding: 14px;
  border-radius: var(--r-lg);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.22s;
  box-shadow: 0 4px 18px rgba(29, 168, 81, 0.28);
  letter-spacing: 0.01em;
  margin-top: 12px;
}
.wa-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(29, 168, 81, 0.4);
}

/* ══════════════════════════════════════════
     DARK MODE
  ══════════════════════════════════════════ */
[data-theme="dark"] {
  --sky: #5cbfe0;
  --sky-light: #7dd4ef;
  --lavender: #c9a4e0;
  --sky-dim: rgba(92, 191, 224, 0.15);
  --lav-dim: rgba(201, 164, 224, 0.12);

  --bg: #0c1420;
  --surface: #141c2b;
  --surface2: #1a2436;
  --surface3: #1e2a3e;
  --surface4: #263548;
  --border: rgba(92, 191, 224, 0.12);
  --border-soft: rgba(92, 191, 224, 0.2);

  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-muted: #5a7185;

  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --blue: #5cbfe0;
}

/* Body */
[data-theme="dark"] body { background: #0a1018; }

/* Phone shell */
[data-theme="dark"] .phone { background: var(--surface); }
@media (min-width: 480px) {
  [data-theme="dark"] .phone {
    box-shadow:
      0 0 0 1px rgba(92, 191, 224, 0.12),
      0 40px 80px rgba(0, 0, 0, 0.5),
      0 0 60px rgba(92, 191, 224, 0.06);
  }
}

/* Status bar */
[data-theme="dark"] #ios-bar { background: #111927; }
[data-theme="dark"] .ios-time { color: var(--text); }
[data-theme="dark"] .ios-signal span { background: var(--text); }
[data-theme="dark"] .ios-battery-body { border-color: rgba(255,255,255,0.3); }
[data-theme="dark"] .ios-battery-body::after { background: rgba(255,255,255,0.2); }

/* Screens */
[data-theme="dark"] .screen {
  background: linear-gradient(180deg, #0c1420 0%, #111927 100%);
}
[data-theme="dark"] .screen::before {
  background: radial-gradient(ellipse at 50% 0%, rgba(92,191,224,0.1) 0%, transparent 70%);
}
[data-theme="dark"] .hero-title {
  background: linear-gradient(150deg, #e2e8f0 20%, var(--sky) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Option cards dark */
[data-theme="dark"] .option-card {
  background: rgba(26, 36, 54, 0.9);
  border-color: rgba(92,191,224,0.12);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
[data-theme="dark"] .option-card:hover {
  background: var(--surface3);
  border-color: rgba(92,191,224,0.3);
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
[data-theme="dark"] .option-card.selected {
  border-color: var(--sky);
  background: rgba(92,191,224,0.15);
  box-shadow: 0 0 0 2px rgba(92,191,224,0.2);
}

/* Progress pills dark */
[data-theme="dark"] .pill { background: rgba(92,191,224,0.12); }
[data-theme="dark"] .pill.done { background: var(--sky); }
[data-theme="dark"] .pill.active { background: linear-gradient(90deg, var(--sky), var(--lavender)); }

/* Visitor counter dark */
[data-theme="dark"] .visitor-counter { color: var(--text-dim); }

/* CTA dark */
[data-theme="dark"] .cta-btn { color: #0a1018; }

/* Modal dark */
[data-theme="dark"] .modal-overlay { background: rgba(5, 10, 18, 0.75); }
[data-theme="dark"] .modal {
  background: var(--surface);
  border-color: var(--border);
  box-shadow:
    0 0 0 1px rgba(92, 191, 224, 0.12),
    0 32px 80px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(92, 191, 224, 0.05);
}
[data-theme="dark"] .modal h2 { color: var(--text); }
[data-theme="dark"] .score-bar-bg { background: var(--surface3); }
[data-theme="dark"] #email-section { border-top-color: var(--border); }
[data-theme="dark"] .input-field {
  background: var(--surface2);
  border-color: var(--border-soft);
  color: var(--text);
}
[data-theme="dark"] .input-field::placeholder { color: var(--text-muted); }
[data-theme="dark"] .confirm-msg { color: var(--text); }
