/* ==========================================================================
   Mentigo — shared design system  ·  "sage & cream" theme
   Soft cream background, forest ink, a serif display face, and the sage-green
   of the fox logo as the primary accent — warm, calm, cohesive.
   ========================================================================== */
:root {
  --bg: #f2f0e6;          /* soft warm cream */
  --bg-soft: #e7e4d5;     /* deeper cream for insets/inputs */
  --card: #fffdf7;        /* warm white */
  --card-border: rgba(40, 54, 40, 0.14);
  --text: #26302a;        /* deep forest ink */
  --muted: #6f7a6c;       /* sage gray */
  --brand-1: #5e8b6a;     /* sage — mascot + accents */
  --brand-2: #7fae8a;
  --accent: #5e8b6a;      /* sage green — primary (matches the logo) */
  --accent-2: #d9a441;    /* warm amber — coins & rewards */
  --ink-btn: #2a3a2e;
  --danger: #cf5a4a;
  --ok: #4c9a6a;
  --radius: 18px;
  --maxw: 1080px;
  --shadow: 0 12px 34px rgba(30, 46, 30, 0.10);
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }

/* Buttons — solid, no gradient */
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 14px;
  font-weight: 700; font-size: 1rem; cursor: pointer; border: none; font-family: inherit;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.btn-primary { background: var(--accent); color: #fff9f2; box-shadow: 0 6px 18px rgba(224, 86, 45, 0.28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(224, 86, 45, 0.38); }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--card-border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Nav */
header.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(243, 236, 223, 0.82);
  border-bottom: 1px solid var(--card-border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--text); }
.logo .dot {
  width: 28px; height: 28px; border-radius: 9px;
  background: var(--accent); display: grid; place-items: center; font-size: 0.95rem;
}

/* Auth / form layout */
.auth-shell { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 20px; }
.panel {
  width: 100%; max-width: 440px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 24px; padding: 34px; box-shadow: var(--shadow);
}
.panel.wide { max-width: 720px; }
.panel h1 { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; margin-bottom: 6px; }
.panel .lede { color: var(--muted); margin-bottom: 24px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.field .hint { font-size: 0.82rem; color: var(--muted); font-weight: 400; }
.input, select.input, textarea.input {
  width: 100%; padding: 13px 15px;
  background: var(--bg-soft); border: 1.5px solid var(--card-border);
  border-radius: 12px; color: var(--text); font-size: 1rem; font-family: inherit;
  transition: border-color 0.15s ease;
}
.input:focus { outline: none; border-color: var(--accent); }
textarea.input { resize: vertical; min-height: 90px; }

.tabs { display: flex; gap: 6px; background: var(--bg-soft); padding: 5px; border-radius: 14px; margin-bottom: 24px; }
.tabs button {
  flex: 1; padding: 10px; border: none; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--muted); font-weight: 700; font-size: 0.95rem; font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}
.tabs button.active { background: var(--accent); color: #fff9f2; }

.msg { font-size: 0.9rem; padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; display: none; }
.msg.show { display: block; }
.msg.error { background: rgba(207, 68, 68, 0.1); color: #a23030; border: 1px solid rgba(207, 68, 68, 0.28); }
.msg.ok { background: rgba(58, 164, 111, 0.12); color: #237a4f; border: 1px solid rgba(58, 164, 111, 0.3); }

.divider { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 20px 0; }
.coin-pill { background: var(--bg-soft); border: 1px solid var(--card-border); border-radius: 999px; padding: 5px 12px; font-weight: 800; font-size: 0.9rem; color: var(--text); white-space: nowrap; }

/* Bottom tab bar — anchored to the very bottom edge, prominent + elevated */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; gap: 2px;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  background: var(--card); border-top: 1px solid var(--card-border);
  box-shadow: 0 -6px 22px rgba(40, 26, 12, 0.14);
}
.tabbar .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px 6px; color: var(--muted); font-size: 0.68rem; font-weight: 700;
  border-radius: 14px; transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
  min-width: 0;
}
.tabbar .tab:active { transform: scale(0.94); }
.tabbar .tab .ti { font-size: 1.42rem; line-height: 1; }
.tabbar .tab.active { color: var(--accent); background: rgba(224, 86, 45, 0.13); }
/* leave room so page content never hides behind the bar */
body.has-tabs { padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }

/* ---- mobile polish ---- */
@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .nav-inner { height: 58px; gap: 8px; }
  .logo { font-size: 1.3rem; }
  .nav-inner .subtle-link { font-size: 0.82rem; }
  .coin-pill { padding: 5px 10px; font-size: 0.85rem; }
  .panel { padding: 24px 20px; }
}
.subtle-link { color: var(--muted); font-size: 0.92rem; }
.subtle-link:hover { color: var(--text); }
.subtle-link a { color: var(--accent); font-weight: 600; }

/* Progress */
.progress { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; margin-bottom: 26px; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width 0.3s ease; }

/* Choice chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 10px 16px; border-radius: 999px; cursor: pointer; user-select: none;
  background: var(--bg-soft); border: 1.5px solid var(--card-border);
  font-size: 0.95rem; font-weight: 600; transition: all 0.15s ease;
}
.chip:hover { border-color: var(--accent); }
.chip.selected { background: var(--accent); border-color: transparent; color: #fff9f2; }

/* Range slider */
input[type="range"] { width: 100%; accent-color: var(--accent); }
.range-val { font-weight: 800; color: var(--accent); }

.bar { height: 12px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.3s ease; }

.step-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }

.summary-item { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--card-border); }
.summary-item:last-child { border-bottom: none; }
.summary-item .k { color: var(--muted); }
.summary-item .v { font-weight: 700; text-align: right; }

/* ---- shared mascot ---- */
.mascot-svg { width: 120px; height: 120px; }
.mascot-svg.sm { width: 64px; height: 64px; }
.bob { animation: bob 3s ease-in-out infinite; transform-origin: center; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.amigo-hero { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 8px; }
.amigo-speech {
  position: relative; background: var(--card); color: var(--text);
  padding: 14px 18px; border-radius: 20px; font-weight: 600; line-height: 1.45;
  border: 1px solid var(--card-border); box-shadow: var(--shadow); max-width: 460px;
}
.amigo-speech::after {
  content: ""; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  border: 10px solid transparent; border-bottom-color: var(--card); border-top: 0;
}

/* ---- journey: day-by-day plan ---- */
.journey { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.day-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 20px; padding: 16px 18px; box-shadow: var(--shadow);
  transition: border-color .15s ease, opacity .2s ease;
}
.day-card.locked { opacity: .62; box-shadow: none; }
.day-card.open { border-color: rgba(224, 86, 45, 0.45); }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.day-badge {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: #fff9f2; flex: 0 0 auto;
  background: var(--accent);
}
.day-card.complete .day-badge { background: var(--ok); }
.day-card.locked .day-badge { background: var(--bg-soft); color: var(--muted); }
.day-title { font-weight: 700; }
.day-sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.chev { color: var(--muted); transition: transform .2s ease; }
.day-card.open .chev { transform: rotate(90deg); }
.goals { list-style: none; margin: 0; padding: 0; display: none; flex-direction: column; gap: 10px; margin-top: 14px; }
.day-card.open .goals { display: flex; }
.goal {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px;
  background: var(--bg-soft); border: 1px solid var(--card-border); border-radius: 14px;
}
.goal-row { display: flex; gap: 12px; align-items: flex-start; }
.goal-check { cursor: pointer; }
.gtype { font-size: 1.1rem; line-height: 1.4; flex: 0 0 auto; }
.goal .box {
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--card-border);
  flex: 0 0 auto; display: grid; place-items: center; margin-top: 1px; transition: all .15s ease;
  background: var(--card);
}
.goal.done .box { background: var(--ok); border-color: transparent; }
.goal.done .box::after { content: "✓"; color: #fff; font-weight: 800; font-size: .82rem; }
.goal.done .goal-text { color: var(--muted); }
.goal[data-type="simple"].done .goal-text { text-decoration: line-through; }
.goal-text { line-height: 1.4; }
.goal.done .day-badge { }
/* writing / photo goal bodies */
.w-input {
  width: 100%; min-height: 72px; resize: vertical; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--card-border); background: var(--card); color: var(--text); font: inherit; font-size: .95rem;
}
.w-input:focus { outline: none; border-color: var(--accent); }
.w-read { font-size: .95rem; white-space: pre-wrap; }
.w-read.muted, .muted { color: var(--muted); font-style: italic; }
.photo-thumb { width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; border: 1px solid var(--card-border); }
.guide { background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: 12px 14px; font-size: .92rem; line-height: 1.55; }
.goal .mini-btn { align-self: flex-start; }
.goal.done[data-type="writing"] .gtype::after,
.goal.done[data-type="photo"] .gtype::after { content: " ✓"; color: var(--ok); }
.next-hint {
  text-align: center; color: var(--muted); font-size: .9rem; padding: 16px;
  border: 1px dashed var(--card-border); border-radius: 16px;
}
.goal.bonus { border-style: dashed; border-color: rgba(232, 160, 32, 0.5); }
.day-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.mini-btn {
  border: 1.5px solid var(--card-border); background: var(--card); color: var(--text);
  font: inherit; font-weight: 700; font-size: .9rem; padding: 9px 15px; border-radius: 999px; cursor: pointer;
  transition: all .14s ease;
}
.mini-btn:hover { border-color: var(--accent); color: var(--accent); }
.mini-btn:disabled { opacity: .55; cursor: not-allowed; }
.mini-btn .lock { font-size: .72rem; background: var(--accent-2); color: #3a2a10; padding: 1px 7px; border-radius: 999px; margin-left: 6px; font-weight: 800; }

/* Upsell / premium modal */
.modal-back {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(44, 38, 32, 0.5); backdrop-filter: blur(3px);
}
.modal-back[hidden] { display: none; }
.modal {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 24px;
  padding: 30px; max-width: 380px; width: 100%; text-align: center; box-shadow: var(--shadow);
  /* If the modal is taller than the screen (e.g. New post with a preview +
     song list + audio options), scroll inside it so the buttons stay reachable. */
  max-height: calc(100dvh - 40px); overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.modal h2 { font-family: var(--font-display); font-size: 1.6rem; margin: 8px 0; }
.modal .price-tag { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--accent); margin: 6px 0 4px; }
.modal .btn { width: 100%; margin-top: 8px; }

/* ── Protected-mode "lock" surfaces ────────────────────────────────────────
   The flagship gets one consistent, deliberate look everywhere it appears —
   the same dark "lock" language as the landing page, so the app feels like one
   intentional product rather than a pile of cards. */
:root { --lock: #2f3d33; --lock-line: rgba(255,255,255,.16); }
.lockcard {
  background: var(--lock); color: #eef1ea;
  border-radius: 18px; border: 1px solid rgba(0,0,0,.18);
  box-shadow: 0 14px 34px rgba(30,46,30,.20);
  position: relative; overflow: hidden;
}
.lockcard::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%; background: radial-gradient(closest-side, rgba(217,164,65,.16), transparent 70%);
  pointer-events: none;
}
.lockcard .lc-eyebrow { color: var(--accent-2); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: .7rem; }
.lockcard h2, .lockcard h3, .lockcard .lc-title { font-family: var(--font-display); color: #fff; letter-spacing: -0.01em; }
.lockcard .lc-sub { color: #c3cfbf; }
.lockcard .lc-btn {
  background: var(--accent-2); color: #3a2a10; border: none; font: inherit; font-weight: 800;
  border-radius: 12px; padding: 12px 20px; cursor: pointer; display: inline-block;
  text-decoration: none; white-space: nowrap; transition: filter .14s ease, transform .12s ease;
}
.lockcard .lc-btn:hover { filter: brightness(1.06); }
.lockcard .lc-btn:active { transform: scale(.97); }
.lockcard.sel { outline: 2px solid var(--accent-2); outline-offset: 2px; }
