/* 7 Under Golf — app styles. Mobile-first. */
:root {
  /* Core UI palette */
  --green-900: #1E3A34;   /* primary deep green — appbar, splash, dark surfaces */
  --green-700: #2F7D5A;   /* medium green — buttons, active states, links */
  --green-500: #3E9670;   /* lighter green — accents, progress */
  --sage:      #A9B8A8;   /* muted green-grey */
  --accent:    #C9B79C;   /* warm tan — highlights, brand mark, premium */
  --cream:     #EAE7E1;   /* app background */
  --ink:       #1E2A26;   /* body text (near-black green) */
  --muted:     #6E7E75;   /* secondary text */
  --line:      #D9D6CC;   /* borders on cream */
  --danger:    #DC2626;
  --ok:        #16A34A;

  /* Scorecard / Data palette (categorical + light fills) — for stats & charts */
  --data-blue:   #1D4ED8; --data-blue-50:   #DBEAFE;
  --data-green:  #16A34A; --data-green-50:  #DCFCE7;
  --data-violet: #6D28D9; --data-violet-50: #EDE9FE;
  --data-amber:  #D97706; --data-amber-50:  #FEF3C7;
  --data-red:    #DC2626; --data-red-50:    #FEE2E2;

  --radius:    16px;
  --tabbar-h:  64px;
  /* One family: Nunito. Heavier weights (700/800) stand in for display type. */
  --font:      'Nunito', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --serif:     'Nunito', system-ui, sans-serif;  /* alias: existing display rules → Nunito */
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }

/* Display elements (previously serif) — Nunito needs weight to read as headings. */
.splash__mark, .appbar__brand, .auth__title, .section__title,
.wizard__title, .coach-hero__name, .pillar__title { font-weight: 800; letter-spacing: -0.01em; }

/* --- Splash / launch screen --- */
.splash {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  height: 100dvh; background: var(--green-900); text-align: center; padding: 24px;
  transition: opacity .35s ease;
}
.splash.is-out { opacity: 0; }
.splash__logo {
  width: 200px; max-width: 62%; height: auto;
  animation: splashLogoIn 1.3s cubic-bezier(.2,.7,.2,1) .25s both;
}
.splash__mark {
  font-weight: 800; font-size: 40px; color: var(--cream);
  letter-spacing: 1px; line-height: .9;
  animation: splashLogoIn 1.3s cubic-bezier(.2,.7,.2,1) .25s both;
}
.splash__mark span { display: block; font-weight: 600; font-size: 13px; letter-spacing: 6px; color: var(--accent); margin-top: 6px; }
.splash__tagline {
  margin: 0; font-size: 15px; font-weight: 500; letter-spacing: .3px;
  color: rgba(234,231,225,.82);
  animation: splashFadeUp .9s ease 1.15s both;
}
@keyframes splashLogoIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes splashFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .splash__logo, .splash__mark, .splash__tagline { animation-duration: .01ms; animation-delay: 0ms; }
}

/* --- Inputs (shared, on light surfaces) --- */
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0; }
.field {
  width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); font-size: 16px; outline: none;
}
.field:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(47,125,90,.16); }
.link { background: none; border: 0; color: var(--green-700); font-size: 14px; font-weight: 600; }

/* --- Welcome auth (rendered inside the dark-green splash) --- */
.authbox { width: 100%; max-width: 320px; margin-top: 6px; animation: splashFadeUp .8s ease 1.5s both; }
.authbox__form { display: flex; flex-direction: column; gap: 10px; }
.authbox .field { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.18); color: var(--cream); }
.authbox .field::placeholder { color: rgba(234,231,225,.55); }
.authbox .field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201,183,156,.22); background: rgba(255,255,255,.14); }
.authbox .btn--primary { background: var(--cream); color: var(--green-900); margin-top: 4px; }
.authbox .btn--primary:active { background: #fff; }
.auth-links { display: flex; flex-direction: column; align-items: center; gap: 9px; margin-top: 14px; }
.auth-links .link { color: var(--accent); }
.auth-links .link.subtle { color: rgba(234,231,225,.66); font-weight: 500; }

/* --- Buttons --- */
.btn { border: 0; border-radius: 12px; padding: 15px 18px; font-size: 16px; font-weight: 600; margin-top: 18px; }
.btn--primary { background: var(--green-700); color: #fff; }
.btn--primary:disabled { opacity: .6; }
.btn--primary:active { background: var(--green-900); }

/* --- App shell --- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
.appbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 18px 12px; background: var(--green-900); color: var(--cream);
}
.appbar__brand { font-family: var(--serif); font-weight: 700; font-size: 18px; letter-spacing: .5px; }
.appbar__brand span { color: var(--accent); font-family: var(--font); font-weight: 500; font-size: 11px; letter-spacing: 4px; margin-left: 6px; }
.outlet { flex: 1; padding: 18px 16px 24px; }
.outlet.is-leaving { opacity: .4; }

/* --- Section view --- */
.section__header { margin: 4px 2px 18px; }
.section__header--sub { display: grid; gap: 2px; }
.section__title { font-family: var(--serif); font-size: 26px; margin: 0 0 2px; }
.section__sub { color: var(--muted); margin: 0; }
.section__note { color: var(--muted); font-size: 13px; text-align: center; margin: 18px 8px 0; }
.backlink { align-self: start; background: none; border: 0; color: var(--green-700); font-size: 14px; font-weight: 500; padding: 0 0 6px; }
.feature-list { display: flex; flex-direction: column; gap: 12px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.feature__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.feature__title { font-size: 16px; margin: 0; }
.feature__desc { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.45; }
.feature.is-locked { opacity: .85; }
.feature.is-link { cursor: pointer; }
.feature.is-link:active { background: #fafaf7; }

/* --- Account footer (Me) --- */
.account { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.account__row { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px; }
.account__label { color: var(--muted); font-size: 14px; }
.btn--ghost { background: none; color: var(--danger); border: 1px solid var(--line); }
.btn--ghost:active { background: #fdf2f1; }

/* --- Coach section hero --- */
.coach-hero { text-align: center; padding: 12px 0 20px; }
.coach-hero__avatar { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--accent); color: var(--green-900); font-family: var(--serif); font-weight: 700; font-size: 26px; margin-bottom: 10px; }
.coach-hero__name { font-family: var(--serif); font-size: 24px; margin: 0 0 2px; }
.coach-hero__tagline { color: var(--muted); margin: 0; }

/* --- Badges --- */
.badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; line-height: 1; }
.badge--premium { background: rgba(201,183,156,.32); color: #6b5a3c; }
.badge--phase { background: #eef1ef; color: var(--muted); margin-left: auto; }
.badge--free { background: rgba(246,244,236,.18); color: var(--cream); border: 1px solid rgba(246,244,236,.35); }

/* --- Bottom tab bar --- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fff; border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11px; }
.tab__icon { font-size: 18px; line-height: 1; }
.tab.is-active { color: var(--green-700); }
.tab.is-active .tab__icon { transform: translateY(-1px); }

/* --- Forms --- */
.form { display: flex; flex-direction: column; gap: 2px; }
.formrow { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.formrow:last-child { margin-bottom: 0; }
select.field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236c7a72' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.field--area { resize: vertical; min-height: 76px; font-family: inherit; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 9px 14px; font-size: 14px; }
.chip.is-on { background: var(--green-700); color: #fff; border-color: var(--green-700); }

.segmented { display: flex; background: #eef1ef; border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.segmented__btn { flex: 1; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 500; padding: 10px; border-radius: 9px; }
.segmented__btn.is-on { background: #fff; color: var(--green-900); box-shadow: 0 1px 4px rgba(0,0,0,.1); }

.sticky-save { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); margin-top: 16px; }
.sticky-save .btn { width: 100%; margin: 0; }

/* --- Onboarding wizard --- */
.wizard { min-height: 100dvh; display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); max-width: 460px; margin: 0 auto; }
.wizard__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.wizard__progress { display: flex; gap: 6px; }
.wizard__dot { width: 22px; height: 4px; border-radius: 2px; background: var(--line); transition: .2s; }
.wizard__dot.is-on { background: var(--green-500); }
.wizard__skip { color: var(--muted); }
.wizard__step { flex: 1; }
.wizard__hero { display: grid; place-items: center; margin: 8px 0 18px; }
.wizard__hero .splash__mark { color: var(--green-900); }
.wizard__title { font-family: var(--serif); font-size: 26px; margin: 0 0 4px; }
.wizard__sub { color: var(--muted); margin: 0 0 22px; }
.wizard__nav { display: flex; gap: 12px; margin-top: 20px; }
.wizard__nav .btn { flex: 1; margin: 0; }
.wizard__back:disabled { opacity: .4; }

/* --- Onboarding nudge --- */
.nudge { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; border: 0; text-align: left;
  background: rgba(201,183,156,.26); color: #6b5a3c; padding: 12px 16px; font-size: 14px; font-weight: 600; }
.nudge__cta { color: var(--green-700); font-weight: 700; white-space: nowrap; }

/* --- Toasts --- */
.toasts { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 84px); z-index: 20; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 12px; color: #fff; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); opacity: 0; transform: translateY(8px); transition: .22s; }
.toast.is-in { opacity: 1; transform: none; }
.toast--info { background: var(--green-700); }
.toast--success { background: var(--ok); }
.toast--error { background: var(--danger); }
