:root {
  color-scheme: light;
  --auth-paper: #f7f6f2;
  --auth-ink: #202721;
  --auth-muted: #69716b;
  --auth-green: #28634b;
  --auth-green-dark: #1e4e3a;
  --auth-line: #dcded6;
  --auth-error: #a3332b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--auth-paper); scroll-padding: 28px; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--auth-ink);
  background: var(--auth-paper);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
button, input, textarea { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button, a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid #82ae97;
  outline-offset: 3px;
}
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-header {
  width: min(100%, 600px);
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 14px;
}
.auth-back { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; text-decoration: none; }
.auth-back:hover { background: #eaece5; }
.customer-brand { margin: 0; display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 650; letter-spacing: -.15px; }
.auth-brand-mark { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; background: var(--auth-green); color: #fff; font-size: 15px; font-weight: 600; }
.customer-login-card {
  width: min(100%, 456px);
  margin: 0 auto;
  padding: clamp(30px, 7vh, 70px) max(24px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}
.auth-heading { margin-bottom: 26px; }
.auth-eyebrow { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--auth-green); }
h1 { margin: 0; font-size: clamp(28px, 7vw, 34px); font-weight: 650; letter-spacing: -.8px; line-height: 1.25; overflow-wrap: anywhere; }
#customer-intro { margin: 12px 0 0; color: var(--auth-muted); font-size: 14px; line-height: 1.65; }
.customer-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 28px; background: #eaece5; border-radius: 14px; }
.customer-tabs button { min-height: 44px; flex: 1; padding: 10px 12px; background: transparent; border: 0; border-radius: 10px; color: var(--auth-muted); font-size: 14px; font-weight: 600; }
.customer-tabs button[aria-pressed="true"] { background: #fff; color: var(--auth-ink); box-shadow: 0 1px 4px #2027210a; }
#customer-login-form { display: flex; flex-direction: column; gap: 20px; }
.auth-field { min-width: 0; }
.auth-field > label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.auth-field > input {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 13px 15px;
  color: var(--auth-ink);
  background: #fff;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.5;
  scroll-margin-block: 30px;
}
.auth-field > input:focus { border-color: var(--auth-green); }
.auth-field > input[aria-invalid="true"] { border-color: var(--auth-error); background: #fffafa; }
.customer-hint { margin: 7px 0 0; color: var(--auth-muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.auth-field-error { margin: 7px 0 0; font-size: 13px; line-height: 1.5; color: var(--auth-error); }
.password-visibility { display: flex; align-items: center; gap: 9px; min-height: 44px; width: fit-content; max-width: 100%; margin: -9px 0 -12px; font-size: 13px; cursor: pointer; }
.password-visibility input { width: 18px; height: 18px; margin: 0; accent-color: var(--auth-green); flex: 0 0 auto; }
#customer-message { margin: 0; color: var(--auth-error); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
#customer-message:empty { display: none; }
#customer-message.is-working { color: var(--auth-muted); }
.auth-primary { width: 100%; min-height: 54px; padding: 14px 18px; border: 0; border-radius: 13px; color: #fff; background: var(--auth-green); font-weight: 600; font-size: 16px; }
.auth-primary:hover:not(:disabled) { background: var(--auth-green-dark); }
.customer-other-actions { display: flex; flex-direction: column; align-items: center; margin-top: 15px; }
.customer-other-actions button { min-height: 44px; padding: 10px 14px; border: 0; background: transparent; color: var(--auth-green); font-size: 14px; }
.customer-other-actions button:hover { text-decoration: underline; text-underline-offset: 4px; }
.auth-success-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #e3eee5; color: var(--auth-green); }
@media (max-width: 350px) {
  .customer-login-card { padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
  .auth-header { gap: 6px; }
  .customer-brand { font-size: 12px; gap: 7px; }
}
@media (max-height: 600px) {
  .customer-login-card { padding-top: 24px; }
  .auth-heading { margin-bottom: 20px; }
  .customer-tabs { margin-bottom: 22px; }
}

/* Email account flows use the same layout and touch targets as the sign-in form. */
#customer-message:not(:empty), .auth-status { margin: 0 0 18px; }
.auth-status { color: var(--auth-green); font-size: 14px; line-height: 1.6; }
.auth-code-destination { margin: 0 0 20px; color: var(--auth-muted); font-size: 14px; overflow-wrap: anywhere; }
#customer-code { font-variant-numeric: tabular-nums; letter-spacing: .25em; font-size: 22px; }
.auth-result { padding-top: 4px; }
.auth-result h2 { margin: 18px 0 12px; font-size: 22px; line-height: 1.4; letter-spacing: -.4px; }
.auth-result p { color: var(--auth-muted); font-size: 14px; line-height: 1.65; }
#auth-bound-email { padding: 15px; margin: 20px 0; border: 1px solid var(--auth-line); border-radius: 12px; background: #fff; color: var(--auth-ink); font-size: 16px; overflow-wrap: anywhere; }
#auth-result-home { display: block; margin-top: 24px; text-align: center; text-decoration: none; }
