:root {
  color-scheme: light;
  --bg: #fff8f1;
  --card: #fff0e2;
  --paper: #fffcf9;
  --ink: #49352d;
  --muted: #766e68;
  --line: #ecddd1;
  --primary: #b9664e;
  --primary-light: #f5dccc;
  --on-primary: #fff;
  --accent-text: #8e4936;
  --water: #278f9f;
  --carbs: #a999c6;
  --error: #9e3a2a;
  --shadow: #49352d14;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111626;
    --card: #212940;
    --paper: #192135;
    --ink: #f7f5ff;
    --muted: #b9bed8;
    --line: #3d4663;
    --primary: #b39af7;
    --primary-light: #34304f;
    --on-primary: #151629;
    --accent-text: #ccb9ff;
    --water: #6adae5;
    --carbs: #a4db76;
    --error: #ffae9c;
    --shadow: #0003;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); line-height: 1.55; }
main { flex: 1; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.25rem, 5.1vw, 4.35rem); line-height: 1.03; letter-spacing: -.055em; font-weight: 750; text-wrap: balance; hyphens: auto; overflow-wrap: anywhere; }
h2 { font-size: 1.22rem; letter-spacing: -.025em; line-height: 1.25; }
a { color: var(--accent-text); text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 4px; }
h1:focus { outline: 0; }
.shell { width: min(100% - 2.5rem, 1120px); margin-inline: auto; }
.site-header, .site-footer { background: var(--paper); }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; min-height: 76px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; font-size: 1.42rem; letter-spacing: -.05em; font-weight: 750; }
.brand img { border-radius: 11px; }
nav { display: flex; gap: .35rem; margin-inline-start: auto; }
nav a { min-height: 44px; display: flex; align-items: center; border-radius: 13px; padding: .45rem .9rem; text-decoration: none; color: var(--muted); font-weight: 620; font-size: .91rem; }
nav a:hover, nav a[aria-current="page"] { background: var(--primary-light); color: var(--ink); }
.language-control { position: relative; flex: 0 0 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); }
.language-control:hover { background: var(--primary-light); }
.language-control:has(:focus-visible) { outline: 3px solid var(--accent-text); outline-offset: 4px; }
#site-language { position: absolute; inset: 0; height: 100%; min-height: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer; }

.hero { padding-block: clamp(2.25rem, 7vw, 5.5rem) clamp(1.75rem, 4vw, 3rem); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.lead { font-size: clamp(1.02rem, 1.65vw, 1.18rem); color: var(--muted); max-width: 43ch; margin-top: 1.2rem; }
.hero-image { width: 100%; height: auto; display: block; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 10px 34px var(--shadow); }
.store-links { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.6rem; }
.store-links .button { min-width: 132px; gap: .55rem; padding-inline: .75rem; }
.store-links svg { flex: none; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; border: 1px solid var(--primary); border-radius: 13px; padding: .75rem 1.05rem; font-weight: 670; line-height: 1.2; text-align: center; text-decoration: none; box-shadow: 0 2px 2px var(--shadow); }
.button.primary { background: var(--primary); color: var(--on-primary); }
@media (prefers-color-scheme: light) {
  .button.primary { background: var(--accent-text); border-color: var(--accent-text); }
}
.button.secondary { background: var(--paper); color: var(--accent-text); }
.button[aria-disabled="true"], .button:disabled { color: var(--muted); background: var(--paper); border-color: var(--line); box-shadow: none; cursor: default; }
.button:not(:disabled, [aria-disabled="true"]):hover { box-shadow: 0 4px 10px var(--shadow); }
.wide { width: 100%; }
.note { color: var(--muted); margin-top: .65rem; font-size: .88rem; }
.card { padding: clamp(1.1rem, 3vw, 1.6rem); border: 1px solid var(--line); border-radius: 16px; background: var(--paper); min-width: 0; }
.card > p, .login-card h2 + p { margin-top: .5rem; color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .95rem; padding-bottom: 3.5rem; }
.feature-mark { display: block; width: 2.4rem; height: 5px; border-radius: 4px; margin-bottom: .95rem; background: var(--primary); }
.feature-mark.water { background: var(--water); }
.feature-mark.recipes { background: var(--carbs); }

.page-intro { padding-block: clamp(2.25rem, 6vw, 4.5rem) 1.7rem; }
.page-intro h1 { font-size: clamp(2.25rem, 4vw, 3.4rem); }
.page-intro .lead { margin-top: .65rem; max-width: none; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .95rem; padding-bottom: 3.5rem; }
.plan-card { background: var(--card); }
.contact-card { width: min(100%, 580px); margin-bottom: 3.5rem; }
form { margin-top: 1.1rem; }
form > label, .field > label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
input:not([type="radio"], [type="checkbox"]), select, textarea { width: 100%; min-height: 50px; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; color: var(--ink); padding: .7rem .8rem; }
textarea { resize: vertical; }
select, .field { margin-bottom: .9rem; }
#email + .field, #password-field { margin-top: .9rem; }
form .wide { margin-top: .95rem; }
fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
legend { font-size: .89rem; font-weight: 600; margin-bottom: .35rem; }
.plan { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .6rem; min-height: 57px; margin-bottom: .5rem; padding: .65rem .8rem; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; cursor: pointer; }
.plan:has(:checked) { border-color: var(--primary); }
.plan span { font-weight: 620; }
.plan strong { white-space: nowrap; }
.plan small { display: block; color: var(--accent-text); font-size: .8rem; font-weight: 570; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent-text); inline-size: 1.05rem; block-size: 1.05rem; margin: 0; }
.consent { display: flex; gap: .65rem; align-items: baseline; margin-top: .85rem; font-size: .9rem; }
.consent input { flex-shrink: 0; align-self: start; margin-top: .25rem; }
.auth-links { display: flex; gap: .35rem 1rem; flex-wrap: wrap; margin-top: .25rem; }
.text-button { color: var(--accent-text); border: 0; background: transparent; padding: .45rem 0; min-height: 44px; font-weight: 610; text-align: start; text-decoration: underline; text-underline-offset: .2em; }
.account-state { margin-block: .85rem; padding: .7rem .85rem; border-radius: 12px; background: var(--card); }
#user-email { overflow-wrap: anywhere; }
.status { font-size: .88rem; color: var(--muted); margin-top: .65rem; }
.status:empty { display: none; }
.status[data-error="true"] { color: var(--error); }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 66px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .25rem .9rem; padding-block: .8rem; color: var(--muted); font-size: .87rem; }

@media (max-width: 780px) {
  .hero { gap: 1.4rem; }
  .features { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .header-inner { flex-wrap: wrap; align-content: center; padding-top: .8rem; gap: .45rem; }
  .language-control { margin-inline-start: auto; }
  nav { order: 1; flex: 1 0 100%; gap: .15rem; justify-content: space-between; padding-bottom: .45rem; }
  nav a { padding-inline: clamp(.35rem, 2vw, .8rem); font-size: clamp(.76rem, 3.4vw, .92rem); }
  .hero, .account-grid, .features { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { max-width: 460px; }
}
