/* =============================================================
   MANIFEST30 — styles.css
   All styles in one file. No inline styles. No <style> tags.
   ============================================================= */

/* ── Google Fonts are loaded in index.html ── */

/* ─────────────────────────────────────────────
   CSS CUSTOM PROPERTIES — TIME-RESPONSIVE THEMES
   ───────────────────────────────────────────── */

:root {
  /* Default (Midnight) — overridden by theme classes on <body> */
  --bg:          #0d1b24;
  --bg-card:     #1a2535;
  --text:        #f4ecdf;
  --text-muted:  #a89880;
  --accent:      #c99b4e;   /* gold — consistent across all themes */
  --accent-ui:   #c99b4e;   /* interactive elements */
  --teal:        #1f5c56;   /* brand teal — used in light themes */
  --gold:        #c99b4e;
  --border:      rgba(244, 236, 223, 0.15);

  /* Shared */
  --radius:      16px;
  --radius-sm:   8px;
  --font-serif:  'Playfair Display', Georgia, serif;
  --font-sans:   'Inter', system-ui, sans-serif;
  --transition:  0.3s ease;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Day — 5am–10pm (warm cream, dark text, teal interactive) */
body.theme-day {
  --bg:          #f6ede0;
  --bg-card:     #fdf7f0;
  --text:        #1c2e38;
  --text-muted:  #5a7a74;
  --accent:      #1f5c56;   /* teal = interactive in Day (6.58:1 ✅) */
  --accent-ui:   #1f5c56;
  --teal:        #1f5c56;
  --gold:        #c99b4e;   /* gold = decorative only in Day (2.16:1 ❌ on cream) */
  --border:      rgba(28, 46, 56, 0.12);
}

/* Night — 10pm–5am (deep dark, light text, gold interactive) */
body.theme-night {
  --bg:          #0d1b24;
  --bg-card:     #1a2535;
  --text:        #f4ecdf;
  --text-muted:  rgba(168, 152, 128, 1); /* ~66% — above 35% floor */
  --accent:      #c99b4e;   /* gold = interactive in Night (6.91:1 ✅) */
  --accent-ui:   #c99b4e;
  --teal:        #1f5c56;   /* teal = decorative only in Night (2.27:1 ❌ on dark) */
  --gold:        #c99b4e;
  --border:      rgba(244, 236, 223, 0.15);
}

/* ─────────────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────────────── */

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

html, body {
  height: 100%;
  overflow: hidden; /* SPA — scrolling happens inside .screen-content */
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  transition: background-color var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────────────────
   SCREEN SYSTEM
   ───────────────────────────────────────────── */

.screen {
  display: none;
  position: fixed;
  inset: 0;
  flex-direction: column;
  background-color: var(--bg);
  transition: background-color var(--transition);
}

.screen.active {
  display: flex;
}

.screen-content {
  flex: 1;
  overflow-y: auto;
  padding: 48px 24px calc(80px + var(--safe-bottom));
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.screen-content.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
}

/* ─────────────────────────────────────────────
   TYPOGRAPHY
   ───────────────────────────────────────────── */

h1, h2, h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; margin-bottom: 8px; }
h3 { font-size: 1rem; margin-bottom: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

p { line-height: 1.6; }

.wordmark {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 2.4rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.tagline {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: -8px;
}

.mantra {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--accent);
}

.greeting {
  font-size: 1.3rem;
  font-weight: 500;
}

.day-count {
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.subline {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.prompt {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 8px;
}

.tip {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.softener {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 12px;
}

.reading-instruction {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
  line-height: 1.6;
  margin: 16px 0;
  padding: 0 8px;
}

.flow-greeting {
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
  margin-bottom: 16px;
}

/* ─────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────── */

.btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition), transform 0.1s ease;
  text-align: center;
  text-decoration: none;
  margin-top: 12px;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background-color: var(--accent);
  color: var(--bg);
}

.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
  background-color: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 12px 24px;
}

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

.btn-option {
  background-color: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
  width: 100%;
  margin-top: 8px;
}

.btn-option:hover,
.btn-option.selected {
  border-color: var(--accent);
  background-color: rgba(196, 164, 232, 0.1);
}

/* ─────────────────────────────────────────────
   FORMS
   ───────────────────────────────────────────── */

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  margin-top: 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="time"],
textarea,
select {
  display: block;
  width: 100%;
  padding: 14px 16px;
  background-color: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color var(--transition);
  -webkit-appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

/* ─────────────────────────────────────────────
   THANK YOU CARD
   ───────────────────────────────────────────── */

.card-frame {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin: 20px 0;
  font-family: var(--font-serif);
  line-height: 1.8;
}

.card-frame .card-dear {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card-frame .card-body {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text);
  white-space: pre-line;
}

.card-frame .card-closing {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 16px;
}

.card-frame.editable textarea {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  line-height: 1.8;
  resize: none;
}

.card-frame.editable textarea:focus {
  border: none;
  outline: none;
}

.reveal-intro {
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
  margin-bottom: 4px;
}

.reveal-subline {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
}

/* ─────────────────────────────────────────────
   NAUTILUS PROGRESS
   ───────────────────────────────────────────── */

.nautilus-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 24px 0;
  position: relative;
}

.nautilus-progress {
  width: 180px;
  height: 180px;
  object-fit: contain;
  transition: opacity 0.5s ease;
  /* Day-based opacity/clip applied via app.js inline style */
}

.nautilus-pulse {
  display: flex;
  justify-content: center;
  align-items: center;
}

.nautilus-spinner {
  width: 100px;
  height: 100px;
  object-fit: contain;
  animation: pulse 2s ease-in-out infinite;
}

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

.generating-text {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-muted);
  margin-top: 24px;
  font-size: 1rem;
}

/* ─────────────────────────────────────────────
   HOME CHECKLIST
   ───────────────────────────────────────────── */

.checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background-color: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), opacity var(--transition);
  font-size: 0.95rem;
}

.checklist-item.done {
  opacity: 0.5;
  border-color: var(--accent);
}

.check-icon {
  font-size: 1.2rem;
  color: var(--accent);
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.checklist-item.done .check-icon::before { content: '✓'; }

/* ─────────────────────────────────────────────
   STEP INDICATOR
   ───────────────────────────────────────────── */

.step-indicator {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ─────────────────────────────────────────────
   AUTH — LOGO + TRIAL BADGE
   ───────────────────────────────────────────── */

.welcome-nautilus {
  width: 56px;
  height: auto;
  opacity: 0.85;
  margin-bottom: 4px;
}

.auth-nautilus {
  width: 36px;
  height: auto;
  opacity: 0.85;
  margin-bottom: 20px;
}

.trial-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(31, 92, 86, 0.1);
  border: 1px solid rgba(31, 92, 86, 0.25);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0 4px;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.4;
}

.trial-badge strong { color: var(--accent); }

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 16px;
}

.label-row label { margin-top: 0; }

.link-btn {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}

.success-icon {
  font-size: 2.4rem;
  margin-bottom: 4px;
}

.email-highlight { color: var(--accent); }

/* ─────────────────────────────────────────────
   CARD REVEAL
   ───────────────────────────────────────────── */

.reveal-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--accent);
  text-align: center;
  margin: 4px 0 12px;
}

.reveal-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────
   HOLDING SCREEN
   ───────────────────────────────────────────── */

.holding-heading {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 2rem;
}

/* ─────────────────────────────────────────────
   REMINDERS — LABEL GROUPS
   ───────────────────────────────────────────── */

.reminder-label-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reminder-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}

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

.hint-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
  opacity: 0.7;
}

/* ─────────────────────────────────────────────
   DEAR OPTIONS
   ───────────────────────────────────────────── */

.dear-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 320px;
}

/* ─────────────────────────────────────────────
   REMINDER ROWS
   ───────────────────────────────────────────── */

.reminder-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.reminder-row label {
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
  color: var(--text);
}

.reminder-row input[type="time"] {
  width: auto;
  border: none;
  background: transparent;
  text-align: right;
  color: var(--accent);
  font-size: 1rem;
  padding: 0;
}

/* ─────────────────────────────────────────────
   TIMER
   ───────────────────────────────────────────── */

.timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 20px 0;
}

.timer {
  font-size: 3rem;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.why-handwrite {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 16px 0;
  line-height: 1.6;
}

.why-handwrite summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

/* ─────────────────────────────────────────────
   STREAK
   ───────────────────────────────────────────── */

.streak {
  text-align: center;
  margin: 16px 0;
}

.streak-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.streak-label {
  font-size: 0.9rem;
  color: var(--gold);
  margin-top: 4px;
}

.closing-greeting {
  font-size: 1.3rem;
  font-weight: 500;
  text-align: center;
}

/* ─────────────────────────────────────────────
   SOUL-CARE IDEAS
   ───────────────────────────────────────────── */

.soul-care-ideas {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.soul-care-ideas li {
  padding: 14px 16px;
  background-color: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

/* ─────────────────────────────────────────────
   MANIFESTIVAL
   ───────────────────────────────────────────── */

.manifestival-stats,
.manifestival-stat-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background-color: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.stat-value {
  font-weight: 600;
  color: var(--accent);
}

.affirmations {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0;
  text-align: center;
}

.affirmation-line {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.8s ease;
}

.affirmation-line.visible { opacity: 1; }

.finale {
  text-align: center;
  font-size: 2rem;
  margin: 16px 0 8px;
}

.finale-text {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gold);
}

.affirmation {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-muted);
  text-align: center;
  margin: 12px 0;
}

.whats-next {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 24px;
}

/* ─────────────────────────────────────────────
   SETTINGS
   ───────────────────────────────────────────── */

.settings-section {
  margin-bottom: 32px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.settings-row label {
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
  color: var(--text);
}

.settings-row input[type="text"],
.settings-row input[type="time"],
.settings-row select {
  width: auto;
  background: transparent;
  border: none;
  text-align: right;
  color: var(--accent);
  font-size: 0.95rem;
  padding: 0;
}

.settings-link {
  display: block;
  padding: 14px 0;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.settings-link:hover { color: var(--text); }

/* ─────────────────────────────────────────────
   BOTTOM NAV
   ───────────────────────────────────────────── */

.bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 12px 8px calc(12px + var(--safe-bottom));
  background-color: var(--bg-card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-item {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 4px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: color var(--transition);
}

.nav-item.active,
.nav-item:hover {
  color: var(--accent);
}

/* ─────────────────────────────────────────────
   CONFETTI CANVAS
   ───────────────────────────────────────────── */

#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* ─────────────────────────────────────────────
   TOAST
   ───────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: calc(80px + var(--safe-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  z-index: 1000;
  max-width: 90vw;
  text-align: center;
}

/* ─────────────────────────────────────────────
   UTILITIES
   ───────────────────────────────────────────── */

.hidden { display: none !important; }

.text-center { text-align: center; }

.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
