/* Living Forest design system (doc 43), phase 1 foundation (doc 44).
   Used by join.html, login.html, activate.html and welcome.html. index.html
   and the admin pages keep styles.css until phases 2 and 5.
   Fonts come from fonts/fonts.css (self-hosted). */
/* ============ Tokens — Birch (light) ============ */
:root{
  --bg:#F5F4EE; --surface:#FFFFFF; --surface-2:#EEEDE4; --surface-3:#E4E2D6; --line:#DDDCCF; --line-2:#CFCDBE;
  --ink:#13201A; --ink-2:#46544B; --ink-3:#5F6C63;
  --forest:#16704A; --forest-deep:#0C4A30; --on-forest:#FFFFFF; --moss:#E2EEE3; --moss-2:#CFE3D3;
  --gold:#B7822A; --gold-deep:#7A560F; --gold-tint:#F5E7C6; --gold-line:#E3C88A; --on-gold:#241A03;
  --rust:#A8452B; --rust-deep:#7E2F1B; --rust-tint:#F4DDD2;
  --sky:#2C6E86; --sky-deep:#184A5B; --sky-tint:#DCEBEF; --sky-line:#BFDCE5;
  --soil:#EEE9DC; --focus:#1E63B8;
  --g-bark:#7A5A3C; --g-leaf:#16704A; --g-leaf2:#3E9B64; --g-deep:#0C4A30; --g-gold:#B7822A; --g-hl:#F5F4EE;
  --hill-a1:#E2EEE3; --hill-a2:#CFE3D3; --hill-b1:#DCEBEF; --hill-b2:#C7DFE6; --hill-c1:#F5E7C6; --hill-c2:#EBD6A6; --hill-d1:#EFE4DC; --hill-d2:#E3D2C5;
  --chrome:#E7E5DB; --chrome-2:#F1F0E8; --bezel:#1B231E;
  --shadow-1:0 1px 2px rgba(19,32,26,.06);
  --shadow-2:0 12px 30px -14px rgba(19,32,26,.28),0 2px 6px rgba(19,32,26,.06);
  --shadow-3:0 30px 70px -24px rgba(19,32,26,.45);
  --r-leaf:6px 28px 6px 6px; --r-leaf-sm:5px 18px 5px 5px;
  --f-display:'Fraunces',Georgia,'Times New Roman',serif;
  --f-body:'Hanken Grotesk',system-ui,-apple-system,'Segoe UI',sans-serif;
  --f-mono:'IBM Plex Mono',ui-monospace,'SFMono-Regular',Menlo,monospace;
}
/* ============ Night grove (dark) ============ */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --bg:#0A110D; --surface:#111A14; --surface-2:#18241C; --surface-3:#213027; --line:#24332A; --line-2:#31443A;
    --ink:#ECEFE6; --ink-2:#B3C0B4; --ink-3:#8D9C90;
    --forest:#57D194; --forest-deep:#A6E9C4; --on-forest:#07140D; --moss:#15261C; --moss-2:#1C3325;
    --gold:#E6B45A; --gold-deep:#F2D49C; --gold-tint:#2B2412; --gold-line:#5A4721; --on-gold:#1E1503;
    --rust:#E08A6B; --rust-deep:#F2BBA6; --rust-tint:#2E1D17;
    --sky:#6CC3DA; --sky-deep:#B3E1EE; --sky-tint:#12242A; --sky-line:#23424C;
    --soil:#17211A; --focus:#74ACEA;
    --g-bark:#A0855E; --g-leaf:#3FB47A; --g-leaf2:#6CD39C; --g-deep:#1E7A4F; --g-gold:#E6B45A; --g-hl:#0A110D;
    --hill-a1:#122219; --hill-a2:#183022; --hill-b1:#10202A; --hill-b2:#152B36; --hill-c1:#231E10; --hill-c2:#302913; --hill-d1:#221915; --hill-d2:#2E221C;
    --chrome:#050907; --chrome-2:#0C130F; --bezel:#000000;
    --shadow-1:0 1px 2px rgba(0,0,0,.5);
    --shadow-2:0 14px 34px -14px rgba(0,0,0,.7);
    --shadow-3:0 30px 70px -24px rgba(0,0,0,.8);
  }
}
:root[data-theme="dark"]{
    color-scheme:dark;
    --bg:#0A110D; --surface:#111A14; --surface-2:#18241C; --surface-3:#213027; --line:#24332A; --line-2:#31443A;
    --ink:#ECEFE6; --ink-2:#B3C0B4; --ink-3:#8D9C90;
    --forest:#57D194; --forest-deep:#A6E9C4; --on-forest:#07140D; --moss:#15261C; --moss-2:#1C3325;
    --gold:#E6B45A; --gold-deep:#F2D49C; --gold-tint:#2B2412; --gold-line:#5A4721; --on-gold:#1E1503;
    --rust:#E08A6B; --rust-deep:#F2BBA6; --rust-tint:#2E1D17;
    --sky:#6CC3DA; --sky-deep:#B3E1EE; --sky-tint:#12242A; --sky-line:#23424C;
    --soil:#17211A; --focus:#74ACEA;
    --g-bark:#A0855E; --g-leaf:#3FB47A; --g-leaf2:#6CD39C; --g-deep:#1E7A4F; --g-gold:#E6B45A; --g-hl:#0A110D;
    --hill-a1:#122219; --hill-a2:#183022; --hill-b1:#10202A; --hill-b2:#152B36; --hill-c1:#231E10; --hill-c2:#302913; --hill-d1:#221915; --hill-d2:#2E221C;
    --chrome:#050907; --chrome-2:#0C130F; --bezel:#000000;
    --shadow-1:0 1px 2px rgba(0,0,0,.5);
    --shadow-2:0 14px 34px -14px rgba(0,0,0,.7);
    --shadow-3:0 30px 70px -24px rgba(0,0,0,.8);
}


*{box-sizing:border-box}
html,body{min-height:100%}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:15px;line-height:1.5;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
a{color:var(--forest-deep)}
:focus-visible{outline:2.5px solid var(--focus);outline-offset:2px;border-radius:6px}
h1,h2,h3{font-family:var(--f-display);font-weight:640;letter-spacing:-.015em;text-wrap:balance;margin:0;line-height:1.1}
p{margin:0}
[hidden]{display:none!important}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.ic{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.gl{flex:none;display:block}
.mono{font-family:var(--f-mono);font-variant-numeric:tabular-nums}
@media (prefers-reduced-motion: reduce){*{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}}

/* ---- Text ---- */
.kicker{font-family:var(--f-mono);font-size:11px;letter-spacing:.13em;text-transform:uppercase;color:var(--forest-deep);font-weight:600;display:flex;align-items:center;gap:8px}
.kicker.gold{color:var(--gold-deep)}
.lead{font-size:16px;color:var(--ink-2);line-height:1.55;max-width:62ch}
.it{font-style:italic;font-weight:420;color:var(--forest)}
.muted{color:var(--ink-3)}
.chip{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;font-size:12.5px;font-weight:700;background:var(--surface-2);color:var(--ink-2);white-space:nowrap}
.chip.moss{background:var(--moss);color:var(--forest-deep)}
.chip.gold{background:var(--gold-tint);color:var(--gold-deep)}
.chip.sky{background:var(--sky-tint);color:var(--sky-deep)}

/* ---- Buttons ---- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:46px;padding:0 18px;border-radius:13px;border:1px solid var(--line);background:var(--surface);color:var(--ink);font-weight:700;font-size:15px;transition:transform .12s ease,box-shadow .15s ease,background .15s ease;text-decoration:none;text-align:center}
.btn:hover{box-shadow:var(--shadow-1);border-color:var(--line-2)}
.btn:active{transform:translateY(1px)}
.btn-primary{background:var(--forest);border-color:var(--forest);color:var(--on-forest);box-shadow:0 10px 22px -12px color-mix(in srgb,var(--forest) 80%,transparent)}
.btn-primary:hover{background:var(--forest-deep);border-color:var(--forest-deep);color:var(--bg)}
.btn-quiet{background:transparent;border-color:transparent;color:var(--ink-2)}
.btn-quiet:hover{background:var(--surface-2);box-shadow:none}
.btn-lg{min-height:54px;border-radius:15px;font-size:16px;padding:0 22px}
.btn-block{width:100%}
.btn[disabled]{opacity:.55;cursor:not-allowed;box-shadow:none;transform:none}

/* ---- Forms ---- */
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}
.field label{font-size:13.5px;font-weight:700;color:var(--ink-2)}
.field .hint{font-size:12.5px;color:var(--ink-3)}
/* The password hint while typing (security update 3.3). */
.pw-hint{font-size:12.5px;color:var(--ink-3);min-height:1.2em;margin-top:6px}
.pw-hint.weak{color:var(--rust-deep);font-weight:600}
.pw-hint.strong{color:var(--forest-deep,var(--forest))}
/* The email code box (security update 3.4). */
.code-inp{font-family:var(--f-mono,monospace);font-size:24px;letter-spacing:.3em;text-align:center}
.inp{width:100%;min-height:48px;border-radius:13px;border:1.5px solid var(--line);background:var(--surface);padding:11px 14px;font-size:16px;color:var(--ink);transition:border-color .15s,box-shadow .15s}
select.inp{appearance:none;-webkit-appearance:none;padding-right:40px;background-image:linear-gradient(45deg,transparent 50%,var(--ink-3) 50%),linear-gradient(135deg,var(--ink-3) 50%,transparent 50%);background-position:calc(100% - 20px) 21px,calc(100% - 15px) 21px;background-size:5px 5px,5px 5px;background-repeat:no-repeat}
.inp:focus{outline:none;border-color:var(--forest);box-shadow:0 0 0 4px color-mix(in srgb,var(--forest) 18%,transparent)}
.inp[readonly]{background:var(--surface-2);color:var(--ink-2)}
.inp.bad{border-color:var(--rust)}
.err{font-size:13.5px;color:var(--rust-deep);font-weight:600}
.form-err{margin:2px 0 12px}
.fine{font-size:13px;color:var(--ink-3);display:flex;align-items:flex-start;gap:8px;margin:14px 0 0;line-height:1.45}
.fine .ic{margin-top:1px}
.reassure{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border-radius:13px;background:var(--moss);color:var(--forest-deep);font-size:13.5px;line-height:1.45;margin:4px 0 16px}
.reassure .ic{margin-top:1px}
.given{display:flex;align-items:center;gap:10px;padding:11px 14px;border-radius:13px;background:var(--surface-2);font-size:14.5px;margin-bottom:14px}
.given b{font-weight:700}

/* ---- Page shell ---- */
.lf-top{display:flex;align-items:center;gap:12px;padding:14px 18px;max-width:1080px;margin:0 auto}
.wordmark{display:flex;align-items:center;gap:10px;flex:1;min-width:0;color:inherit;text-decoration:none}
.wordmark svg{flex:none}
.wordmark .wm-name{font-family:var(--f-display);font-weight:680;font-size:19px;letter-spacing:-.01em;line-height:1.05;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wordmark .wm-sub{font-family:var(--f-mono);font-size:9.5px;letter-spacing:.16em;text-transform:uppercase;color:var(--ink-3);display:block}
.iconbtn{width:44px;height:44px;flex:none;border-radius:14px;border:1px solid var(--line);background:var(--surface);display:flex;align-items:center;justify-content:center;color:var(--ink)}
.iconbtn.ghost{border-color:transparent;background:transparent}
.auth{min-height:calc(100vh - 72px);display:flex;flex-direction:column;justify-content:center;padding:12px 18px 40px}
.auth-card{width:100%;max-width:440px;margin:0 auto;display:flex;flex-direction:column;gap:6px}
.auth-art{display:flex;align-items:flex-end;gap:2px;height:92px;margin-bottom:14px}
.auth-art .gl{animation:growIn .8s cubic-bezier(.34,1.56,.64,1) both}
.auth-art .gl:nth-child(2){animation-delay:.1s}.auth-art .gl:nth-child(3){animation-delay:.2s}.auth-art .gl:nth-child(4){animation-delay:.3s}
.auth h1{font-size:32px;line-height:1.05;margin-bottom:6px}
.auth .lead{margin-bottom:18px;font-size:15px}
.auth .center{text-align:center}
.auth .center .lead{margin-inline:auto}
.auth-foot{max-width:440px;margin:22px auto 0;font-size:12.5px;line-height:1.5;color:var(--ink-3);text-align:center}
.actions-row{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin-top:10px}
.state{display:flex;flex-direction:column;align-items:center;text-align:center;gap:14px;padding:30px 0}
.state .gl{animation:growIn .9s cubic-bezier(.34,1.56,.64,1) both}
.spinner-plant .gl{animation:growIn 1.4s cubic-bezier(.34,1.56,.64,1) infinite alternate}
.orgpick{display:flex;flex-direction:column;gap:10px;margin-top:6px}
.orgbtn{display:flex;align-items:center;gap:14px;padding:14px 16px;border-radius:15px;border:1.5px solid var(--line);background:var(--surface);text-align:left;font-weight:700;font-size:16px;width:100%}
.orgbtn:hover{border-color:var(--forest)}
.orgbtn .grow{flex:1;min-width:0}
.orgbtn small{display:block;font-weight:500;font-size:13px;color:var(--ink-3)}

/* ---- Language switch (built now, shown from phase 2 — doc 44) ---- */
.lang-seg{display:flex;padding:3px;border-radius:11px;background:var(--surface-2);border:1px solid var(--line)}
.lang-seg button{height:32px;padding:0 10px;border:0;border-radius:8px;background:transparent;font-weight:650;font-size:13px;color:var(--ink-2)}
.lang-seg button[aria-pressed="true"]{background:var(--surface);color:var(--ink);box-shadow:var(--shadow-1)}
.lang-soon{margin:6px 0 0;font-size:12.5px;line-height:1.4;color:var(--ink-2);max-width:220px}
.lang-soon:empty{margin:0}
.lang-seg:has(+ .lang-soon){width:max-content}

/* ---- Welcome ---- */
.welcome{max-width:760px;margin:0 auto;padding:10px 18px 200px}
.welcome-art{display:flex;align-items:flex-end;justify-content:space-between;gap:2px;height:120px;margin:6px 0 18px;max-width:520px}
.welcome-art .w1{width:38px;height:38px}.welcome-art .w2{width:52px;height:52px}.welcome-art .w3{width:68px;height:68px}.welcome-art .w4{width:90px;height:90px}.welcome-art .w5{width:108px;height:108px}
.welcome-art .gl{animation:growIn .9s cubic-bezier(.34,1.56,.64,1) both}
.welcome-art .gl:nth-child(2){animation-delay:.15s}.welcome-art .gl:nth-child(3){animation-delay:.3s}.welcome-art .gl:nth-child(4){animation-delay:.45s}.welcome-art .gl:nth-child(5){animation-delay:.6s}
.welcome h1{font-size:40px;line-height:1;letter-spacing:-.03em;margin:12px 0 22px}
.welcome .copy{display:flex;flex-direction:column;gap:18px;max-width:64ch}
.welcome .copy p{font-size:17px;line-height:1.62}
.welcome .copy p.first{font-size:19px;line-height:1.55;font-family:var(--f-display);font-weight:420;letter-spacing:-.005em}
.welcome .copy p.last{font-family:var(--f-display);font-size:21px;font-weight:560;color:var(--forest-deep)}
.welcome-cta{position:fixed;left:0;right:0;bottom:0;padding:14px 18px calc(14px + env(safe-area-inset-bottom));background:linear-gradient(180deg,transparent,var(--bg) 30%);display:flex;flex-direction:column;gap:6px;align-items:center}
.welcome-cta > *{width:100%;max-width:440px}
@media (min-width:860px){
  .welcome{padding-top:30px}
  .welcome h1{font-size:60px}
  .welcome-cta{flex-direction:row;justify-content:center}
  .welcome-cta > *{width:auto;min-width:220px}
}

/* ---- Toast ---- */
.toasts{position:fixed;left:0;right:0;bottom:24px;z-index:60;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;padding-inline:16px}
.toast{display:flex;align-items:center;gap:11px;max-width:420px;padding:13px 17px;border-radius:15px;background:var(--ink);color:var(--bg);font-weight:600;font-size:14.5px;box-shadow:var(--shadow-2);animation:toastIn .28s cubic-bezier(.2,.8,.3,1)}

@keyframes toastIn{from{opacity:0;transform:translateY(12px) scale(.97)}to{opacity:1;transform:none}}
@keyframes growIn{0%{transform:scale(.4);opacity:.2}60%{transform:scale(1.12)}100%{transform:scale(1);opacity:1}}
.gl{transform-origin:50% 100%}
@media (max-width:600px){.auth{justify-content:flex-start;padding-top:8px;min-height:0}}
