:root {
  color-scheme: light;
  --green: #164e3c;
  --green-deep: #0b3428;
  --lime: #c9f27b;
  --canvas: #f6f8f2;
  --ink: #17201c;
  --muted: #66706a;
  --line: #dfe6dc;
  --white: #fff;
  --danger: #9f2e2e;
  --shadow: 0 24px 70px rgba(22, 78, 60, .14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--canvas);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-height: 100vh; margin: 0; overflow-x: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: wait; opacity: .65; }
[hidden] { display: none !important; }

.ambient { position: fixed; z-index: -1; border-radius: 999px; filter: blur(2px); opacity: .7; }
.ambient-one { width: 420px; height: 420px; right: -150px; top: -170px; background: radial-gradient(circle, rgba(201,242,123,.66), rgba(201,242,123,0)); }
.ambient-two { width: 500px; height: 500px; left: -280px; bottom: -250px; background: radial-gradient(circle, rgba(22,78,60,.18), rgba(22,78,60,0)); }

.brand { display: flex; align-items: center; gap: 13px; color: var(--green); font-size: 1.3rem; font-weight: 850; letter-spacing: -.03em; }
.brand img { border-radius: 16px; object-fit: contain; }
.brand div { display: grid; gap: 1px; }
.brand div > span { color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: 0; }
.eyebrow { color: var(--green); font-size: .72rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.muted, .security-note { color: var(--muted); }

.auth-layout { width: min(1160px, calc(100% - 36px)); min-height: 100vh; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); gap: clamp(42px, 7vw, 100px); align-items: center; padding: 48px 0; }
.story-panel { padding: clamp(12px, 4vw, 48px); }
.story-panel .brand { margin-bottom: clamp(56px, 9vh, 104px); }
.story-panel h1 { max-width: 760px; margin: 12px 0 20px; font-size: clamp(3rem, 6vw, 5.5rem); line-height: .97; letter-spacing: -.065em; color: var(--green-deep); }
.lede { max-width: 660px; color: var(--muted); font-size: clamp(1.04rem, 1.7vw, 1.3rem); line-height: 1.55; }
.promise-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 38px; }
.promise-grid article { display: grid; gap: 7px; padding: 18px 16px; border: 1px solid rgba(22,78,60,.12); border-radius: 20px; background: rgba(255,255,255,.58); backdrop-filter: blur(12px); }
.promise-grid strong { color: var(--green); font-size: .92rem; }
.promise-grid span { color: var(--muted); font-size: .82rem; line-height: 1.45; }

.auth-card { padding: clamp(28px, 4vw, 48px); border: 1px solid rgba(22,78,60,.12); border-radius: 34px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); backdrop-filter: blur(22px); }
.mobile-brand { display: none; }
.auth-card h2 { margin: 10px 0 8px; font-size: 2rem; letter-spacing: -.04em; }
.auth-card > p { line-height: 1.5; }
.stack { display: grid; gap: 16px; margin: 26px 0 12px; }
label { display: grid; gap: 8px; color: #34423b; font-size: .86rem; font-weight: 750; }
input, select { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #ccd6ce; border-radius: 13px; outline: none; background: #fbfcfa; color: var(--ink); transition: border .18s, box-shadow .18s, background .18s; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(22,78,60,.11); background: var(--white); }
small { color: var(--muted); font-weight: 500; }
.primary, .secondary, .install-button { min-height: 48px; padding: 0 20px; border-radius: 14px; font-weight: 820; }
.primary { border: 1px solid var(--green); background: var(--green); color: var(--white); box-shadow: 0 10px 28px rgba(22,78,60,.2); }
.primary:hover { background: var(--green-deep); }
.secondary { border: 1px solid #cbd8d0; background: var(--white); color: var(--green); }
.wide { width: 100%; }
.text-button { display: block; margin: 12px auto 0; border: 0; background: none; color: var(--green); font-weight: 800; }
.security-note { margin: 22px 0 0; text-align: center; font-size: .74rem; line-height: 1.45; }

.notice { position: fixed; z-index: 20; top: max(18px, env(safe-area-inset-top)); left: 50%; width: min(520px, calc(100% - 28px)); transform: translateX(-50%); padding: 14px 18px; border: 1px solid #9fc5a5; border-radius: 16px; background: #effbea; color: #214a2e; box-shadow: 0 16px 40px rgba(22,78,60,.16); font-weight: 700; text-align: center; }
.notice[data-tone="error"] { border-color: #e2abab; background: #fff0f0; color: var(--danger); }
.busy-layer { position: fixed; z-index: 30; inset: 0; display: none; place-content: center; gap: 13px; background: rgba(246,248,242,.74); color: var(--green); font-weight: 850; backdrop-filter: blur(6px); }
.is-busy .busy-layer { display: grid; }
.spinner { width: 34px; height: 34px; margin: auto; border: 4px solid rgba(22,78,60,.18); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.app-shell { width: min(760px, 100%); min-height: 100vh; margin: 0 auto; padding: 0 22px 112px; }
.app-header { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.install-button { min-height: 40px; border: 1px solid var(--green); background: transparent; color: var(--green); }
.page { animation: page-in .25s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 20px 0 24px; }
.page-heading h1, .placeholder-page h1 { margin: 5px 0 0; color: var(--green-deep); font-size: clamp(2.25rem, 7vw, 3.7rem); line-height: 1; letter-spacing: -.055em; }
.live-pill { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #cad9cd; border-radius: 999px; background: rgba(255,255,255,.8); color: var(--green); font-size: .72rem; font-weight: 820; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #42a85e; box-shadow: 0 0 0 4px rgba(66,168,94,.14); }

.budget-card { padding: clamp(24px, 6vw, 38px); border-radius: 30px; background: linear-gradient(145deg, var(--green), #0d3c2e); color: var(--white); box-shadow: 0 26px 60px rgba(22,78,60,.24); overflow: hidden; position: relative; }
.budget-card::after { content: ""; position: absolute; width: 230px; height: 230px; right: -85px; top: -105px; border-radius: 50%; background: rgba(201,242,123,.13); }
.budget-card > span { color: rgba(255,255,255,.7); font-size: .86rem; font-weight: 750; }
.budget-card > strong { display: block; margin: 12px 0 5px; font-size: clamp(2.2rem, 8vw, 4.1rem); line-height: 1; letter-spacing: -.06em; }
.budget-card > p { margin: 0; color: rgba(255,255,255,.72); }
.budget-card dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 34px 0 0; }
.budget-card dl div { display: grid; gap: 4px; }
.budget-card dt { color: rgba(255,255,255,.62); font-size: .72rem; }
.budget-card dd { margin: 0; font-size: 1.06rem; font-weight: 820; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.metric-grid article { display: flex; gap: 13px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 21px; background: rgba(255,255,255,.82); }
.metric-grid article div { display: grid; gap: 3px; }
.metric-grid article strong { color: var(--green); }
.metric-grid article div span { color: var(--muted); font-size: .8rem; }
.metric-icon { display: grid; width: 42px; height: 42px; place-content: center; border-radius: 14px; background: #edf3ea; color: var(--green); font-size: 1.25rem; font-weight: 900; }
.insight-card { display: flex; gap: 16px; margin-top: 16px; padding: 21px; border-radius: 22px; background: rgba(201,242,123,.34); color: var(--green-deep); }
.insight-card p { margin: 5px 0 0; color: #395a4d; font-size: .88rem; line-height: 1.5; }
.spark { display: grid; flex: 0 0 38px; height: 38px; place-content: center; border-radius: 12px; background: var(--lime); }

.placeholder-page { min-height: calc(100vh - 220px); display: grid; place-content: center; text-align: center; }
.placeholder-page p { max-width: 420px; color: var(--muted); line-height: 1.6; }
.placeholder-mark { display: grid; width: 72px; height: 72px; margin: 0 auto 20px; place-content: center; border-radius: 24px; background: var(--green); color: var(--lime); font-size: 2rem; font-weight: 850; box-shadow: 0 18px 40px rgba(22,78,60,.22); }

.account-form { display: grid; gap: 16px; }
fieldset { margin: 0; padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.82); }
legend { padding: 0 8px; color: var(--green); font-size: 1.02rem; font-weight: 850; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field-grid.compact { grid-template-columns: repeat(3, 1fr); }

.bottom-nav { position: fixed; z-index: 10; left: 50%; bottom: max(13px, env(safe-area-inset-bottom)); width: min(700px, calc(100% - 24px)); transform: translateX(-50%); display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px; border: 1px solid rgba(22,78,60,.13); border-radius: 24px; background: rgba(255,255,255,.9); box-shadow: 0 18px 55px rgba(22,78,60,.18); backdrop-filter: blur(18px); }
.bottom-nav button { display: grid; justify-items: center; gap: 4px; padding: 7px; border: 0; border-radius: 17px; background: transparent; color: var(--muted); font-size: .68rem; font-weight: 760; }
.bottom-nav button > span { display: grid; width: 31px; height: 31px; place-content: center; border-radius: 10px; background: #edf1ec; color: var(--green); font-size: .9rem; font-weight: 900; }
.bottom-nav button.active { color: var(--green); background: #f2f7ee; }
.bottom-nav button.active > span { background: var(--green); color: var(--white); }

@media (max-width: 860px) {
  .auth-layout { grid-template-columns: 1fr; width: min(560px, calc(100% - 28px)); padding: 28px 0; }
  .story-panel { display: none; }
  .mobile-brand { display: flex; margin-bottom: 38px; }
  .auth-card { border-radius: 28px; }
}

@media (max-width: 560px) {
  .app-shell { padding-inline: 15px; }
  .app-header { min-height: 80px; }
  .brand { font-size: 1.13rem; }
  .brand img { width: 45px; height: 45px; }
  .budget-card { border-radius: 25px; }
  .budget-card dl { grid-template-columns: 1fr 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
  .field-grid, .field-grid.compact { grid-template-columns: 1fr; }
  fieldset { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
