/* ══════════════════════════════════════════════════════════════════
   LUNA — Design System
   Fonts: Cormorant Garamond (display) + Outfit (UI)
   Theme: Deep cosmic dark, iridescent rose/indigo accents
══════════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:           #060511;
  --surface:      rgba(255, 255, 255, 0.045);
  --surface-2:    rgba(255, 255, 255, 0.08);
  --border:       rgba(255, 255, 255, 0.08);
  --border-2:     rgba(255, 255, 255, 0.14);

  /* Wearing (warm rose) */
  --w-a:          #FF1A7C;
  --w-b:          #FF6EC7;
  --w-glow:       rgba(255, 26, 124, 0.45);
  --w-glow-soft:  rgba(255, 110, 199, 0.15);

  /* Break (cool indigo) */
  --br-a:         #6D28D9;
  --br-b:         #818CF8;
  --br-glow:      rgba(109, 40, 217, 0.45);
  --br-glow-soft: rgba(129, 140, 248, 0.15);

  /* Neutrals */
  --text:         #FFFFFF;
  --text-2:       rgba(255, 255, 255, 0.55);
  --text-3:       rgba(255, 255, 255, 0.30);
  --gold:         #FFD4A3;

  /* Radius */
  --r-sm:  12px;
  --r-md:  20px;
  --r-lg:  28px;
  --r-xl:  36px;
  --r-2xl: 48px;

  /* Active phase colors (updated by JS) */
  --phase-a:    var(--w-a);
  --phase-b:    var(--w-b);
  --phase-glow: var(--w-glow);
  --phase-soft: var(--w-glow-soft);
}

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

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

body {
  font-family: 'Outfit', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Star Field ─────────────────────────────────────────────── */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: white;
  opacity: 0;
  animation: twinkle var(--d, 4s) var(--dl, 0s) ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50%       { opacity: var(--op, 0.6); transform: scale(1); }
}

/* 30 stars with individual positions/timing */
.s1  { top: 8%;  left: 12%; --d: 3.2s; --dl: 0.1s; --op: 0.7; }
.s2  { top: 15%; left: 75%; --d: 4.5s; --dl: 0.8s; --op: 0.5; }
.s3  { top: 22%; left: 45%; --d: 2.8s; --dl: 1.2s; --op: 0.8; }
.s4  { top: 5%;  left: 88%; --d: 5.1s; --dl: 0.3s; --op: 0.4; }
.s5  { top: 35%; left: 6%;  --d: 3.7s; --dl: 2.1s; --op: 0.6; }
.s6  { top: 12%; left: 32%; --d: 4.2s; --dl: 0.6s; --op: 0.5; }
.s7  { top: 48%; left: 90%; --d: 3.0s; --dl: 1.7s; --op: 0.7; }
.s8  { top: 60%; left: 15%; --d: 4.8s; --dl: 0.4s; --op: 0.4; }
.s9  { top: 70%; left: 68%; --d: 2.6s; --dl: 2.5s; --op: 0.9; }
.s10 { top: 80%; left: 35%; --d: 3.9s; --dl: 1.0s; --op: 0.5; }
.s11 { top: 3%;  left: 55%; --d: 5.5s; --dl: 0.7s; --op: 0.3; }
.s12 { top: 90%; left: 80%; --d: 3.3s; --dl: 1.8s; --op: 0.6; }
.s13 { top: 25%; left: 20%; --d: 4.0s; --dl: 0.2s; --op: 0.5; }
.s14 { top: 42%; left: 58%; --d: 2.9s; --dl: 3.0s; --op: 0.7; }
.s15 { top: 55%; left: 42%; --d: 5.2s; --dl: 0.9s; --op: 0.4; }
.s16 { top: 18%; left: 92%; --d: 3.6s; --dl: 1.4s; --op: 0.8; }
.s17 { top: 75%; left: 5%;  --d: 4.4s; --dl: 0.5s; --op: 0.6; }
.s18 { top: 88%; left: 52%; --d: 2.7s; --dl: 2.2s; --op: 0.5; }
.s19 { top: 32%; left: 78%; --d: 5.0s; --dl: 1.1s; --op: 0.3; }
.s20 { top: 65%; left: 28%; --d: 3.4s; --dl: 0.0s; --op: 0.7; }
.s21 { top: 10%; left: 65%; --d: 4.7s; --dl: 2.8s; --op: 0.4; }
.s22 { top: 50%; left: 3%;  --d: 3.1s; --dl: 1.6s; --op: 0.6; }
.s23 { top: 95%; left: 20%; --d: 5.3s; --dl: 0.3s; --op: 0.5; }
.s24 { top: 40%; left: 95%; --d: 2.5s; --dl: 2.0s; --op: 0.8; }
.s25 { top: 28%; left: 10%; --d: 4.1s; --dl: 1.3s; --op: 0.5; }
.s26 { top: 72%; left: 88%; --d: 3.8s; --dl: 0.7s; --op: 0.4; }
.s27 { top: 85%; left: 45%; --d: 5.4s; --dl: 1.9s; --op: 0.6; }
.s28 { top: 20%; left: 50%; --d: 2.4s; --dl: 2.4s; --op: 0.9; width: 3px; height: 3px; }
.s29 { top: 58%; left: 72%; --d: 4.6s; --dl: 0.8s; --op: 0.5; }
.s30 { top: 6%;  left: 25%; --d: 3.5s; --dl: 1.5s; --op: 0.7; }

/* ── Nebula Blobs ────────────────────────────────────────────── */
.nebula {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.nebula-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: nebDrift var(--nd, 20s) ease-in-out infinite alternate;
}

.nb1 {
  width: 500px; height: 500px;
  top: -15%; left: -20%;
  background: radial-gradient(circle, rgba(255,26,124,0.12), transparent 70%);
  --nd: 22s;
}
.nb2 {
  width: 400px; height: 400px;
  bottom: -10%; right: -15%;
  background: radial-gradient(circle, rgba(109,40,217,0.15), transparent 70%);
  --nd: 18s;
  animation-delay: -9s;
}
.nb3 {
  width: 300px; height: 300px;
  top: 40%; left: 60%;
  background: radial-gradient(circle, rgba(255,110,199,0.06), transparent 70%);
  --nd: 26s;
  animation-delay: -4s;
}

@keyframes nebDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, -30px) scale(1.1); }
}

/* ── Glass Card ──────────────────────────────────────────────── */
.glass-card {
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
}

/* ── Screens ─────────────────────────────────────────────────── */
.screen {
  position: relative;
  z-index: 10;
}

/* ── Animate In ──────────────────────────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: slideUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ════════════════════════════════════════════════════════════════
   AUTH SCREEN
════════════════════════════════════════════════════════════════ */
#auth-screen, #setup-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px 20px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 24px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 36px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Views inside auth-card use flex column with consistent gap */
#login-view, #signup-view, #forgot-view, #email-sent-view, #reset-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Logo ────────────────────────────────────────────────────── */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-mark.sm { width: 28px; height: 28px; }

.logo-orb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--phase-b), var(--phase-a));
  box-shadow: 0 0 12px var(--phase-glow);
  animation: orbPulse 3s ease-in-out infinite;
}

.logo-mark.sm .logo-orb { width: 12px; height: 12px; }

@keyframes orbPulse {
  0%, 100% { box-shadow: 0 0 10px var(--phase-glow); transform: scale(1); }
  50%       { box-shadow: 0 0 20px var(--phase-glow); transform: scale(1.08); }
}

.logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  color: var(--text);
}

.logo-text.sm { font-size: 1.15rem; }

/* ── Auth copy ────────────────────────────────────────────────── */
.auth-logo {
  margin-bottom: 20px;
}

.auth-tagline {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-2);
}

.setup-hint {
  font-size: 0.88rem;
  color: var(--text-3);
  line-height: 1.5;
  margin-top: -8px;
}

/* ── Form ────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.form-label .opt {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.75rem;
  color: var(--text-3);
  opacity: 0.7;
}

.pw-wrap { position: relative; }

.form-input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder { color: var(--text-3); }

.form-input:focus {
  border-color: var(--phase-a);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(255, 26, 124, 0.12);
}

/* date input styling */
.form-input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}

.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 6px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.pw-toggle:hover { color: var(--text-2); }
.pw-toggle svg { width: 18px; height: 18px; }

.form-error {
  font-size: 0.82rem;
  color: #FF6B6B;
  padding: 10px 14px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.25);
  border-radius: var(--r-sm);
  margin-top: -4px;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 15px 20px;
  background: linear-gradient(135deg, var(--phase-a), var(--phase-b));
  border: none;
  border-radius: var(--r-md);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: transform 0.15s, opacity 0.2s, box-shadow 0.2s;
  box-shadow: 0 8px 28px var(--phase-glow);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.12), transparent);
  border-radius: inherit;
}

.btn-primary:active { transform: scale(0.97); }
.btn-primary:hover  { opacity: 0.92; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-ghost {
  width: 100%;
  padding: 10px;
  background: none;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.2s;
  text-align: center;
}
.btn-ghost span { color: var(--phase-b); font-weight: 500; }
.btn-ghost:hover { color: var(--text-2); }

/* ── Phase Picker ────────────────────────────────────────────── */
.phase-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.phase-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-family: 'Outfit', sans-serif;
}

.phase-tile.selected {
  border-color: var(--phase-a);
  background: rgba(255, 26, 124, 0.08);
}

.pt-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  animation: orbPulse 3s ease-in-out infinite;
}

.wearing-dot {
  background: radial-gradient(circle at 35% 35%, #FF6EC7, #FF1A7C);
  box-shadow: 0 0 10px rgba(255,26,124,0.6);
}

.break-dot {
  background: radial-gradient(circle at 35% 35%, #818CF8, #6D28D9);
  box-shadow: 0 0 10px rgba(109,40,217,0.6);
}

.pt-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.pt-sub {
  font-size: 0.75rem;
  color: var(--text-3);
}

/* ════════════════════════════════════════════════════════════════
   APP SCREEN
════════════════════════════════════════════════════════════════ */
#app-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding: 0 20px;
  padding-top: env(safe-area-inset-top, 0px);
}

/* ── Top Bar ──────────────────────────────────────────────────── */
.top-bar {
  width: 100%;
  max-width: 440px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 4px 8px;
}

.top-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:active { transform: scale(0.93); background: var(--surface-2); }
.icon-btn.active { color: var(--phase-b); }

/* ── Greeting ─────────────────────────────────────────────────── */
.greeting {
  width: 100%;
  max-width: 440px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 300;
  font-style: italic;
  color: var(--text-2);
  letter-spacing: 0.01em;
  padding: 8px 4px 0;
  animation-delay: 0.05s;
}

/* ── Orb Section ─────────────────────────────────────────────── */
.orb-section {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0 8px;
  width: 280px;
  height: 280px;
  flex-shrink: 0;
}

/* Outer glow — CSS-only aurora */
.orb-glow {
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--phase-glow) 0%, transparent 70%);
  filter: blur(30px);
  animation: glowPulse 4s ease-in-out infinite;
  transition: background 0.8s ease;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.7; transform: scale(0.95); }
  50%       { opacity: 1;   transform: scale(1.05); }
}

/* SVG Ring */
.orb-ring-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
  width: 240px;
  height: 240px;
}

.svg-track {
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 8;
}

.svg-arc {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke: url(#ring-grad-wearing);
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.8s ease;
}

/* Orb inner sphere */
.orb-inner {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  overflow: hidden;
  padding: 0 16px; /* side padding so wide numbers don't crowd the sphere edge */
  transition: background 0.8s ease, box-shadow 0.8s ease;
  /* default (wearing) */
  background:
    radial-gradient(circle at 35% 30%, rgba(255,110,199,0.6) 0%, transparent 55%),
    radial-gradient(circle at 65% 70%, rgba(255,26,124,0.4) 0%, transparent 55%),
    rgba(20, 6, 30, 0.85);
  box-shadow:
    inset 0 0 40px rgba(255,26,124,0.15),
    inset 0 1px 0 rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
  animation: innerBreath 4s ease-in-out infinite;
}

@keyframes innerBreath {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.02); }
}

/* Shimmer highlight */
.orb-shimmer {
  position: absolute;
  top: 12%;
  left: 20%;
  width: 38%;
  height: 25%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.22) 0%, transparent 80%);
  transform: rotate(-30deg);
  animation: shimmerShift 8s ease-in-out infinite;
}

@keyframes shimmerShift {
  0%, 100% { opacity: 0.8; transform: rotate(-30deg) scale(1); }
  50%       { opacity: 0.5; transform: rotate(-25deg) scale(0.9); }
}

.orb-day {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3.6rem, 14vw, 4.5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  color: var(--text);
  text-shadow: 0 0 30px var(--phase-glow);
  position: relative;
  z-index: 1;
  transition: color 0.3s;
  font-variant-numeric: lining-nums tabular-nums;
  text-align: center;
  width: 100%;
  /* Ensure digits always render at a consistent optical size */
  font-feature-settings: "lnum" 1, "tnum" 1;
}

.orb-day-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  position: relative;
  z-index: 1;
  text-align: center;
  width: 100%;
}

/* ── Status Strip ─────────────────────────────────────────────── */
.status-strip {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
  animation-delay: 0.1s;
}

.status-pill {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 99px;
  border: 1px solid var(--phase-a);
  color: var(--phase-b);
  background: rgba(255, 26, 124, 0.1);
  transition: all 0.4s ease;
}

.status-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.status-card {
  padding: 14px 16px;
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sc-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.sc-val {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
}

.notif-card {
  margin-top: -2px;
}

/* ── Overdue Alert ────────────────────────────────────────────── */
.overdue-alert {
  width: 100%;
  max-width: 440px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 80, 80, 0.1);
  border: 1px solid rgba(255, 80, 80, 0.25);
  border-radius: var(--r-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: #FF8080;
}
.overdue-alert svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Action Area ─────────────────────────────────────────────── */
.action-area {
  width: 100%;
  max-width: 440px;
  margin: 12px 0;
  animation-delay: 0.15s;
}

.action-btn {
  width: 100%;
  padding: 17px 24px;
  background: var(--surface);
  border: 1px solid var(--phase-a);
  border-radius: var(--r-lg);
  font-family: 'Outfit', sans-serif;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
  transition: background 0.2s, transform 0.15s, border-color 0.4s, box-shadow 0.4s;
  box-shadow: 0 0 0 0 var(--phase-glow);
}

.action-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--phase-a), var(--phase-b));
  opacity: 0.12;
  transition: opacity 0.2s;
}

.action-btn:hover::before { opacity: 0.2; }
.action-btn:active {
  transform: scale(0.98);
  box-shadow: 0 0 20px var(--phase-glow);
}

.action-ripple {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.action-btn:active .action-ripple { opacity: 1; }

/* ── Timeline ────────────────────────────────────────────────── */
.timeline-section {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation-delay: 0.2s;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 4px;
}

.timeline {
  padding: 4px 0;
  border-radius: var(--r-lg);
  overflow: hidden;
}

.tl-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.tl-row:last-child { border-bottom: none; }
.tl-row.past { opacity: 0.5; }

.tl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: box-shadow 0.3s;
}
.tl-dot.wearing { background: var(--w-a); box-shadow: 0 0 8px rgba(255,26,124,0.7); }
.tl-dot.break   { background: var(--br-a); box-shadow: 0 0 8px rgba(109,40,217,0.7); }
.tl-dot.future  { background: rgba(255,255,255,0.15); }
.tl-dot.current { background: var(--phase-a); box-shadow: 0 0 0 3px var(--phase-soft), 0 0 8px var(--phase-glow); animation: orbPulse 2s ease-in-out infinite; }

.tl-label {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text);
}
.tl-row.past .tl-label { color: var(--text-2); }

.tl-date {
  font-size: 0.8rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* ════════════════════════════════════════════════════════════════
   CONFIRMATION BOTTOM SHEET
════════════════════════════════════════════════════════════════ */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: overlayIn 0.25s ease both;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.bottom-sheet {
  width: 100%;
  max-width: 520px;
  padding: 12px 28px 32px;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: sheetUp 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-2);
  margin-bottom: 4px;
}

.sheet-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin: 4px 0;
}

.sheet-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.55rem;
  font-weight: 500;
  text-align: center;
  color: var(--text);
}

.sheet-body {
  font-size: 0.88rem;
  color: var(--text-2);
  text-align: center;
  line-height: 1.6;
  max-width: 280px;
}

.sheet-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.btn-ghost-sheet {
  width: 100%;
  padding: 13px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-ghost-sheet:hover { background: var(--surface); color: var(--text); }
.btn-ghost-sheet:active { transform: scale(0.98); }

/* ════════════════════════════════════════════════════════════════
   TOAST
════════════════════════════════════════════════════════════════ */
#toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 24px) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 20, 50, 0.95);
  color: var(--text);
  border: 1px solid var(--border-2);
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-size: 0.88rem;
  font-weight: 500;
  max-width: 320px;
  text-align: center;
  backdrop-filter: blur(20px);
  transition: opacity 0.3s, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 200;
  pointer-events: none;
  opacity: 0;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Auth extras ─────────────────────────────────────────────── */
.btn-text-link {
  background: none;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  color: var(--text-3);
  cursor: pointer;
  padding: 2px 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.btn-text-link:hover { color: var(--phase-b); }

.auth-hint {
  font-size: 0.86rem;
  color: var(--text-2);
  line-height: 1.6;
  text-align: center;
  margin-top: -6px;
}

.auth-hint-sm {
  font-size: 0.76rem;
  color: var(--text-3);
  line-height: 1.5;
  text-align: center;
  margin-top: -6px;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  color: var(--text-3);
  cursor: pointer;
  padding: 0;
  margin-bottom: -4px;
  transition: color 0.2s;
}
.back-btn:hover { color: var(--text-2); }
.back-btn svg { width: 16px; height: 16px; }

/* Email sent / lock icon */
.sent-icon {
  display: flex;
  justify-content: center;
  margin-bottom: -4px;
}

.sent-orb {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--phase-a), var(--phase-b));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px var(--phase-glow);
  animation: orbPulse 3s ease-in-out infinite;
}
.sent-orb svg { width: 26px; height: 26px; color: white; }

.sent-email {
  color: var(--phase-b);
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
}

/* Success message */
.form-success {
  font-size: 0.85rem;
  color: #6ee7b7;
  padding: 10px 14px;
  background: rgba(110, 231, 183, 0.08);
  border: 1px solid rgba(110, 231, 183, 0.2);
  border-radius: var(--r-sm);
}

/* Error type override */
.form-error.success {
  display: none;
}

/* Loading spinner on buttons */
.btn-primary:disabled::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Utilities ───────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Break phase overrides (added via JS to :root) ──────────── */
body.phase-break {
  --phase-a:    var(--br-a);
  --phase-b:    var(--br-b);
  --phase-glow: var(--br-glow);
  --phase-soft: var(--br-glow-soft);
}

/* ── Scrollbar (desktop) ─────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

/* ── Focus visible ───────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--phase-a);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── iOS Install Screen ──────────────────────────────────────── */
.install-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.install-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.install-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--phase-a), var(--phase-b));
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.install-step-body {
  flex: 1;
}
.install-step-label {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 2px;
}
.install-step-hint {
  font-size: .75rem;
  color: var(--text-3);
}
.install-share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--border-1);
  border-radius: 10px;
  margin-top: 8px;
  background: var(--surface-2);
}
.install-share-icon svg {
  width: 18px;
  height: 18px;
  color: var(--phase-a);
}
