/* Scoped authentication controls shared by the modal and standalone pages. */
.auth-flow [hidden], .auth-page [hidden] { display: none !important; }
.auth-page {
  min-height: calc(100vh - 200px);
  display: grid;
  place-items: center;
  padding: 52px 20px 68px;
  background:
    radial-gradient(circle at 50% 8%, rgba(59, 130, 246, 0.09), transparent 52%),
    linear-gradient(180deg, #f6faff 0%, #f1f6fd 100%);
}
.auth-page-card {
  width: 100%;
  max-width: 580px;
  padding: 28px 34px 30px;
  box-sizing: border-box;
  border: 1px solid rgba(59, 130, 246, 0.14);
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow:
    inset 0 1px 0 0 #ffffff,
    0 26px 68px -14px rgba(0, 82, 204, 0.14),
    0 12px 28px -8px rgba(15, 23, 42, 0.06);
}
.auth-page-card h1 {
  font-size: 23px;
  font-weight: 700;
  margin: 0 0 8px;
  text-align: left;
  background: linear-gradient(135deg, #007bff 0%, #3b82f6 55%, #0ea5e9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #007bff;
}
.auth-page-intro { color: #64748b; font-size: 13.5px; line-height: 1.5; margin: 0 0 22px; text-align: left; }
.auth-flow { display: flex; flex-direction: column; gap: 15px; }
.auth-flow .ds-form-group { margin: 0; }
.auth-flow label { display: block; color: #1e293b; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.auth-flow input:not([type=checkbox]):not([type=hidden]) {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #dbe6f4;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.auth-flow input:not([type=checkbox]):not([type=hidden]):hover { border-color: #93c5fd; }
.auth-flow input:not([type=checkbox]):not([type=hidden]):focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3.5px rgba(0, 123, 255, 0.13);
}
.auth-flow input:focus-visible, .auth-flow button:focus-visible, .auth-flow a:focus-visible { outline: 2px solid #007bff; outline-offset: 2px; }
.auth-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #eff6ff; border: 1px solid rgba(59, 130, 246, 0.14); padding: 4px; border-radius: 12px; }
.auth-flow .auth-mode-switch button { border: 0; border-radius: 9px; padding: 8px 10px; background: transparent; color: #64748b; font-weight: 600; cursor: pointer; font: inherit; font-size: 13.5px; }
.auth-flow .auth-mode-switch button[aria-pressed=true] { background: #ffffff; color: #007bff; box-shadow: 0 2px 8px rgba(0, 123, 255, 0.12); }
.auth-flow .auth-primary, .auth-page .auth-primary {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 11px 18px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #007bff 0%, #3b82f6 55%, #0ea5e9 100%);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 8px 22px -4px rgba(0, 123, 255, 0.38);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.auth-flow button:disabled, .auth-flow [disabled], .auth-page button:disabled {
  background: linear-gradient(135deg, #60a5fa 0%, #38bdf8 100%);
  color: #ffffff;
  opacity: 0.86;
  cursor: not-allowed;
}
.auth-flow .auth-primary:hover:not(:disabled) {
  transform: translateY(-1.5px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), 0 12px 26px -4px rgba(0, 123, 255, 0.48);
}
.auth-code-row { display: flex; gap: 8px; align-items: center; }
.auth-code-row button { flex-shrink: 0; min-height: 44px; padding: 8px 14px; border: 1px solid #bfd7f6; border-radius: 11px; background: #f0f7ff; color: #007bff; font-weight: 600; cursor: pointer; font: inherit; font-size: 13px; }
.auth-note { color: #64748b; font-size: 13px; line-height: 1.55; margin: 6px 0 0; overflow-wrap: anywhere; }
.auth-message { padding: 11px 14px; border-radius: 11px; background: #fff1f2; border: 1px solid #fecdd3; color: #be123c; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; margin: 0; }
.auth-message[data-kind=success] { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.auth-captcha { display: flex; justify-content: center; align-items: center; min-height: 82px; padding: 8px 12px; border-radius: 14px; border: 1px solid #dbe8f8; background: linear-gradient(180deg, #f8fbff 0%, #f2f8ff 100%); }
.auth-links { text-align: center; color: #64748b; font-size: 13.5px; margin-top: 20px; line-height: 1.8; }
.auth-flow a, .auth-links a { color: #007bff; font-weight: 600; text-decoration: none; }
.auth-flow a:hover, .auth-links a:hover { text-decoration: underline; }
.auth-password-footer { display: flex; justify-content: flex-end; font-size: 13px; }
[data-theme=dark] .auth-page { background: #0b1120; }
[data-theme=dark] .auth-page-card { background: #131c2e; border-color: #334155; }
[data-theme=dark] .auth-page-intro, [data-theme=dark] .auth-page .auth-note, [data-theme=dark] .auth-page .auth-links { color: #cbd5e1; }
[data-theme=dark] .auth-page .auth-flow label, [data-theme=dark] .auth-page .auth-flow input:not([type=checkbox]):not([type=hidden]) { color: #f1f5f9; }
[data-theme=dark] .auth-page .auth-flow input:not([type=checkbox]):not([type=hidden]) { background: #1e293b; border-color: #64748b; }
[data-theme=dark] .auth-page .auth-captcha { background: rgba(30, 41, 59, 0.55); border-color: rgba(100, 116, 139, 0.3); }
[data-theme=dark] .auth-page .auth-message { color: #fecdd3; background: #4c1525; border-color: #881337; }
[data-theme=dark] .auth-page .auth-message[data-kind=success] { color: #a7f3d0; background: #064e3b; border-color: #065f46; }
@media(max-width: 560px) { .auth-page { padding: 24px 12px; } .auth-page-card { padding: 22px 18px; border-radius: 20px; } }
@media(max-width: 380px) { .auth-captcha { transform: scale(.9); transform-origin: center; } }
