.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 16% 10%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 29rem),
    var(--page-background);
}

.auth-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-main {
  width: calc(100% - 2rem);
  max-width: 520px;
  flex: 1;
  display: flex;
  align-items: center;
  margin: 0 auto;
  padding-block: clamp(2.5rem, 8vh, 6rem);
}

.auth-card {
  width: 100%;
  padding: clamp(1.5rem, 5vw, 2.6rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.auth-card__intro h1,
.auth-signed-in h2 {
  margin: 0;
  color: var(--heading);
  line-height: 1.15;
}

.auth-card__intro h1 { font-size: clamp(2rem, 7vw, 2.8rem); }
.auth-signed-in h2 { font-size: clamp(1.4rem, 5vw, 1.9rem); }

.auth-card__intro > p:last-child,
.auth-signed-in p,
.auth-support {
  color: var(--muted-text);
}

.auth-card__intro > p:last-child { margin: 0.6rem 0 0; }

.auth-eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent-dark) !important;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.auth-form {
  display: grid;
  gap: 1.15rem;
  margin-top: 2rem;
}

.auth-field { display: grid; gap: 0.42rem; }
.auth-field label { color: var(--heading); font-size: 0.9rem; font-weight: 750; }
.auth-field small { color: var(--muted-text); font-size: 0.76rem; line-height: 1.45; }
.auth-field input {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  outline: none;
  background: var(--surface);
  color: var(--page-text);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

.auth-submit { width: 100%; min-height: 48px; margin-top: 0.2rem; cursor: pointer; }
.auth-submit:disabled { opacity: 0.66; cursor: wait; transform: none; }

.auth-form-help {
  margin: -0.35rem 0 -0.1rem;
  font-size: 0.82rem;
  text-align: right;
}
.auth-form-help a { color: var(--accent-dark); font-weight: 750; }

.auth-notice {
  margin: 1.25rem 0 0;
  padding: 0.8rem 0.95rem;
  border: 1px solid #d9a2a2;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, #c43838 9%, var(--surface));
  color: #9f2525;
  font-size: 0.9rem;
}
.auth-notice[data-type="success"] {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-dark);
}
:root[data-theme="dark"] .auth-notice { color: #ffbcbc; }

.auth-account-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-soft);
}
.auth-account-help[hidden] { display: none; }
.auth-account-help p { margin: 0; color: var(--page-text); font-size: 0.86rem; font-weight: 700; }
.auth-account-help .button { min-height: 42px; padding: 0.55rem 0.8rem; }

.auth-providers { margin-top: 1.65rem; }
.auth-providers[hidden] { display: none; }
.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted-text);
  font-size: 0.76rem;
}
.auth-divider::before,
.auth-divider::after { height: 1px; content: ""; background: var(--line); }
.auth-provider-list { display: grid; gap: 0.65rem; margin-top: 1rem; }
.auth-provider-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--page-text);
  font: inherit;
  font-size: 0.87rem;
  font-weight: 720;
}
.auth-provider-button:disabled { cursor: not-allowed; opacity: 0.68; }
.auth-provider-badge {
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted-text);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}
.auth-provider-note,
.auth-provider-status {
  margin: 0.2rem 0 0;
  color: var(--muted-text);
  font-size: 0.76rem;
  line-height: 1.5;
}

.auth-signed-in {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem 1rem;
  margin-top: 2rem;
}
.auth-signed-in[hidden] { display: none; }
.auth-signed-in:focus { outline: none; }
.auth-signed-in p { margin: 0.45rem 0 0; }
.auth-success-mark {
  width: 2.3rem;
  height: 2.3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 900;
}
.auth-signed-in__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.65rem;
}
.auth-signed-in__actions .button { cursor: pointer; }

.auth-verification-notice {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  margin-top: 0.65rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-soft);
}
.auth-verification-notice[hidden] { display: none; }
.auth-verification-notice h3 { margin: 0; color: var(--heading); font-size: 1.08rem; }
.auth-verification-notice p:not(.auth-eyebrow) { margin: 0.35rem 0 0; font-size: 0.82rem; }
.auth-verification-notice strong { display: block; margin-top: 0.15rem; color: var(--heading); overflow-wrap: anywhere; }
.auth-verification-notice .button { min-height: 44px; cursor: pointer; }
.auth-verification-notice .button:disabled { opacity: 0.65; cursor: wait; }
.auth-verification-status {
  grid-column: 1 / -1;
  margin: 0 !important;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  color: #9f2525 !important;
}
.auth-verification-status[data-type="success"] { color: var(--accent-dark) !important; }
:root[data-theme="dark"] .auth-verification-status:not([data-type="success"]) { color: #ffbcbc !important; }

.auth-support {
  margin: 1.8rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}
.auth-support a { color: var(--accent-dark); font-weight: 750; }

.auth-mfa { margin-top: 1.75rem; }
.auth-mfa[hidden] { display: none; }
.auth-mfa:focus { outline: none; }
.auth-mfa h2 { margin: 0; color: var(--heading); font-size: clamp(1.4rem, 5vw, 1.9rem); line-height: 1.2; }
.auth-mfa > p:not(.auth-eyebrow) { margin: 0.55rem 0 0; color: var(--muted-text); font-size: 0.88rem; line-height: 1.55; }
.auth-mfa .auth-form { margin-top: 1.4rem; }
.auth-mfa .button-ghost { width: 100%; min-height: 46px; cursor: pointer; }
.auth-text-button {
  justify-self: center;
  padding: 0.35rem;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.auth-text-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 0.2rem; }

.auth-footer {
  width: min(var(--content-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
  color: var(--muted-text);
  font-size: 0.78rem;
  text-align: center;
}
.auth-footer p { margin: 0; }

@media (max-width: 560px) {
  .auth-header-actions .button { display: none; }
  .auth-main { align-items: start; padding-top: 2rem; }
  .auth-card { border-radius: var(--radius-md); }
  .auth-signed-in__actions { display: grid; }
  .auth-account-help { align-items: stretch; flex-direction: column; }
  .auth-account-help .button { width: 100%; }
  .auth-verification-notice { grid-template-columns: 1fr; }
  .auth-verification-notice .button { width: 100%; }
}

@media (forced-colors: active) {
  .auth-success-mark { border: 1px solid currentColor; }
}

/* Google light theme: official current G and Google Sans Medium. */
@font-face {
  font-family: 'CartSift Google Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/google-sans-medium.woff2') format('woff2');
}
.auth-provider-button--google {
  box-sizing: border-box;
  min-height: 50px;
  padding: 12px;
  gap: 10px;
  border: 1px solid #747775;
  border-radius: 4px;
  background: #fff;
  color: #1f1f1f;
  font-family: 'CartSift Google Sans', Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
  box-shadow: none;
  transition: box-shadow 150ms ease;
}
.auth-provider-button--google .auth-provider-label {
  flex: 1;
  padding-right: 30px;
  text-align: center;
}
.auth-google-icon {
  display: grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  background: #fff;
}
.auth-google-icon img { display: block; width: 20px; height: 20px; object-fit: contain; }
.auth-provider-button--google:hover:not(:disabled) { background: #fff; box-shadow: 0 1px 3px rgb(60 64 67 / 30%), 0 1px 2px rgb(60 64 67 / 15%); }
.auth-provider-button--google:active:not(:disabled) { background: #fff; box-shadow: inset 0 0 0 1px #747775; }
.auth-provider-button--google:focus-visible { outline: 3px solid #1a73e8; outline-offset: 3px; }
.auth-provider-button--google:disabled { cursor: wait; }
@media (prefers-reduced-motion: reduce) { .auth-provider-button--google { transition: none; } }
@media (forced-colors: active) { .auth-provider-button--google { border-color: ButtonText; } }

/* Official Meta secondary Facebook logo, unaltered, on Facebook Blue. */
.auth-provider-button--facebook {
  min-height: 50px;
  padding: 12px;
  gap: 12px;
  border: 1px solid #0866ff;
  border-radius: 6px;
  background: #0866ff;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 24px;
  cursor: pointer;
}
.auth-facebook-icon { display: block; flex: 0 0 24px; width: 24px; height: 24px; object-fit: contain; }
.auth-provider-button--facebook .auth-provider-label { flex: 1; padding-right: 36px; text-align: center; }
.auth-provider-button--facebook:hover:not(:disabled) { box-shadow: 0 0 0 1px #0866ff; }
.auth-provider-button--facebook:focus-visible { outline: 3px solid #0866ff; outline-offset: 3px; }
.auth-provider-button--facebook:disabled { cursor: wait; }
@media (forced-colors: active) { .auth-provider-button--facebook { border-color: ButtonText; } }


/* Official Apple left-aligned SVGs preserve their built-in padding. */
.auth-provider-button--apple {
  box-sizing: border-box;
  height: 50px;
  min-height: 50px;
  min-width: 140px;
  padding: 0 0 0 4px;
  gap: 0;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: #000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 21.5px;
  font-weight: 500;
  line-height: 1;
  overflow: hidden;
}
.auth-provider-button--apple:disabled { opacity: 1; cursor: not-allowed; }
.auth-apple-icon { display: block; flex: 0 0 auto; width: auto; height: 50px; }
.auth-apple-icon--white { display: none; }
.auth-provider-button--apple .auth-provider-label { flex: 1; text-align: center; margin-right: max(8%, 39.23px); white-space: nowrap; }
.auth-apple-status { display: block; margin-top: 5px; color: var(--muted-text); font-size: 0.76rem; line-height: 1.5; }
html[data-theme="light"] .auth-provider-button--apple { background: #000; color: #fff; }
html[data-theme="light"] .auth-apple-icon--black { display: none; }
html[data-theme="light"] .auth-apple-icon--white { display: block; }
.auth-provider-button--apple:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (forced-colors: active) { .auth-provider-button--apple { outline: 1px solid ButtonText; outline-offset: -1px; } }
