/* Shared styles for /login, /forgot-password, /reset-password.
   Designed for keyboard + screen-reader users:
   - Visible :focus-visible outlines (never removed)
   - Color contrast ≥ 4.5:1 for body text, 3:1 for large text & UI components
   - .sr-only class for visually-hidden but screen-reader-accessible text  */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #0f1115;
  color: #e6e8ec;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
}

/* Skip link — first focusable element on the page. Hidden until focused. */
.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  background: #6aa1ff;
  color: #0f1115;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 100;
  transition: top .15s ease;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
  outline: 3px solid #ffd166;
  outline-offset: 2px;
}

.page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header {
  padding: 20px 24px;
  border-bottom: 1px solid #1c2030;
}
.site-header a.brand {
  color: #e6e8ec;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
}
.site-header a.brand:focus-visible {
  outline: 3px solid #6aa1ff;
  outline-offset: 4px;
  border-radius: 4px;
}

main.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: #161a22;
  border: 1px solid #242a36;
  border-radius: 14px;
  padding: 32px 28px;
}

h1.card-title {
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 8px;
}
p.card-lede {
  margin: 0 0 24px;
  color: #b1b8c5;
  font-size: 15px;
}

form.auth-form { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 14px;
  font-weight: 600;
  color: #e6e8ec;
}
.field .hint {
  font-size: 13px;
  color: #b1b8c5;
}
.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  background: #0f1115;
  color: #e6e8ec;
  border: 1px solid #3a3f4b;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 16px;        /* prevents iOS auto-zoom */
  font-family: inherit;
  width: 100%;
}
.field input:focus-visible {
  outline: 3px solid #6aa1ff;
  outline-offset: 1px;
  border-color: #6aa1ff;
}
.field input[aria-invalid="true"] {
  border-color: #ff6a6a;
}

.password-row { position: relative; }
.password-row input { padding-right: 90px; }
.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 1px solid #3a3f4b;
  color: #e6e8ec;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.password-toggle:focus-visible {
  outline: 3px solid #6aa1ff;
  outline-offset: 1px;
}

.row-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -6px;
}

button.btn-primary {
  background: #6aa1ff;
  color: #0f1115;
  border: none;
  padding: 14px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
}
button.btn-primary:focus-visible {
  outline: 3px solid #ffd166;
  outline-offset: 2px;
}
button.btn-primary:hover:not(:disabled) { background: #7eb1ff; }
button.btn-primary:disabled {
  opacity: .55;
  cursor: not-allowed;
}

a.link {
  color: #8eb6ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
a.link:focus-visible {
  outline: 3px solid #6aa1ff;
  outline-offset: 3px;
  border-radius: 3px;
}
a.link:hover { color: #aac6ff; }

.divider {
  margin: 22px 0 6px;
  border: 0;
  border-top: 1px solid #242a36;
}

.alt-action {
  text-align: center;
  font-size: 14px;
  color: #b1b8c5;
}

/* Status banner — used for "check your email", errors, etc.
   role="alert" / aria-live="assertive" applied in HTML for errors;
   aria-live="polite" for success/info. */
.status {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}
.status:empty { display: none; }
.status.info     { background: #16273f; color: #cfe2ff; border: 1px solid #2a4f80; }
.status.success  { background: #163c2c; color: #c8eed7; border: 1px solid #2a6a4d; }
.status.error    { background: #3a1c1c; color: #ffd1d1; border: 1px solid #803333; }

.site-footer {
  padding: 18px 24px;
  border-top: 1px solid #1c2030;
  color: #8b93a3;
  font-size: 13px;
  text-align: center;
}
.site-footer a {
  color: #8b93a3;
  text-decoration: underline;
}
.site-footer a:focus-visible {
  outline: 3px solid #6aa1ff;
  outline-offset: 3px;
  border-radius: 3px;
}

/* Visually hidden but available to screen readers. */
.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;
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode (Windows / forced-colors). */
@media (forced-colors: active) {
  .card, .field input, button.btn-primary {
    border: 1px solid CanvasText;
  }
  button.btn-primary { background: ButtonFace; color: ButtonText; }
}
