/* Forge app shell: sign-in screens, app frame, account page, sheets. The dashboard screens bring their own styles. */
:root {
  --bg: #0B0C0E; --sf: #15171A; --sf2: #1F2226; --ln: rgba(255, 255, 255, .09); --ln2: rgba(255, 255, 255, .16);
  --tx: #F2F3EF; --mu: #A3A9AE; --ac: #C8F560; --on: #0B0C0E; --err: #FF9A8B;
  --display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --body: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--tx); font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
button { font: inherit; color: inherit; }
.f-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* boot */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 5; }
.boot-mark { width: 44px; height: 54px; color: var(--tx); animation: f-boot 1.2s ease-in-out infinite; }
@keyframes f-boot { 50% { opacity: .35; } }

/* ---------- sign-in ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
.auth-art { display: none; }
.auth-main { display: flex; flex-direction: column; min-width: 0;
  padding: max(20px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--tx); text-decoration: none; }
.logo .m { width: 24px; height: 30px; }
.logo .w { width: 84px; height: 30px; }
.auth-body { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 400px; margin: 0 auto; padding: 32px 0 24px; }
.auth h1 { font: 800 clamp(40px, 11vw, 52px)/.92 var(--display); text-transform: uppercase; letter-spacing: .005em; margin: 0 0 10px; }
.auth .lead { margin: 0 0 28px; color: var(--mu); font-size: 16px; }
.auth-foot { text-align: center; color: var(--mu); font-size: 13px; padding-top: 8px; }

@media (min-width: 960px) {
  .auth { grid-template-columns: minmax(0, 1.1fr) minmax(460px, .9fr); }
  .auth-art { display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; padding: 40px 48px;
    background: #0B0C0E url(img/login.jpg) center / cover no-repeat; isolation: isolate; }
  .auth-art::after { content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(180deg, rgba(11, 12, 14, .55) 0%, rgba(11, 12, 14, .15) 40%, rgba(11, 12, 14, .9) 100%); }
  .auth-art .logo .m { width: 28px; height: 34px; } .auth-art .logo .w { width: 98px; height: 34px; }
  .auth-art h2 { font: 800 clamp(48px, 5vw, 76px)/.9 var(--display); text-transform: uppercase; margin: 0; max-width: 12ch; }
  .auth-art h2 em { font-style: normal; color: var(--ac); }
  .auth-main .auth-top .logo { visibility: hidden; }
  .auth-main { padding-inline: 56px; }
}

:is(.auth, .acct, .f-sheet) .seg { display: flex; padding: 3px; border-radius: 999px; background: var(--sf2); flex: none; }
:is(.auth, .acct, .f-sheet) .seg button { height: 32px; min-width: 42px; padding: 0 10px; border-radius: 999px; border: 0; background: transparent; color: var(--mu); font: 600 12px var(--mono); cursor: pointer; }
:is(.auth, .acct, .f-sheet) .seg button[aria-pressed="true"] { background: var(--tx); color: var(--bg); }

:is(.auth, .acct, .f-sheet) .form { display: flex; flex-direction: column; gap: 14px; }
:is(.auth, .acct, .f-sheet) .field { display: flex; flex-direction: column; gap: 6px; }
:is(.auth, .acct, .f-sheet) .field label { font-size: 13px; font-weight: 500; color: var(--mu); }
:is(.auth, .acct, .f-sheet) .inp { display: flex; align-items: center; height: 52px; border-radius: 14px; background: var(--sf2); border: 1px solid var(--ln); transition: border-color .15s; }
:is(.auth, .acct, .f-sheet) .inp:focus-within { border-color: var(--ac); }
:is(.auth, .acct, .f-sheet) .inp.bad { border-color: var(--err); }
:is(.auth, .acct, .f-sheet) .inp input { flex: 1; min-width: 0; height: 100%; padding: 0 14px; border: 0; background: transparent; color: var(--tx); font: 500 16px var(--body); outline: none; }
:is(.auth, .acct, .f-sheet) .inp input::placeholder { color: #6E747A; }
:is(.auth, .acct, .f-sheet) .inp .eye { height: 44px; padding: 0 14px; border: 0; background: transparent; color: var(--mu); font-size: 13px; font-weight: 500; cursor: pointer; }
:is(.auth, .acct, .f-sheet) .hint { font-size: 12px; color: var(--mu); }
:is(.auth, .acct, .f-sheet) .field .err { font-size: 13px; color: var(--err); }
:is(.auth, .acct, .f-sheet) .row-end { display: flex; justify-content: flex-end; margin-top: -4px; }

:is(.auth, .acct, .f-sheet) .btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 54px; padding: 0 22px; border-radius: 999px; border: 0;
  background: var(--ac); color: var(--on); font: 600 16px var(--body); text-decoration: none; cursor: pointer; transition: transform .15s ease, opacity .15s; }
:is(.auth, .acct, .f-sheet) .btn:active { transform: scale(.98); }
:is(.auth, .acct, .f-sheet) .btn[disabled] { opacity: .6; cursor: default; transform: none; }
:is(.auth, .acct, .f-sheet) .btn.google { background: #FFFFFF; color: #1F1F1F; }
:is(.auth, .acct, .f-sheet) .btn.ghost { background: transparent; color: var(--tx); border: 1px solid var(--ln2); }
:is(.auth, .acct, .f-sheet) .btn.danger { background: transparent; color: var(--err); border: 1px solid rgba(255, 154, 139, .35); }
:is(.auth, .acct, .f-sheet) .btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: f-spin .7s linear infinite; }
@keyframes f-spin { to { transform: rotate(360deg); } }
:is(.auth, .acct, .f-sheet) .link { border: 0; background: none; padding: 6px 0; color: var(--ac); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
:is(.auth, .acct, .f-sheet) .link.mu { color: var(--mu); font-weight: 500; }
:is(.auth, .acct, .f-sheet) .or { display: flex; align-items: center; gap: 12px; color: var(--mu); font-size: 13px; margin: 6px 0; }
:is(.auth, .acct, .f-sheet) .or::before, :is(.auth, .acct, .f-sheet) .or::after { content: ""; flex: 1; height: 1px; background: var(--ln); }
:is(.auth, .acct, .f-sheet) .switch { margin-top: 22px; text-align: center; color: var(--mu); font-size: 15px; }
:is(.auth, .acct, .f-sheet) .alert { padding: 12px 14px; border-radius: 14px; background: rgba(255, 154, 139, .1); border: 1px solid rgba(255, 154, 139, .3); color: #FFC2B8; font-size: 14px; }
:is(.auth, .acct, .f-sheet) .alert button { margin-left: 4px; }
:is(.auth, .acct, .f-sheet) .note { padding: 14px 16px; border-radius: 16px; background: rgba(200, 245, 96, .08); border: 1px solid rgba(200, 245, 96, .25); color: var(--tx); font-size: 15px; }
:is(.auth, .acct, .f-sheet) .big-ico { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--sf2); color: var(--ac); margin-bottom: 20px; }

/* ---------- app frame ---------- */
.app { position: fixed; inset: 0; display: flex; justify-content: center; background: #060708; }
.screen { position: relative; width: 100%; max-width: 520px; height: 100%; overflow: hidden; background: var(--bg); }
@media (min-width: 600px) { .screen { border-inline: 1px solid var(--ln); box-shadow: 0 0 80px rgba(0, 0, 0, .5); } }
.fx-host { height: 100%; }
.fx-host > .fx { width: 100% !important; height: 100% !important; }
.fx-host .tabs { height: calc(62px + max(22px, env(safe-area-inset-bottom))) !important; padding-bottom: max(22px, env(safe-area-inset-bottom)) !important; }
.fx-host header:has(> .fx-acct) > .seg { margin-left: auto; margin-right: 10px; }
.fx-acct { width: 38px; height: 38px; flex: none; border-radius: 999px; display: grid; place-items: center; background: var(--ac); color: var(--on) !important;
  font: 600 15px var(--body); text-decoration: none; text-transform: uppercase; }
@media (prefers-reduced-motion: no-preference) { .fx-host.enter { animation: f-enter .28s var(--ease) both; } @keyframes f-enter { from { opacity: 0; transform: translateY(8px); } } }

/* ---------- account page ---------- */
.acct { height: 100%; overflow-y: auto; padding: max(14px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 18px; }
.acct-top { display: flex; align-items: center; justify-content: space-between; }
.icon-btn { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--ln); background: var(--sf); color: var(--tx); display: grid; place-items: center; cursor: pointer; text-decoration: none; }
.who { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 24px; background: var(--sf); border: 1px solid var(--ln); }
.avatar { width: 56px; height: 56px; border-radius: 999px; background: var(--ac); color: var(--on); display: grid; place-items: center; font: 600 22px var(--body); text-transform: uppercase; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who b { display: block; font-size: 18px; letter-spacing: -.01em; }
.who span { color: var(--mu); font-size: 14px; word-break: break-all; }
.group { border-radius: 24px; background: var(--sf); border: 1px solid var(--ln); overflow: hidden; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 60px; padding: 12px 18px; border: 0; background: none; color: var(--tx); text-align: left; text-decoration: none; font-size: 15px; font-weight: 500; cursor: pointer; }
.item + .item { border-top: 1px solid var(--ln); }
.item small { display: block; color: var(--mu); font-size: 13px; font-weight: 400; }
.item svg { color: var(--mu); flex: none; }
.fine { color: var(--mu); font-size: 12px; text-align: center; }

/* ---------- toast + sheets ---------- */
.f-toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; width: min(440px, calc(100% - 32px));
  padding: 14px 16px; border-radius: 16px; background: var(--tx); color: var(--bg); font-size: 14px; font-weight: 500; box-shadow: 0 16px 40px rgba(0, 0, 0, .4); }
.f-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 40; }
.f-sheet { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 41; width: min(520px, 100%); padding: 10px 22px max(28px, env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0; background: var(--sf); display: flex; flex-direction: column; gap: 14px; }
.f-sheet .grab { width: 40px; height: 5px; border-radius: 5px; background: var(--ln2); align-self: center; margin-bottom: 6px; }
.f-sheet h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.f-sheet p { margin: 0; color: var(--mu); }
.howto { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; counter-reset: s; }
.howto li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--sf2); counter-increment: s; }
.howto li::before { content: counter(s); width: 26px; height: 26px; border-radius: 999px; background: var(--ac); color: var(--on); font: 600 13px var(--mono); display: grid; place-items: center; flex: none; }
.app-ico { width: 56px; height: 56px; border-radius: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .f-sheet { animation: f-up .32s var(--ease) both; } @keyframes f-up { from { transform: translate(-50%, 100%); } }
  .f-scrim { animation: f-fade .2s ease both; } @keyframes f-fade { from { opacity: 0; } }
  .auth-body > * { animation: f-rise .45s var(--ease) both; } @keyframes f-rise { from { opacity: 0; transform: translateY(10px); } }
}

/* ---------- dashboard polish ---------- */
.fx-host .seg button { height: 36px; min-width: 44px; }
.fx-host .tab { font-size: 12px !important; }
.fx-acct { width: 40px; height: 40px; }
.auth .lead b { overflow-wrap: anywhere; }

/* legal links + delete account (1.2) */
.auth .legal { margin-top: 14px; text-align: center; color: var(--mu); font-size: 13px; line-height: 1.5; }
.auth .legal a, .fine a { color: var(--tx); text-decoration: underline; text-underline-offset: 2px; }
.acct-end { display: flex; flex-direction: column; gap: 10px; }
.acct .btn.del { background: transparent; color: var(--err); border: 0; height: 48px; font-weight: 500; gap: 8px; display: inline-flex; align-items: center; justify-content: center; }
.acct .btn.del:hover { background: rgba(255, 154, 139, .08); }
.f-sheet .btn.danger.solid { background: var(--err); color: #1A0703; border: 0; }
.f-sheet .btn.danger.solid:disabled { opacity: .4; cursor: not-allowed; }
.f-sheet .warn-ico { width: 52px; height: 52px; border-radius: 16px; background: rgba(255, 154, 139, .14); color: var(--err); display: flex; align-items: center; justify-content: center; margin: 6px 0 12px; }
.f-sheet .sheet-p { margin: 10px 0 0; font-size: 15px; line-height: 1.5; color: var(--tx); }
.f-sheet .sheet-p.mu { color: var(--mu); }
.f-sheet .need { font-weight: 700; color: var(--tx); background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.f-sheet #delForm { margin-top: 16px; }

/* Forge Pro (1.4): paywall, test checkout, account */
.pw { gap: 16px; }
.pw > *, .acct > * { flex-shrink: 0; }
.pw-k { margin: 6px 0 0; font: 600 12px var(--mono, 'Geist Mono', monospace); text-transform: uppercase; letter-spacing: .1em; color: var(--ac); }
.pw-h { margin: 0; font: 800 clamp(30px, 8.6vw, 44px)/.95 var(--display); text-transform: uppercase; text-wrap: balance; overflow-wrap: anywhere; }
.pw-from { display: flex; gap: 10px; align-items: center; margin: 0; padding: 12px 14px; border-radius: 16px; background: var(--sf); border: 1px solid var(--ln); font-size: 14px; }
.pw-from svg { color: var(--ac); flex: none; }
.pw-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pw-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; }
.pw-list svg { color: var(--ac); flex: none; margin-top: 2px; }
.pw-free { margin: 0; color: var(--mu); font-size: 13.5px; line-height: 1.45; }
.pw-opts { display: flex; flex-direction: column; gap: 10px; }
.pw-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 12px 16px; border-radius: 20px; border: 1.5px solid var(--ln2); background: var(--sf); color: var(--tx); font: inherit; text-align: left; cursor: pointer; }
.pw-opt[aria-checked="true"] { border-color: var(--ac); background: color-mix(in srgb, var(--ac) 8%, var(--sf)); }
.pw-radio { width: 22px; height: 22px; border-radius: 999px; border: 2px solid var(--ln2); flex: none; display: grid; place-items: center; }
.pw-opt[aria-checked="true"] .pw-radio { border-color: var(--ac); }
.pw-opt[aria-checked="true"] .pw-radio::after { content: ''; width: 10px; height: 10px; border-radius: 999px; background: var(--ac); }
.pw-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pw-l b { font-size: 16px; } .pw-l small { color: var(--mu); font-size: 12.5px; }
.pw-save { font: 700 10.5px 'Geist Mono', monospace; text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px; border-radius: 999px; background: var(--ac); color: var(--on); white-space: nowrap; }
.pw-price { margin-left: auto; text-align: right; display: flex; flex-direction: column; }
.pw-price b { font: 600 18px 'Geist Mono', monospace; } .pw-price small { color: var(--mu); font-size: 12px; }
.pw-done { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 18px; border-radius: 24px; background: var(--sf); border: 1px solid var(--ln); }
.pw-done > svg { color: var(--ac); width: 28px; height: 28px; }
.pw-done h2 { margin: 0; font-size: 22px; } .pw-done p { margin: 0; color: var(--mu); }
.pay-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding: 12px 0; border-top: 1px solid var(--ln); border-bottom: 1px solid var(--ln); font-size: 15px; }
.pay-total b { font-size: 18px; }
.pay-test { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 162, 76, .12); border: 1px solid rgba(255, 162, 76, .45); color: #FFC48F; font-size: 13px; line-height: 1.45; }
.pay-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pay-chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 44px; padding: 6px 10px; border-radius: 10px; border: 1px solid rgba(255, 162, 76, .45); background: transparent; color: var(--tx); font: 500 12px var(--body); cursor: pointer; }
.pay-chip .mono { font: 600 11.5px 'Geist Mono', monospace; color: #FFC48F; }
.pay-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.f-sheet #payForm { margin-top: 14px; }
.f-sheet { max-height: 92vh; overflow-y: auto; }
.pro-chip { display: inline-block; vertical-align: middle; margin-left: 6px; font: 700 10px 'Geist Mono', monospace; letter-spacing: .08em; padding: 3px 7px; border-radius: 999px; background: var(--ac); color: var(--on); }
.test-chip { display: inline-block; vertical-align: middle; margin-left: 4px; font: 600 10px 'Geist Mono', monospace; letter-spacing: .06em; padding: 3px 7px; border-radius: 999px; border: 1px solid rgba(255, 162, 76, .6); color: #FFC48F; text-transform: uppercase; }
.item.static { cursor: default; }
/* free accounts: small PRO tag on the locked tabs */
.f-free .fx .tabs a[href="Coach.dc.html"], .f-free .fx .tabs a[href="Nutrition.dc.html"] { position: relative; }
.f-free .fx .tabs a[href="Coach.dc.html"]::after, .f-free .fx .tabs a[href="Nutrition.dc.html"]::after { content: 'PRO'; position: absolute; top: 2px; right: 50%; transform: translateX(26px); font: 700 8.5px 'Geist Mono', monospace; letter-spacing: .06em; padding: 2px 4px; border-radius: 6px; background: #C8F560; color: #0B0C0E; pointer-events: none; }

/* emails (1.4.5): sign-up opt-in + Account switches */
.auth .opt-in { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 4px; color: var(--mu); font-size: 14px; line-height: 1.45; cursor: pointer; text-align: left; }
.auth .opt-in input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ac); cursor: pointer; }
.group-h { margin: 0 0 -8px 6px; color: var(--mu); font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.group-note { margin: -8px 6px 0; color: var(--mu); font-size: 12px; }
.tog { position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--ln); transition: background .2s; }
.tog::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px; background: var(--tx); transition: transform .2s; }
.item[aria-checked="true"] .tog { background: var(--ac); }
.item[aria-checked="true"] .tog::after { transform: translateX(18px); background: var(--on); }
.item[role="switch"]:disabled { opacity: .7; cursor: progress; }
.item[role="switch"]:focus-visible { outline: 2px solid var(--ac); outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) { .tog, .tog::after { transition: none; } }

/* Cloudflare Turnstile (1.4.6): invisible unless a check is needed */
.auth .cf-ts { display: flex; justify-content: center; min-height: 0; }
.auth .cf-ts:empty { display: none; }
.auth .cf-ts iframe { max-width: 100%; }
