/* ===== Dear Me — Design System ===== */
:root {
  --forest: #3D6B52;
  --teal: #2A9C8E;
  --teal-light: #3DBFAF;
  --gold: #B8903A;
  --gold-light: #D4A852;
  --cream-bg: #F9F6ED;
  --cream-card: #F2EDE0;
  --teal-wash: #B8D4C8;
  --gold-wash: #E8CF90;
  --ink: #2B2B26;
  --ink-soft: #5A5A50;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 2px 14px rgba(61, 107, 82, 0.08);
  --font-serif: "Georgia", "Iowan Old Style", "Palatino Linotype", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream-bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body {
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ===== Typography ===== */
h1, h2, h3 {
  font-family: var(--font-serif);
  color: var(--forest);
  margin: 0 0 0.5em 0;
  line-height: 1.25;
}
h1 { font-size: 1.6rem; letter-spacing: 0.02em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

p { line-height: 1.6; margin: 0 0 1em 0; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.4em;
  display: block;
}

.italic-line {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--forest);
}

/* ===== Header ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--cream-bg);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(61,107,82,0.08);
}
.topbar .logo-mark {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar .logo-mark img { height: 42px; width: auto; }
.topbar .logo-mark span {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--forest);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}
.pause-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--gold);
  border: none;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(184,144,58,0.35);
  animation: pauseGlow 2.8s ease-in-out infinite;
  white-space: nowrap;
}
.pause-icon-sm { font-size: 0.7rem; letter-spacing: -1px; }
@keyframes pauseGlow {
  0%, 100% { box-shadow: 0 2px 8px rgba(184,144,58,0.35); }
  50% { box-shadow: 0 2px 16px rgba(184,144,58,0.7); }
}

/* ===== Screens ===== */
.screen {
  flex: 1;
  padding: 20px 18px 100px 18px;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Cards ===== */
.card {
  background: var(--cream-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(184,144,58,0.12);
}
.card.wash-teal { background: var(--teal-wash); }
.card.wash-gold { background: var(--gold-wash); }

.pause-card {
  background: var(--teal-wash);
  cursor: pointer;
  border: 1px solid var(--teal-light);
}
.pause-card:active { transform: scale(0.99); }
.pause-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* ===== Botanical divider ===== */
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--gold);
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
}
.divider span { font-size: 0.8rem; }

/* ===== Home screen ===== */
.hero {
  text-align: center;
  padding: 28px 6px 10px 6px;
}
.hero img.mark { width: 136px; height: auto; margin-bottom: 14px; }
.hero h1 { font-size: 1.7rem; }
.hero .sub { font-family: var(--font-serif); font-style: italic; color: var(--ink-soft); font-size: 1rem; margin-bottom: 4px;}
.hero .tagline { color: var(--teal); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.02em; margin-top: 10px; }

.progress-ring-wrap {
  display: flex;
  justify-content: center;
  margin: 22px 0 6px 0;
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin: 18px 0 8px 0;
}
.day-chip {
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid var(--teal-light);
  color: var(--forest);
  background: var(--cream-card);
}
.day-chip.done { background: var(--forest); color: var(--cream-bg); border-color: var(--forest); }
.day-chip.current { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-wash); color: var(--gold); }
.day-chip.future { opacity: 0.45; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 20px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.98rem;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, opacity 0.15s ease;
  min-height: 50px;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--forest); color: #fff; }
.btn-secondary { background: transparent; color: var(--forest); border: 1.5px solid var(--forest); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-ghost { background: transparent; color: var(--teal); font-weight: 600; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn + .btn { margin-top: 10px; }

/* ===== Day screen ===== */
.day-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--forest);
  color: var(--cream-bg);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.day-method {
  display: inline-block;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.day-title { font-size: 1.3rem; margin-bottom: 14px; }
.day-intro { color: var(--ink-soft); font-style: italic; font-family: var(--font-serif); font-size: 1rem; }

.question-block { margin: 20px 0; }
.question-label {
  font-weight: 700;
  color: var(--forest);
  font-size: 0.92rem;
  margin-bottom: 8px;
  display: block;
}
textarea {
  width: 100%;
  min-height: 110px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--teal-light);
  background: #fff;
  padding: 14px;
  font-family: var(--font-sans);
  font-size: 0.98rem;
  color: var(--ink);
  resize: vertical;
  line-height: 1.5;
}
textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42,156,142,0.15);
}
.save-hint {
  font-size: 0.75rem;
  color: var(--teal);
  margin-top: 6px;
  min-height: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.save-hint.show { opacity: 1; }

.action-box {
  background: var(--gold-wash);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 18px 0;
}
.action-box .eyebrow { color: var(--forest); }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  cursor: pointer;
}
.checkbox-row input { width: 22px; height: 22px; accent-color: var(--forest); }
.checkbox-row span { font-weight: 600; color: var(--forest); }

.return-box {
  background: var(--teal-wash);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 18px 0;
}
.return-box .eyebrow { color: var(--forest); }

.closing-line {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--forest);
  padding: 18px 10px;
  font-size: 1.05rem;
}

/* ===== Nav ===== */
.day-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--cream-bg);
  border-top: 1px solid rgba(61,107,82,0.1);
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom)) 18px;
  display: flex;
  gap: 10px;
  z-index: 15;
}

/* ===== Quiz table ===== */
.quiz-item { margin-bottom: 18px; }
.quiz-statement { font-size: 0.95rem; margin-bottom: 8px; color: var(--ink); }
.quiz-scale { display: flex; gap: 8px; }
.quiz-scale button {
  flex: 1;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1.5px solid var(--teal-light);
  background: #fff;
  font-weight: 700;
  color: var(--forest);
  cursor: pointer;
  font-size: 0.95rem;
}
.quiz-scale button.selected {
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
}
.quiz-total {
  text-align: center;
  padding: 16px;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--forest);
}

/* ===== Install banner ===== */
.install-banner {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--forest);
  color: #fff;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom)) 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 30;
  font-size: 0.85rem;
}
.install-banner button {
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}
.install-banner .close-x {
  background: none;
  border: none;
  color: #fff;
  opacity: 0.7;
  font-size: 1rem;
  padding: 4px;
}

/* ===== Privacy note ===== */
.privacy-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--teal-wash);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 10px;
}
.privacy-note .lock { font-size: 1.1rem; }

footer.app-footer {
  text-align: center;
  padding: 24px 18px 30px 18px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-family: var(--font-serif);
  font-style: italic;
}

/* Small screens */
@media (max-width: 360px) {
  .day-grid { gap: 6px; }
  .screen { padding: 16px 14px 100px 14px; }
}
