/* Sign-in, invite sign-up, forgot / reset password and state screens.
   Source: docs/design/mockups/auth-onboarding-v2.html (approved). */

.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
}
.auth-main {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(var(--sp-2), env(safe-area-inset-top)) var(--gutter) max(var(--sp-4), env(safe-area-inset-bottom));
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}
.auth-main.scrolls { padding-top: max(var(--sp-5), env(safe-area-inset-top)); }
.auth-form { flex: 1; display: flex; flex-direction: column; }
.auth .foot { margin-top: auto; padding-top: var(--sp-5); display: flex; flex-direction: column; }

/* ---------- type ---------- */
.large { font-family: var(--font-display); font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .2px; margin: var(--sp-1) 0 0; }
.title2 { font-family: var(--font-display); font-size: 28px; line-height: 34px; font-weight: 700; margin: var(--sp-4) 0 0; text-wrap: balance; }
.body { font-size: 17px; line-height: 24px; color: var(--t-body); margin-top: var(--sp-2); text-wrap: pretty; }
.body b { color: var(--t1); }
.body.lead { margin-bottom: var(--sp-5); }
.sub { font-size: 13px; line-height: 18px; color: var(--t2); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- brand ---------- */
.auth-brand { display: flex; flex-direction: column; align-items: center; margin: var(--sp-8) 0 28px; text-align: center; }
.logo {
  width: 80px; height: 80px; border-radius: 22px; background: var(--s1);
  display: grid; place-items: center;
  box-shadow: 0 0 0 1px var(--sep), 0 8px 24px rgba(63, 213, 182, .12);
}
.logo-ring { width: 48px; height: 48px; display: block; }
.lr-track { stroke: var(--track); }
.lr-fast { stroke: var(--teal); }
.lr-eat { stroke: var(--amber); }
.auth-brand .word { font-family: var(--font-display); font-size: 28px; line-height: 34px; font-weight: 700; margin-top: var(--sp-4); letter-spacing: -.2px; }
.auth-brand .sub { font-size: 15px; line-height: 20px; margin-top: var(--sp-1); }
.new-here { margin-top: 14px; }

/* ---------- buttons (mockup recipes) ---------- */
button { font: inherit; color: inherit; }
button.btn, a.btn { border: 0; }
.auth .btn, .shell .btn { width: 100%; display: flex; padding: 0 var(--sp-5); }
.btn.secondary { background: var(--s2); color: var(--t1); border: 1px solid var(--s3); }
.btn.plain { background: none; color: var(--t1); margin-top: var(--sp-3); }
.btn.text { min-height: var(--tap-min); background: none; color: var(--t2); font-size: 15px; margin-top: var(--sp-2); }
.btn.text.teal { color: var(--teal); }
.btn + .btn.secondary { margin-top: var(--sp-3); }
/* System rule: disabled = s2 fill, s3 border, t3 label; aria-disabled keeps focus. */
.btn[aria-disabled="true"] { background: var(--s2); color: var(--t3); border: 1px solid var(--s3); cursor: not-allowed; }
.btn[aria-busy="true"] { filter: brightness(.85); cursor: progress; }
button:focus-visible, input:focus-visible, .linkbtn:focus-visible, .tab:focus-visible {
  outline: 2px solid var(--teal); outline-offset: 3px;
}
.linkbtn {
  min-height: var(--tap-min);
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--teal); font-size: 15px; font-weight: 600; text-decoration: none;
  border-radius: var(--r-tile);
}
.row2 { display: flex; justify-content: flex-end; margin: 2px -4px 0; }

/* ---------- fields ---------- */
.field { margin-top: var(--sp-4); }
.flabel { display: block; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--t2); margin: 0 4px 6px; }
.input {
  min-height: var(--tap-primary);
  display: flex; align-items: center; gap: 10px;
  padding: 0 4px 0 var(--sp-4);
  border-radius: 14px; background: var(--s1); border: 1px solid var(--s3);
  transition: border-color var(--press), box-shadow var(--press);
}
.input .v {
  flex: 1; min-width: 0; min-height: 50px;
  background: none; border: 0; outline: none; padding: 0;
  color: var(--t1); font: inherit; font-size: 17px;
}
.input .v::placeholder { color: var(--t3); }
.input .v:focus-visible { outline: none; }
.input:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-tint); }
.input.err { border-color: var(--red); }
.input.err:focus-within { box-shadow: 0 0 0 3px var(--red-tint); }
.input.dis { opacity: .5; }
.input:has(.eye) { padding-right: 4px; }
.eye {
  width: var(--tap-min); height: var(--tap-min); flex: none;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: var(--r-tile);
  color: var(--t2); cursor: pointer;
}
.eye.on { color: var(--teal); }
.hint { font-size: 13px; line-height: 18px; color: var(--t2); margin: 6px 4px 0; display: flex; gap: 6px; align-items: flex-start; }
.hint b { color: var(--t1); }
.hint b.strong { color: var(--teal); }
.hint.err { color: var(--red); }
.hint .ic { margin-top: 1px; }
.hint .inl {
  color: var(--teal); font-weight: 600; text-decoration: none;
  min-height: var(--tap-min); display: inline-flex; align-items: center; margin: -13px 0;
}
.strength { display: flex; gap: 4px; margin: var(--sp-2) 4px 0; }
.strength i { flex: 1; height: 4px; border-radius: 2px; background: var(--s3); }
.strength i.on { background: var(--teal); }

/* ---------- banners and alerts (neutral v5 banner; red only for errors) ---------- */
.banner {
  display: grid; grid-template-columns: auto 1fr; gap: 0 var(--sp-3); align-items: start;
  padding: 14px var(--sp-4) var(--sp-4);
  border-radius: 16px; background: var(--s2); border: 1px solid var(--s3);
  margin-bottom: var(--sp-4);
}
.banner > .ic { margin-top: 1px; color: var(--t1); }
.banner.ok > .ic { color: var(--teal); }
.banner .t { font-size: 13px; line-height: 18px; color: var(--t2); }
.banner .t > b { display: block; font-size: 15px; line-height: 20px; color: var(--t1); font-weight: 600; margin-bottom: 2px; }
.banner .t b.inline { display: inline; font-size: 13px; line-height: 18px; color: var(--t1); }
.banner ul { margin: var(--sp-2) 0 0; padding: 0 0 0 var(--sp-4); display: grid; gap: 6px; }
.banner li::marker { color: var(--t3); }
.banner .full { grid-column: 1 / -1; }
.alert {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: 14px var(--sp-4); border-radius: 16px; margin-bottom: var(--sp-4);
  font-size: 15px; line-height: 20px;
}
.alert b { display: block; font-weight: 600; }
.alert .sub { margin-top: 2px; color: var(--t-body); font-size: 13px; }
.alert.err { background: var(--red-tint); border: 1px solid var(--red-line); }
.alert.err > .ic { color: var(--red); }

/* ---------- invite sign-up ---------- */
.invite-card {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) 14px; border-radius: 16px; background: var(--s1);
  margin: var(--sp-3) 0 var(--sp-1);
}
.invite-text { font-size: 15px; line-height: 20px; color: var(--t-body); }
.invite-text b { color: var(--t1); }
.av {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: #2B4F48; color: var(--teal);
  display: grid; place-items: center;
}
.segctl { display: flex; background: var(--s2); border-radius: var(--r-tile); padding: 4px; gap: 2px; min-height: var(--tap-min); }
.segctl button {
  flex: 1; min-height: 36px; border-radius: 9px; border: 0; background: none;
  text-align: center; font-size: 15px; font-weight: 500; color: var(--t2);
  padding: 0 4px; cursor: pointer;
}
.segctl button[aria-checked="true"] {
  background: var(--s3); color: var(--t1); font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4), inset 0 0 0 .5px rgba(255, 255, 255, .08);
}
.tz {
  display: flex; align-items: center; gap: 10px;
  min-height: var(--tap-primary); padding: 0 4px 0 var(--sp-4);
  border-radius: 14px; background: var(--s1);
}
.tz > .ic { color: var(--t2); }
.tz .v { flex: 1; min-width: 0; font-size: 17px; overflow-wrap: anywhere; }
.tz .v small { display: block; font-size: 13px; color: var(--t2); }
.tz .chg {
  min-height: var(--tap-min); padding: 0 var(--sp-3);
  background: none; border: 0; border-radius: var(--r-tile);
  color: var(--teal); font-weight: 600; cursor: pointer;
}
.privacy { margin: var(--sp-5) 0 0; }
.privacy .lnk { grid-column: 2; margin: 6px 0 -6px; justify-self: start; }
.chkrow {
  grid-column: 1 / -1;
  display: flex; gap: var(--sp-3); align-items: center;
  min-height: var(--tap-primary); width: 100%;
  margin: 10px 0 -6px; padding: 6px 0 0;
  background: none; border: 0; border-top: 1px solid var(--sep);
  font-size: 15px; line-height: 20px; font-weight: 600; color: var(--t1);
  text-align: left; cursor: pointer;
}
.chkrow:focus-visible { outline-offset: 2px; border-radius: 8px; }
.chk {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  border: 2px solid var(--t2);
  display: grid; place-items: center;
}
.chk.on { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); }
.chk.err { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
.chk .ic { width: 16px; height: 16px; stroke-width: 3; }
.privacy .hint.err { grid-column: 1 / -1; margin: 10px 0 0; }
.privacy .hint.err:empty { display: none; }

/* ---------- state screens (expired links, forgot password) ---------- */
.state-hero { display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: 88px; }
.state-hero.compact { margin-top: 56px; }
.state-hero .body { max-width: 330px; }
.heroic {
  width: 80px; height: 80px; border-radius: 24px;
  display: grid; place-items: center;
  background: var(--s1); box-shadow: inset 0 0 0 1px var(--sep); color: var(--t2);
}
.heroic.teal { color: var(--teal); }
.heroic .ic { width: 36px; height: 36px; stroke-width: 1.5; }
.factbox { margin-top: var(--sp-6); width: 100%; border-radius: 16px; background: var(--s1); padding: 4px var(--sp-4); text-align: left; }
.fact { display: flex; gap: var(--sp-3); align-items: center; min-height: 48px; padding: 10px 0; font-size: 15px; line-height: 20px; color: var(--t-body); }
.fact + .fact { border-top: 1px solid var(--sep); }
.fact .ic { color: var(--t2); }

/* ---------- sheet (native <dialog>) ---------- */
.sheet {
  width: 100%; max-width: 480px; max-height: 85dvh;
  margin: auto auto 0; padding: 0;
  border: 0; border-radius: 20px 20px 0 0;
  background: var(--s1); color: var(--t1);
}
.sheet::backdrop { background: rgba(0, 0, 0, .55); }
.sheet[open] { animation: sheet-up .28s var(--ease-out); }
@keyframes sheet-up { from { transform: translateY(40%); opacity: 0; } }
.sheet-panel { display: flex; flex-direction: column; max-height: 85dvh; padding: 0 var(--gutter) max(var(--sp-4), env(safe-area-inset-bottom)); }
.sheet-grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--s3); margin: var(--sp-2) auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.sheet-title { font-size: 17px; line-height: 22px; font-weight: 600; margin: 0; }
.sheet-done {
  min-height: var(--tap-min); padding: 0 var(--sp-2);
  background: none; border: 0; color: var(--teal); font-size: 17px; font-weight: 600; cursor: pointer;
}
.sheet-body { overflow-y: auto; overscroll-behavior: contain; }
.tz-search { margin-top: 0; }
.tzlist { list-style: none; margin: var(--sp-2) 0 0; padding: 0; }
.tzopt {
  width: 100%; min-height: var(--tap-min);
  display: flex; align-items: center;
  padding: 0 var(--sp-2); border: 0; border-radius: var(--r-tile);
  background: none; color: var(--t1); font-size: 17px; text-align: left; cursor: pointer;
}
.tzopt[aria-selected="true"] { color: var(--teal); font-weight: 600; }
.tzopt:active { background: var(--s2); }

/* ---------- toast ---------- */
.toast-host {
  position: fixed; left: 0; right: 0;
  bottom: calc(96px + env(safe-area-inset-bottom));
  display: flex; justify-content: center; pointer-events: none; z-index: 20;
  padding: 0 var(--gutter);
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-pill);
  background: var(--s2); border: 1px solid var(--s3);
  font-size: 15px; font-weight: 600; max-width: 100%;
  animation: fade .2s both;
}
.toast .ic { color: var(--teal); }
