/* =============================================================
   SOLVEIG — Styles
   Mobile-first. Warm. Calm. Not clinical.
   ============================================================= */

:root {
  --cream: #FFF8F0;
  --white: #FFFFFF;
  --green-soft: #7BA690;
  --green-deep: #5C8D7A;
  --brown: #8B6F5E;
  --pink-soft: #F0D5D0;
  --text: #3D3029;
  --text-light: #6B5E54;
  --border: #E8DDD4;
  --accent: #E8A87C;
  --radius: 16px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, sans-serif;
  --shadow: 0 2px 12px rgba(61, 48, 41, 0.06);
}

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

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

body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 420px;
  min-height: 100dvh;
  background: var(--white);
  position: relative;
  overflow-x: hidden;
}

/* ─── SCREENS ───────────────────────────────────────────────── */

.screen {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  padding: 24px 20px 100px 20px;
  animation: fadeIn 0.3s ease;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; color: var(--text); }
h2 { font-size: 1.35rem; font-weight: 600; line-height: 1.3; color: var(--text); }
h3 { font-size: 1.1rem; font-weight: 600; line-height: 1.3; color: var(--text); }
p  { font-size: 1rem; color: var(--text-light); line-height: 1.6; }

.text-center { text-align: center; }
.text-small { font-size: 0.85rem; color: var(--text-light); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--green-soft);
  color: white;
}
.btn-primary:hover, .btn-primary:active {
  background: var(--green-deep);
}

.btn-secondary {
  background: var(--cream);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover, .btn-secondary:active {
  background: var(--border);
}

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

.btn-full {
  width: 100%;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
}

/* ─── CARDS ─────────────────────────────────────────────────── */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-accent {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

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

#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 8px 4px 20px 4px;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border: none;
  background: none;
  color: var(--text-light);
  font-family: var(--font);
  font-size: 0.7rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.nav-item .nav-icon {
  font-size: 1.35rem;
}
.nav-item.active {
  color: var(--green-soft);
  font-weight: 600;
}

/* ─── ONBOARDING ────────────────────────────────────────────── */

#screen-onboarding {
  justify-content: center;
  align-items: center;
  padding: 40px 24px 80px 24px;
}

.onboarding-step {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  width: 100%;
}
.onboarding-step.active {
  display: flex;
}

.onboard-emoji {
  font-size: 4rem;
  line-height: 1;
}

.onboard-journey-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.journey-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--cream);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.journey-option:has(input:checked) {
  border-color: var(--green-soft);
  background: #f0f7f4;
}

.journey-option input { display: none; }

input[type="date"],
input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s ease;
}
input[type="date"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--green-soft);
}

.onboard-nav {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

/* ─── HOME SCREEN ───────────────────────────────────────────── */

.home-fruit {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.home-fruit:active { transform: scale(0.97); }

.home-fruit-emoji {
  font-size: 5rem;
  line-height: 1;
  margin-bottom: 8px;
}

.home-week-info {
  display: flex;
  gap: 24px;
  justify-content: center;
  padding: 12px 0;
}

.week-stat {
  text-align: center;
}
.week-stat .stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.week-stat .stat-label {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.home-fact {
  text-align: center;
  font-style: italic;
  color: var(--brown);
  padding: 12px 0;
}

/* ─── CHECKIN ───────────────────────────────────────────────── */

.mood-picker {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px 0;
}

.mood-btn {
  font-size: 2.2rem;
  padding: 8px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  opacity: 0.5;
}
.mood-btn:hover, .mood-btn.selected {
  opacity: 1;
  transform: scale(1.2);
}

textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  resize: vertical;
  min-height: 100px;
}
textarea:focus {
  outline: none;
  border-color: var(--green-soft);
}

/* ─── TRIAL BANNER ──────────────────────────────────────────── */

.trial-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fdf2ec, #fef9f5);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  margin: 16px 0;
  cursor: pointer;
}
.trial-banner .trial-days {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
}

/* ─── BABY SIZE SCREEN ──────────────────────────────────────── */

.babysize-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 0;
  gap: 8px;
}
.babysize-emoji {
  font-size: 6rem;
  line-height: 1;
}
.babysize-details {
  display: flex;
  gap: 24px;
  padding: 16px 0;
}
.babysize-detail {
  text-align: center;
}
.babysize-detail .detail-val {
  font-weight: 700;
  font-size: 1.1rem;
}
.babysize-detail .detail-lbl {
  font-size: 0.75rem;
  color: var(--text-light);
}

.babysize-nav-row {
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ─── RESOURCES ─────────────────────────────────────────────── */

.resource-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--cream);
  border-radius: var(--radius);
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s ease;
}
.resource-item:active { background: var(--border); }
.resource-item .resource-icon { font-size: 1.5rem; }
.resource-item .resource-label { font-weight: 600; }
.resource-item .resource-detail { font-size: 0.85rem; color: var(--text-light); }

/* ─── PREMIUM LOCK ──────────────────────────────────────────── */

.premium-feature-list {
  list-style: none;
  padding: 0;
}
.premium-feature-list li {
  padding: 8px 0 8px 24px;
  position: relative;
}
.premium-feature-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green-soft);
  font-weight: 700;
}

.price-tag {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  padding: 16px 0;
}
.price-tag .price-sub {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-light);
}

/* ─── SETTINGS & BACKUP ─────────────────────────────────────── */

.settings-group {
  margin-bottom: 24px;
}

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

.toggle {
  width: 48px;
  height: 28px;
  background: var(--border);
  border-radius: 14px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}
.toggle.on {
  background: var(--green-soft);
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
}
.toggle.on::after { transform: translateX(20px); }

/* ─── BIRTH PREP ────────────────────────────────────────────── */

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}
.checklist-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--green-soft);
}

/* ─── MISC ──────────────────────────────────────────────────── */

.gap-sm  { margin-top: 8px; }
.gap-md  { margin-top: 16px; }
.gap-lg  { margin-top: 24px; }
.gap-xl  { margin-top: 32px; }

.hidden { display: none !important; }

/* ─── RESPONSIVE ────────────────────────────────────────────── */

@media (min-width: 421px) {
  body {
    background: #f5f0eb;
  }
  #app {
    box-shadow: 0 0 40px rgba(61, 48, 41, 0.08);
  }
}


/* ─── ONBOARDING DOTS ───────────────────────────────────────── */

.onboard-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
}

.onboard-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s ease;
}

.onboard-dot.active {
  background: var(--green-soft);
  transform: scale(1.4);
}

/* ─── PHOTO GRID ─────────────────────────────────────────────── */

.photo-card {
  width: calc(50% - 4px);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--cream);
  border: 1px solid var(--border);
  position: relative;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
}

.photo-card .photo-caption {
  padding: 6px 8px;
  font-size: 0.8rem;
  color: var(--text-light);
}

.photo-card .photo-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(255,255,255,0.9);
  color: #c44;
  border: none;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
  cursor: pointer;
}

/* ─── PHOTO FULLSCREEN ──────────────────────────────────────── */

.photo-fullscreen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  flex-direction: column;
  gap: 16px;
}

.photo-fullscreen img {
  max-width: 95vw;
  max-height: 80vh;
  border-radius: 8px;
}

.photo-fullscreen .photo-close {
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  background: transparent;
}

/* ─── INSTALL BANNER ─────────────────────────────────────────── */

#install-banner {
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ─── JOURNEY STAGE BANNERS ─────────────────────────────────── */

#home-stage-nybakt, #home-stage-baby, #home-stage-smabarn, #home-past-due {
  text-align: center;
}

#home-stage-nybakt .btn, #home-stage-baby .btn,
#home-stage-smabarn .btn, #home-past-due .btn {
  margin-top: 8px;
}


/* ─── GATE (Activation) ───────────────────────────────────────── */

#screen-gate .onboard-emoji {
  font-size: 4rem;
  margin-bottom: 16px;
}

#screen-gate input:focus {
  outline: none;
  border-color: var(--green-soft) !important;
  box-shadow: 0 0 0 3px rgba(123, 166, 144, 0.2);
}

#gate-error {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}
