/* Authentication is scoped to this shared dialog; public-page styling stays intact. */
html.auth-modal-open { overflow: hidden; }
[data-auth-background] { display: contents; }
.auth-modal {
  box-sizing: border-box;
  width: min(576px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  border: 1px solid #f0f0f0;
  border-radius: 24px;
  background: #fff;
  color: #171717;
  font-family: Inter, system-ui, sans-serif;
  box-shadow: 0 24px 80px #191c1e38;
  overflow: auto;
  overscroll-behavior: contain;
}
.auth-modal[open]:not(.auth-modal-enhanced) { z-index: 10000; box-shadow: 0 0 0 100vmax #191c1e80; }
.auth-modal::backdrop { background: #191c1e80; }
.auth-modal *, .auth-modal *::before, .auth-modal *::after { box-sizing: border-box; }
.auth-modal-frame { position: relative; min-height: 110px; border-top: 6px solid #f97316; border-image: linear-gradient(90deg, #f97316, #f59e0b, #ea580c) 1; }
.auth-modal-close {
  position: sticky;
  z-index: 2;
  top: 12px;
  float: right;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 16px 26px -60px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #737373;
  cursor: pointer;
  text-decoration: none;
}
.auth-modal-close:hover { color: #404040; background: #f5f5f5; }
.auth-modal :is(a, button, input, summary):focus-visible { outline: 3px solid #f9731680; outline-offset: 3px; }
.auth-modal .auth-card { width: 100%; max-width: none; padding: 34px 40px 36px; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
.auth-modal .auth-step { display: flex; align-items: center; gap: 8px; min-height: 16px; margin: 0 32px 28px 0; color: #e94c1d; font-size: 11px; font-weight: 750; letter-spacing: 1.1px; text-transform: uppercase; }
.auth-modal .auth-step > span { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: #ff5722; }
.auth-modal .auth-heading { margin: 0 0 24px; }
.auth-modal .auth-heading h1 { margin: 0; color: #171717; font-family: inherit; font-size: 36px; font-weight: 800; letter-spacing: -1.2px; line-height: 1.25; }
.auth-modal .auth-heading h1:focus { outline: none; }
.auth-modal .auth-heading p { margin: 8px 0 0; color: #64748b; font-size: 14px; line-height: 1.625; }
.auth-modal .auth-providers { display: flex; flex-direction: column; gap: 12px; }
.auth-modal .auth-provider { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid #e5e5e5; border-radius: 12px; padding: 12px 16px; background: #fff; color: #262626; text-decoration: none; font-size: 16px; font-weight: 650; line-height: 24px; box-shadow: 0 1px 2px #0000000d; }
.auth-modal .auth-provider svg { flex-shrink: 0; }
.auth-modal .auth-provider-google:hover { background: #fafafa; border-color: #d4d4d4; }
.auth-modal .auth-provider-apple { color: #fff; border-color: #000; background: #000; }
.auth-modal .auth-provider-apple:hover { background: #262626; }
.auth-modal .form-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: #737373; font-size: 10px; font-weight: 750; letter-spacing: 1px; line-height: 16px; text-transform: uppercase; white-space: nowrap; }
.auth-modal .form-divider::before, .auth-modal .form-divider::after { background: #e5e5e5; }
.auth-modal .auth-form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.auth-modal .auth-field { min-width: 0; }
.auth-modal .auth-field label { display: block; margin-bottom: 6px; color: #404040; font-size: 12px; font-weight: 750; letter-spacing: .6px; line-height: 18px; text-transform: uppercase; }
.auth-modal .auth-input-wrap { position: relative; }
.auth-modal .auth-input-icon { position: absolute; top: 14px; left: 14px; width: 20px; height: 20px; color: #a3a3a3; pointer-events: none; }
.auth-modal .auth-form input:not([type="hidden"]) { display: block; width: 100%; min-height: 48px; margin: 0; padding: 12px 14px; border: 1px solid #e5e5e5; border-radius: 12px; background: #fafafa; color: #171717; font-family: inherit; font-size: 16px; line-height: 22px; }
.auth-modal .auth-input-wrap input:not([type="hidden"]) { padding-left: 44px; }
.auth-modal .auth-input-wrap input[data-auth-password] { padding-right: 48px; }
.auth-modal .auth-form input::placeholder { color: #a3a3a3; }
.auth-modal .auth-form input:focus { border-color: #f97316; background: #fff; outline: 3px solid #f9731633; outline-offset: 0; }
.auth-modal .auth-password-toggle { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: #737373; cursor: pointer; }
.auth-modal .auth-password-toggle[hidden] { display: none; }
.auth-modal .auth-password-toggle svg { width: 20px; height: 20px; }
.auth-modal .auth-password-toggle:hover { background: #f0f0f0; }
.auth-modal .auth-length-bars { display: flex; gap: 6px; margin-top: 8px; }
.auth-modal .auth-length-bars span { height: 4px; flex: 1; border-radius: 999px; background: #e5e5e5; transition: background-color .15s; }
.auth-modal .auth-length-bars span[data-filled] { background: #f97316; }
.auth-modal .field-help { margin: 8px 0 0; color: #737373; font-size: 12px; line-height: 1.5; }
.auth-modal .auth-submit { display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; min-height: 52px; margin: 8px 0 0; padding: 14px 20px; border: 0; border-radius: 12px; background: linear-gradient(90deg, #f97316, #ea580c); color: #fff; font-family: inherit; font-size: 16px; font-weight: 750; line-height: 24px; text-decoration: none; box-shadow: 0 8px 16px #f9731630; cursor: pointer; }
.auth-modal .auth-submit:hover { background: linear-gradient(90deg, #ea580c, #c2410c); }
.auth-modal .auth-submit-arrow { transition: transform .15s; }
.auth-modal .auth-submit:hover .auth-submit-arrow { transform: translateX(3px); }
.auth-modal .auth-switch { margin: 24px 0 0; color: #525252; font-size: 14px; line-height: 1.6; text-align: center; }
.auth-modal .auth-switch a, .auth-modal .label-row a, .auth-modal .auth-text-button { color: #c2410c; font-weight: 700; text-decoration: none; }
.auth-modal .auth-switch a:hover, .auth-modal .label-row a:hover { text-decoration: underline; text-underline-offset: 4px; }
.auth-modal .label-row { gap: 8px; align-items: baseline; }
.auth-modal .label-row a { font-size: 12px; }
.auth-modal .resend-panel { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e5e5e5; color: #525252; font-size: 13px; }
.auth-modal .resend-panel summary { min-height: 32px; color: #525252; cursor: pointer; }
.auth-modal .compact-form { margin-top: 12px; }
.auth-modal .auth-text-button { min-height: 44px; padding: 8px; border: 0; background: transparent; font: inherit; cursor: pointer; }
.auth-modal .form-error { color: #a92020; background: #fff1f1; border-color: #fecaca; }
.auth-modal .form-status { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.auth-modal-notice { margin: 70px 40px 0; font-size: 14px; line-height: 1.5; }
.auth-modal-notice[hidden] { display: none; }
.auth-modal-notice p { margin: 0; }
.auth-modal-notice button { margin-top: 10px; min-height: 44px; padding: 8px 14px; border: 1px solid currentColor; border-radius: 8px; background: #fff; color: inherit; cursor: pointer; font: inherit; }
.auth-modal [aria-busy="true"] .auth-submit { cursor: wait; opacity: .7; }
.auth-modal .auth-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 639px) {
  .auth-modal .auth-card { padding: 30px 28px 36px; }
  .auth-modal .auth-heading h1 { font-size: 30px; letter-spacing: -.8px; }
  .auth-modal .auth-provider { font-size: 14px; }
  .auth-modal-close { margin-right: 14px; }
  .auth-modal-notice { margin-right: 28px; margin-left: 28px; }
  .auth-modal .form-divider { gap: 8px; font-size: 9px; letter-spacing: .65px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-modal *, .auth-modal *::before, .auth-modal *::after { transition: none !important; animation: none !important; }
}
