/* ==========================================================================
   AlkaWater design layer  (aw-*)
   Loaded after Bootstrap 4.4.1 + legacy CSS. New components use the aw- prefix;
   the small "legacy polish" section at the bottom restyles shared pieces
   (messages, form controls, buttons) site-wide without touching their markup.
   ========================================================================== */

:root {
  --aw-ink: #13263f;
  --aw-navy: #1d3557;
  --aw-blue: #2996cc;
  --aw-blue-dark: #1f7fb0;
  --aw-blue-wash: #e6f2f9;
  --aw-paper: #f5f3ee;
  --aw-card: #ffffff;
  --aw-line: #dcd7cc;
  --aw-line-strong: #b9b2a3;
  --aw-mute: #5b6675;
  --aw-ok: #2f7d4f;
  --aw-ok-wash: #e8f3ec;
  --aw-warn: #9a5a12;
  --aw-warn-wash: #fbf1e2;
  --aw-err: #b23a3a;
  --aw-err-wash: #fbeaea;
  --aw-sans: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --aw-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --aw-radius: 4px;
  --aw-focus: 0 0 0 3px rgba(41, 150, 204, .35);
}

/* ---------- Primitives ---------- */
.aw-eyebrow {
  font-family: var(--aw-mono);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--aw-mute);
  margin: 0 0 .5rem;
}
.aw-num { font-family: var(--aw-mono); font-variant-numeric: tabular-nums; }
.aw-muted { color: var(--aw-mute); }
.aw-h1 { font-family: var(--aw-sans); font-weight: 600; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); line-height: 1.15; letter-spacing: -.01em; color: var(--aw-ink); margin: 0 0 .75rem; }
.aw-h2 { font-family: var(--aw-sans); font-weight: 600; font-size: 1.35rem; line-height: 1.25; color: var(--aw-ink); margin: 0 0 .5rem; }
.aw-lede { font-size: 1.05rem; line-height: 1.55; color: var(--aw-mute); margin: 0 0 1.5rem; max-width: 34rem; }

/* ---------- Auth layout ---------- */
.aw-auth {
  font-family: var(--aw-sans);
  color: var(--aw-ink);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  min-height: min(720px, calc(100vh - 140px));
  background: var(--aw-paper);
  border-top: 1px solid var(--aw-line);
  border-bottom: 1px solid var(--aw-line);
}
.aw-auth__aside {
  background: var(--aw-navy);
  color: #dfe7f1;
  padding: clamp(2rem, 4vw, 4rem) clamp(1.25rem, 4vw, 3.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}
/* a single waterline across the bottom of the panel — the only ornament */
.aw-auth__aside::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 6px;
  background: var(--aw-blue);
}
.aw-auth__aside .aw-eyebrow { color: #9fb3c8; }
.aw-auth__aside h2 { color: #fff; font-size: 1.5rem; font-weight: 600; line-height: 1.25; margin: 0; }
.aw-auth__aside p { margin: 0; line-height: 1.6; color: #c9d5e2; }
.aw-auth__aside a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.aw-tips { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(255,255,255,.14); }
.aw-tips li {
  display: grid; grid-template-columns: 2.25rem 1fr; gap: .25rem;
  padding: .9rem 0; border-bottom: 1px solid rgba(255,255,255,.14);
  line-height: 1.5; color: #dfe7f1; font-size: .95rem;
}
.aw-tips li > span:first-child { font-family: var(--aw-mono); color: var(--aw-blue); font-size: .8rem; padding-top: .15rem; }
.aw-tips strong { color: #fff; font-weight: 600; }

.aw-auth__main {
  display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1rem, 4vw, 3rem);
}
.aw-auth__panel { width: 100%; max-width: 30rem; }

@media (max-width: 860px) {
  .aw-auth { grid-template-columns: 1fr; min-height: 0; }
  .aw-auth__main { order: 1; }
  .aw-auth__aside { order: 2; }
}

/* Escape Bootstrap's .container/.row so the auth band runs full width */
.aw-bleed { width: 100%; margin-left: 0; margin-right: 0; }

/* ---------- Steps (reset flow) ---------- */
.aw-steps {
  display: flex; gap: 0; list-style: none; padding: 0; margin: 0 0 2rem;
  font-family: var(--aw-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase;
  border-bottom: 1px solid var(--aw-line);
}
.aw-steps li {
  flex: 1; padding: 0 0 .7rem; color: var(--aw-mute);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.aw-steps li b { font-weight: 500; color: var(--aw-line-strong); margin-right: .35rem; }
.aw-steps li.is-done { color: var(--aw-ink); }
.aw-steps li.is-done b { color: var(--aw-ok); }
.aw-steps li.is-current { color: var(--aw-ink); border-bottom-color: var(--aw-blue); }
.aw-steps li.is-current b { color: var(--aw-blue); }

/* ---------- Forms ---------- */
.aw-form { display: grid; gap: 1.15rem; }
.aw-field { display: grid; gap: .4rem; }
.aw-field > label, .aw-label {
  font-weight: 600; font-size: .92rem; color: var(--aw-ink); margin: 0;
}
.aw-field .aw-hint, .aw-field .helptext { font-size: .85rem; color: var(--aw-mute); line-height: 1.45; }
.aw-field .aw-hint a { color: var(--aw-blue-dark); }
.aw-input, .aw-form input[type=text], .aw-form input[type=email], .aw-form input[type=password],
.aw-form input[type=tel], .aw-form input[type=number] {
  display: block; width: 100%;
  height: 3rem; padding: 0 .9rem;
  font: 400 1rem/1 var(--aw-sans); color: var(--aw-ink);
  background: var(--aw-card);
  border: 1px solid var(--aw-line-strong); border-radius: var(--aw-radius);
  box-shadow: none; transition: border-color .15s, box-shadow .15s;
}
.aw-form input:focus { outline: none; border-color: var(--aw-blue); box-shadow: var(--aw-focus); }
.aw-field.has-error input { border-color: var(--aw-err); }
.aw-errors { list-style: none; margin: 0; padding: 0; color: var(--aw-err); font-size: .88rem; line-height: 1.45; }
.aw-errors a { color: var(--aw-err); text-decoration: underline; }
.aw-field .errorlist { list-style: none; margin: 0; padding: 0; color: var(--aw-err); font-size: .88rem; }

.aw-password { position: relative; }
.aw-password input { padding-right: 4.75rem; }
.aw-password__toggle {
  position: absolute; top: .45rem; right: .45rem; height: 2.1rem; padding: 0 .7rem;
  font: 500 .78rem var(--aw-mono); text-transform: uppercase; letter-spacing: .06em;
  color: var(--aw-navy); background: var(--aw-paper);
  border: 1px solid var(--aw-line); border-radius: 3px; cursor: pointer;
}
.aw-password__toggle:focus { outline: none; box-shadow: var(--aw-focus); }

.aw-check { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; line-height: 1.45; }
.aw-check input { width: 1.1rem; height: 1.1rem; margin-top: .15rem; accent-color: var(--aw-navy); flex: none; }
.aw-check label { margin: 0; font-weight: 400; }

.aw-meter { height: 4px; background: var(--aw-line); border-radius: 2px; overflow: hidden; margin-top: .1rem; }
.aw-meter > i { display: block; height: 100%; width: 0; background: var(--aw-err); transition: width .2s, background .2s; }
.aw-meter[data-score="2"] > i { background: var(--aw-warn); }
.aw-meter[data-score="3"] > i, .aw-meter[data-score="4"] > i { background: var(--aw-ok); }

/* ---------- Buttons ---------- */
.aw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 3rem; padding: 0 1.4rem;
  font: 600 1rem var(--aw-sans); letter-spacing: .005em;
  color: #fff; background: var(--aw-navy);
  border: 1px solid var(--aw-navy); border-radius: var(--aw-radius);
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s;
}
.aw-btn:hover, .aw-btn:focus { background: var(--aw-ink); border-color: var(--aw-ink); color: #fff; text-decoration: none; }
.aw-btn:focus { outline: none; box-shadow: var(--aw-focus); }
.aw-btn:disabled { opacity: .45; cursor: not-allowed; }
.aw-btn--block { width: 100%; }
.aw-btn--ghost { background: transparent; color: var(--aw-navy); border-color: var(--aw-line-strong); }
.aw-btn--ghost:hover, .aw-btn--ghost:focus { background: var(--aw-card); color: var(--aw-ink); border-color: var(--aw-navy); }
.aw-link { color: var(--aw-blue-dark); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.aw-link:hover { color: var(--aw-navy); }

.aw-row { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; justify-content: space-between; }
.aw-divider { border: 0; border-top: 1px solid var(--aw-line); margin: .5rem 0; }

/* ---------- Notices ---------- */
.aw-note {
  border-left: 4px solid var(--aw-blue); background: var(--aw-blue-wash);
  padding: .9rem 1rem; border-radius: 0 var(--aw-radius) var(--aw-radius) 0;
  font-size: .95rem; line-height: 1.5; color: var(--aw-ink); margin: 0 0 1.25rem;
}
.aw-note--ok { border-color: var(--aw-ok); background: var(--aw-ok-wash); }
.aw-note--warn { border-color: var(--aw-warn); background: var(--aw-warn-wash); }
.aw-note--err { border-color: var(--aw-err); background: var(--aw-err-wash); }
.aw-note strong { font-weight: 600; }
.aw-note p { margin: 0; }
.aw-note p + p { margin-top: .4rem; }

.aw-checklist { list-style: none; padding: 0; margin: 0 0 1.5rem; border-top: 1px solid var(--aw-line); }
.aw-checklist li { padding: .8rem 0 .8rem 1.75rem; border-bottom: 1px solid var(--aw-line); position: relative; line-height: 1.5; }
.aw-checklist li::before { content: "—"; position: absolute; left: 0; color: var(--aw-blue); font-family: var(--aw-mono); }

/* ---------- Ledger (rewards / balances) ---------- */
.aw-ledger { font-family: var(--aw-sans); color: var(--aw-ink); border: 1px solid var(--aw-line); background: var(--aw-card); }
.aw-ledger__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; padding: 1.5rem; border-bottom: 1px dashed var(--aw-line-strong); }
.aw-ledger__big { font-family: var(--aw-mono); font-size: clamp(2.2rem, 1.6rem + 2.5vw, 3.25rem); font-weight: 500; line-height: 1; letter-spacing: -.02em; }
.aw-ledger__row { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 1.5rem; border-bottom: 1px solid var(--aw-line); }
.aw-ledger__row:last-child { border-bottom: 0; }

/* ==========================================================================
   Legacy polish — applies site-wide, markup unchanged
   ========================================================================== */
body { font-family: var(--aw-sans); color: var(--aw-ink); -webkit-font-smoothing: antialiased; }

/* Flash messages (templates/message.html) */
.aw-flash { margin: 1rem 0 0; }
.aw-flash .alert {
  font-family: var(--aw-sans); font-size: .95rem; line-height: 1.5;
  border: 0; border-left: 4px solid currentColor; border-radius: 0 var(--aw-radius) var(--aw-radius) 0;
  padding: .85rem 3rem .85rem 1rem; margin-bottom: .5rem;
}
.aw-flash .alert-success { color: var(--aw-ok); background: var(--aw-ok-wash); }
.aw-flash .alert-info { color: var(--aw-blue-dark); background: var(--aw-blue-wash); }
.aw-flash .alert-warning { color: var(--aw-warn); background: var(--aw-warn-wash); }
.aw-flash .alert-danger { color: var(--aw-err); background: var(--aw-err-wash); }
.aw-flash .alert > span { color: var(--aw-ink); }
.aw-flash .close { font-weight: 400; opacity: .6; text-shadow: none; }

.form-control:focus { border-color: var(--aw-blue); box-shadow: var(--aw-focus); }
.g-recaptcha { transform-origin: 0 0; }
@media (max-width: 360px) { .g-recaptcha { transform: scale(.88); } }

/* Legacy style.css styles bare <p>/<li> with another font and size; keep aw components consistent. */
.aw-auth p, .aw-auth li, .aw-auth label, .aw-auth input, .aw-auth button,
.aw-ledger p, .aw-ledger li { font-family: var(--aw-sans); }
.aw-auth p { font-size: 1rem; }
.aw-auth .aw-lede { font-size: 1.05rem; }
.aw-auth .aw-eyebrow { font-family: var(--aw-mono); font-size: .75rem; }
.aw-auth__aside > p { font-size: .95rem; }
.aw-auth .aw-checklist li { font-size: .95rem; }

/* ==========================================================================
   Home · hydration section (templates/home/_hydration.html)
   ========================================================================== */
.aw-hydro { font-family: var(--aw-sans); color: var(--aw-ink); background: var(--aw-paper);
  border-top: 1px solid var(--aw-line); border-bottom: 1px solid var(--aw-line); margin: 2.5rem 0; }
.aw-hydro p, .aw-hydro li, .aw-hydro dt, .aw-hydro dd, .aw-hydro summary { font-family: var(--aw-sans); }
.aw-hydro__wrap { max-width: 72rem; margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) 1rem; display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
.aw-hydro__intro .aw-lede { max-width: 44rem; }
.aw-hydro__grid { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 860px) { .aw-hydro__grid { grid-template-columns: 1fr; } }

/* Facts panel: the label format people already read on every bottle */
.aw-facts { background: #fff; border: 2px solid var(--aw-ink); padding: .75rem .9rem .9rem; color: var(--aw-ink); }
.aw-facts__title { font: 800 1.9rem/1 var(--aw-sans); letter-spacing: -.02em; margin: 0; color: var(--aw-ink); }
.aw-facts__sub { font-size: .85rem !important; margin: .3rem 0 0; color: var(--aw-ink); }
.aw-facts__rule { height: 10px; background: var(--aw-ink); margin: .5rem 0 .25rem; }
.aw-facts__rule--thin { height: 4px; }
.aw-facts dl { margin: 0; }
.aw-facts__row { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: .4rem 0; border-bottom: 1px solid var(--aw-ink); }
.aw-facts__row dt { font-weight: 600; font-size: .95rem; margin: 0; }
.aw-facts__row dd { margin: 0; font-weight: 500; text-align: right; white-space: nowrap; }
.aw-facts__row dd small { display: block; font-size: .72rem; color: var(--aw-mute); }
.aw-facts__row--big dt { font-size: 1.05rem; font-weight: 800; }
.aw-facts__row--big dd { font-size: 1.4rem; font-weight: 600; }
.aw-facts__row--sub dt { font-weight: 400; padding-left: 1rem; }
.aw-facts__foot { font-size: .78rem !important; line-height: 1.45; margin: .4rem 0 0; color: var(--aw-ink); }

.aw-uses { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; }
.aw-uses li { padding: .9rem 0; border-top: 1px solid var(--aw-line); line-height: 1.55; font-size: .98rem; }
.aw-uses strong { display: block; color: var(--aw-navy); font-weight: 600; }
@media (max-width: 600px) { .aw-uses { grid-template-columns: 1fr; } }

.aw-hydro__desert { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem);
  background: var(--aw-navy); color: #dfe7f1; padding: clamp(1.5rem, 4vw, 2.75rem); position: relative; }
.aw-hydro__desert::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--aw-blue); }
.aw-hydro__desert .aw-h2 { color: #fff; }
.aw-hydro__desert .aw-eyebrow { color: #9fb3c8; }
.aw-hydro__desert p { color: #c9d5e2; line-height: 1.65; margin: 0; font-size: 1rem; }
.aw-hydro .aw-lede { font-size: 1.05rem; }
.aw-hydro .aw-uses li, .aw-hydro .aw-checklist li { font-size: .98rem; }
.aw-tipsrow { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(255,255,255,.16); }
.aw-tipsrow li { display: grid; grid-template-columns: 2.25rem 1fr; padding: .85rem 0; border-bottom: 1px solid rgba(255,255,255,.16); line-height: 1.5; color: #eef3f8; }
.aw-tipsrow .aw-num { color: var(--aw-blue); font-size: .8rem; padding-top: .15rem; }
@media (max-width: 860px) { .aw-hydro__desert { grid-template-columns: 1fr; } }

.aw-hydro__signs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.aw-hydro__signs .aw-checklist li { font-size: .98rem; }
@media (max-width: 760px) { .aw-hydro__signs { grid-template-columns: 1fr; } }
.aw-urine { margin: 0; background: #fff; border: 1px solid var(--aw-line); padding: 1rem; }
.aw-urine ol { list-style: none; margin: .75rem 0; padding: 0; display: grid; gap: 3px; }
.aw-urine li { display: grid; grid-template-columns: 2.5rem 1fr; align-items: center; gap: .75rem; font-size: .9rem; }
.aw-urine li::before { content: ""; height: 1.6rem; background: var(--c); border: 1px solid rgba(0,0,0,.08); }
.aw-urine .aw-muted { font-size: .82rem; margin: 0; }

.aw-hydro__faq details { border-top: 1px solid var(--aw-line); }
.aw-hydro__faq details:last-of-type { border-bottom: 1px solid var(--aw-line); }
.aw-hydro__faq summary { cursor: pointer; list-style: none; padding: 1rem 2rem 1rem 0; font-weight: 600; font-size: 1.02rem; position: relative; }
.aw-hydro__faq summary::-webkit-details-marker { display: none; }
.aw-hydro__faq summary::after { content: "+"; position: absolute; right: .25rem; top: .8rem; font: 400 1.4rem var(--aw-mono); color: var(--aw-blue-dark); }
.aw-hydro__faq details[open] summary::after { content: "–"; }
.aw-hydro__faq summary:focus { outline: none; box-shadow: var(--aw-focus); }
.aw-hydro__faq details p { margin: 0 0 1.1rem; max-width: 46rem; line-height: 1.65; color: var(--aw-ink); }

.aw-hydro__sources { border-top: 1px dashed var(--aw-line-strong); padding-top: 1rem; font-size: .85rem; }
.aw-hydro__sources ol { margin: .4rem 0 .6rem; padding-left: 1.2rem; columns: 2; column-gap: 2rem; }
.aw-hydro__sources li { font-size: .85rem; margin-bottom: .3rem; break-inside: avoid; }
.aw-hydro__sources a { color: var(--aw-blue-dark); }
@media (max-width: 600px) { .aw-hydro__sources ol { columns: 1; } }
.aw-hydro { flex: 0 0 100%; max-width: 100%; }
.aw-hydro .aw-tipsrow li { font-size: .98rem; }
