/* ============================================================
   Glispy funnel — design system
   Primary: #1a008f · Dark: #0f0060 · Green: #16a34a
   ============================================================ */

:root {
  --indigo: #1a008f;
  --indigo-dark: #0f0060;
  --indigo-tint: #f0edfb;
  --indigo-tint-2: #e6e2f7;
  --green: #16a34a;
  --green-tint: #eaf7ef;
  --red: #dc2626;
  --red-tint: #fdecec;
  --ink: #191927;
  --muted: #5f5f74;
  --line: #e7e7ef;
  --bg: #f4f4f8;
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

/* Phone frame — mobile-first, max 430px centered */
.phone {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: #fff;
  position: relative;
}
@media (min-width: 470px) {
  .phone { box-shadow: 0 0 60px rgba(15, 0, 96, 0.10); }
}

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  animation: screen-in 0.28s ease both;
}
@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.pad { padding: 28px 22px; }

/* ---------- Typography ---------- */
h1 { font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -0.015em; }
h3 { font-size: 17px; font-weight: 700; }
.sub { color: var(--muted); font-size: 16px; }
.small { font-size: 13px; color: var(--muted); }
.fine-print { font-size: 12px; color: var(--muted); text-align: center; }

.logo {
  font-weight: 900;
  letter-spacing: 0.22em;
  font-size: 15px;
  color: var(--indigo);
}
.logo.on-photo { color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: block;
  width: 100%;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  background: var(--indigo);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  padding: 17px 24px;
  text-align: center;
  text-decoration: none;
  transition: transform 0.08s ease, background 0.15s ease, opacity 0.15s ease;
  font-family: inherit;
}
.btn:active { transform: scale(0.98); }
.btn:hover { background: var(--indigo-dark); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.green { background: var(--green); }
.btn.green:hover { background: #128a3f; }
.btn.red { background: var(--red); }
.btn.red:hover { background: #b91c1c; }

.text-link {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: center;
  color: var(--indigo);
  font-size: 15px;
  font-weight: 600;
  padding: 14px;
  text-decoration: none;
  font-family: inherit;
}
.text-link:hover { text-decoration: underline; }

/* ---------- Photos & placeholders ---------- */
.photo {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #2a1b8f 0%, #1a008f 45%, #4a3ab0 100%);
}
.photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.photo .photo-note {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  text-align: center;
  padding: 16px;
}
.photo .photo-note .emoji { font-size: 34px; opacity: 0.8; }

.photo.hero { height: 340px; }
.photo.hero .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,0,96,0.35) 0%, rgba(15,0,96,0.15) 40%, rgba(15,0,96,0.72) 100%);
  z-index: 2;
}
.photo.hero .hero-content {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  color: #fff;
}
.photo.hero h1 { color: #fff; font-size: 32px; }

.photo.banner {
  height: 150px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
/* Portrait source photos: taller slot, crop biased toward the face */
.photo.banner.portrait { height: 190px; }
.photo.portrait img { object-position: center 22%; }
.photo.banner .overlay {
  position: absolute; inset: 0; z-index: 2;
  background: rgba(15, 0, 96, 0.12);
}

/* ---------- Progress bar (quiz) ---------- */
.quiz-top { padding: 18px 22px 0; }
.progress-track {
  height: 3px;
  border-radius: 99px;
  background: var(--indigo-tint-2);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--indigo);
  border-radius: 99px;
  transition: width 0.35s ease;
}
.step-label {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--indigo);
}

/* ---------- Quiz options ---------- */
.options { display: flex; flex-direction: column; gap: 10px; margin: 22px 0 26px; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 15px 16px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.option:hover { border-color: #c9c2ea; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .radio {
  width: 20px; height: 20px;
  flex: none;
  border-radius: 50%;
  border: 2px solid #c9c9d6;
  transition: all 0.12s ease;
}
.option.selected {
  border-color: var(--indigo);
  background: var(--indigo-tint);
}
.option.selected .radio {
  border-color: var(--indigo);
  border-width: 6px;
}

/* ---------- Cards & checklists ---------- */
.card {
  border-radius: var(--radius);
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
}
.card.indigo { background: var(--indigo-tint); border-color: var(--indigo-tint-2); }
.card.green { background: var(--green-tint); border-color: #d3ecdd; }

.checklist { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.checklist li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15.5px;
  font-weight: 500;
}
.checklist .check {
  color: var(--green);
  font-weight: 800;
  flex: none;
  line-height: 1.5;
}

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}
.field input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 15px 16px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.12s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-tint-2);
}
.field .error { color: var(--red); font-size: 12.5px; margin-top: 5px; display: none; }
.field.invalid input { border-color: var(--red); }
.field.invalid .error { display: block; }

/* ---------- Loading screen ---------- */
.loading-screen {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 30px;
  padding: 40px 30px;
}
.spinner {
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 4px solid var(--indigo-tint-2);
  border-top-color: var(--indigo);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-msg {
  font-size: 17px;
  font-weight: 600;
  color: var(--indigo-dark);
  min-height: 52px;
  transition: opacity 0.25s ease;
}
.loading-bar-track {
  width: 100%;
  max-width: 260px;
  height: 5px;
  background: var(--indigo-tint-2);
  border-radius: 99px;
  overflow: hidden;
}
.loading-bar-fill {
  height: 100%;
  background: var(--indigo);
  border-radius: 99px;
  width: 0%;
  transition: width 0.45s ease;
}

/* ---------- Result page ---------- */
.result-header {
  background: linear-gradient(160deg, var(--indigo-dark) 0%, var(--indigo) 70%);
  color: #fff;
  padding: 34px 22px 30px;
}
.result-header .logo { color: rgba(255,255,255,0.85); margin-bottom: 22px; display: block; }
.result-header h1 { color: #fff; font-size: 27px; }
.profile-subtitle {
  display: inline-block;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.result-section { padding: 26px 22px 4px; }
.result-section h3 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--indigo);
  margin-bottom: 12px;
}
.numbered { list-style: none; counter-reset: n; display: flex; flex-direction: column; gap: 12px; }
.numbered li {
  counter-increment: n;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15.5px;
}
.numbered li::before {
  content: counter(n);
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--indigo-tint);
  color: var(--indigo);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.food-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.food-list li {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.food-list .food-name { font-weight: 700; font-size: 15.5px; }
.food-list .food-reason { font-size: 13.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Pricing ---------- */
.price-display { text-align: center; margin: 26px 0; }
.price-big {
  font-size: 72px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--indigo);
}
.price-big.green { color: var(--green); }
.price-big.red { color: var(--red); }
.price-mid { font-size: 20px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.price-sub { font-size: 15.5px; font-weight: 600; margin-top: 12px; }
.price-small { font-size: 13px; color: var(--muted); margin-top: 4px; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 6px 13px;
}
.badge.indigo { background: var(--indigo-tint); color: var(--indigo); }
.badge.green { background: var(--green-tint); color: var(--green); }
.badge.red { background: var(--red); color: #fff; }
.badge.gold { background: #fdf4e3; color: #a16207; }

.promo-tag {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
  margin: 14px 0;
}

/* ---------- Plan cards (Screen 11) ---------- */
.plan-card {
  position: relative;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  margin-bottom: 14px;
  background: #fff;
}
.plan-card.selected {
  border-color: var(--indigo);
  background: var(--indigo-tint);
  box-shadow: 0 0 0 3px var(--indigo-tint-2);
}
.plan-card .plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.plan-card .plan-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-card.selected .plan-label { color: var(--indigo); }
.plan-card .plan-radio {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid #c9c9d6;
  flex: none;
  transition: all 0.12s ease;
}
.plan-card.selected .plan-radio { border-color: var(--indigo); border-width: 7px; }
.plan-price-row { display: flex; align-items: baseline; gap: 8px; }
.plan-price-row .big { font-size: 44px; font-weight: 900; letter-spacing: -0.03em; color: var(--indigo); line-height: 1; }
.plan-price-row .mid { font-size: 16px; font-weight: 700; }
.plan-price-under { font-size: 14px; font-weight: 600; color: var(--muted); margin: 6px 0 12px; }
.plan-card .checklist li { font-size: 14px; }

/* ---------- Trust footer ---------- */
.trust-footer {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding: 20px 0 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
}
.trust-item { display: flex; gap: 8px; align-items: flex-start; }
.trust-item .t-icon { flex: none; font-size: 14px; line-height: 1.4; }
.trust-item p { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.trust-item p b { color: var(--ink); display: block; font-size: 12px; }

/* ---------- Downsell modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 0, 96, 0.45);
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade-in 0.2s ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-sheet {
  background: #fff;
  width: 100%;
  max-width: 430px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 22px 22px 0 0;
  padding: 14px 22px 30px;
  animation: slide-up 0.32s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: none; }
}
.modal-handle {
  width: 42px; height: 5px;
  background: var(--line);
  border-radius: 99px;
  margin: 0 auto 18px;
}

/* ---------- App screen (Screen 9) ---------- */
.app-screen { padding-bottom: 86px; }
.search-mock {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 14px 18px;
  color: var(--muted);
  font-size: 15px;
  margin-top: 18px;
  background: var(--bg);
}
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav button {
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 0 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-family: inherit;
}
.bottom-nav button .nav-icon { font-size: 20px; }
.bottom-nav button.active { color: var(--indigo); }

/* ---------- Renewal reminder (Screen 10) ---------- */
.calendar-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--indigo-tint);
  color: var(--indigo);
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.stat-rows { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
}
.stat-row .stat-emoji { font-size: 20px; }
.stat-row .stat-n {
  margin-left: auto;
  font-weight: 900;
  color: var(--indigo);
  font-size: 18px;
}

/* ---------- Confirmation (Screen 14) ---------- */
.big-check {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: var(--green-tint);
  color: var(--green);
  font-size: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
}
.access-list { list-style: none; display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
.access-list li {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 15.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
}

/* ---------- Checkout stub ---------- */
.checkout-box {
  border: 1.5px dashed var(--indigo-tint-2);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--indigo-tint);
  font-size: 14px;
}
.checkout-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: #fff;
  border-radius: 6px;
  padding: 2px 7px;
}

/* ---------- Preview menu ---------- */
.preview-toggle {
  position: fixed;
  bottom: 14px;
  right: 14px;
  z-index: 60;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  opacity: 0.55;
}
.preview-toggle:hover { opacity: 1; }
.preview-menu {
  position: fixed;
  bottom: 56px;
  right: 14px;
  z-index: 60;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(15, 0, 96, 0.18);
  padding: 8px;
  max-height: 70vh;
  overflow-y: auto;
  width: 250px;
}
.preview-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink);
  font-family: inherit;
}
.preview-menu button:hover { background: var(--indigo-tint); }
.preview-menu .pm-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px 4px;
}

/* Utility */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.center { text-align: center; }
.grow { flex: 1; }

/* ── Desktop two-column layout for landing screen ── */
@media (min-width: 768px) {
  .landing-screen {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    min-height: 100dvh;
  }

  /* Expand the phone wrapper so the two-column layout has room */
  .phone:has(.landing-screen) {
    max-width: 1100px;
  }

  /* Left column: hero image fills full height */
  .landing-screen .photo.hero {
    width: 50%;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    flex-shrink: 0;
  }

  /* Right column: content centered vertically */
  .landing-screen .pad.grow {
    width: 50%;
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
  }
}
