/*
 * Auth pages (sign in, sign up, password reset) - mobile-first, responsive
 */

:root {
  --auth-primary: #00274C;
  --auth-primary-hover: #001a33;
  --auth-bg: #f8f9fa;
  --auth-bg-end: #eef0f4;
  --auth-card-shadow: 0 4px 24px rgba(0, 39, 76, 0.12);
  --auth-card-shadow-hover: 0 8px 32px rgba(0, 39, 76, 0.18);
  --auth-border: #e2e4e8;
  --auth-text-muted: #555;
  --auth-text-light: #666;
}

/* Auth layout - body wrapper */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(160deg, var(--auth-bg) 0%, var(--auth-bg-end) 100%);
  margin: 0;
  padding: 16px;
  box-sizing: border-box;
}

.auth-brand {
  text-align: center;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.auth-brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.auth-brand-logo {
  height: 88px;
  width: auto;
  display: block;
}

.auth-brand-name {
  font-size: 2.9rem;
  padding-right: 16px;
}

.auth-maize {
  color: #FFCB05;
  text-transform: uppercase;
}

.auth-blue {
  color: #00274C;
  text-transform: lowercase;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.auth-tagline {
  margin: 8px 0 0 0;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--auth-text-muted);
}

.auth-flash {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  max-width: 420px;
  width: 100%;
  box-sizing: border-box;
}

.auth-flash.flash-notice,
.auth-flash.flash-success {
  background: #e8f5e9;
  color: #2e7d32;
}

.auth-flash.flash-alert,
.auth-flash.flash-error {
  background: #ffebee;
  color: #c62828;
}

/* Auth card - main container */
.auth-card {
  background: white;
  padding: 24px 20px;
  border-radius: 16px;
  box-shadow: var(--auth-card-shadow);
  max-width: 420px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s ease;
}

.auth-card:focus-within {
  box-shadow: var(--auth-card-shadow-hover);
}

.auth-card h1 {
  margin: 0 0 8px 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: #111;
}

.auth-card .auth-subtitle {
  margin: 0 0 24px 0;
  color: var(--auth-text-muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

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

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-weight: 500;
  font-size: 0.9rem;
  color: #333;
}

.auth-field input[type="email"],
.auth-field input[type="password"],
.auth-field input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  font-size: 16px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(0, 39, 76, 0.12);
}

.auth-field input::placeholder {
  color: #999;
}

/* Remember me */
.auth-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 0;
}

.auth-remember input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--auth-primary);
}

.auth-remember label {
  margin: 0;
  font-size: 0.9rem;
  color: var(--auth-text-light);
  cursor: pointer;
}

/* Submit button - touch-friendly */
.auth-submit {
  width: 100%;
  min-height: 48px;
  padding: 14px 20px;
  background: var(--auth-primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.05s ease;
  margin-top: 4px;
}

.auth-submit:hover {
  background: var(--auth-primary-hover);
}

.auth-submit:active {
  transform: scale(0.99);
}

/* Auth links section */
.auth-links {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.auth-links a {
  display: block;
  padding: 0;
  font-size: 0.95rem;
  color: var(--auth-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  line-height: 24px;
  box-sizing: border-box;
}

.auth-links a:hover {
  color: var(--auth-primary-hover);
  text-decoration: underline;
}

.auth-links a + a {
  border-top: none;
}

.auth-links > * + * {
  margin-top: 2px;
}

.auth-links-pair {
  display: block;
  padding: 0;
  font-size: 0.95rem;
  color: var(--auth-text-muted);
}

.auth-links-pair a {
  display: inline;
  padding: 0;
  min-height: auto;
}

/* Helper text in labels */
.auth-hint {
  font-size: 0.8rem;
  color: var(--auth-text-light);
  font-weight: 400;
}

/* Error messages */
#error_explanation {
  padding: 12px 14px;
  background: #ffebee;
  color: #c62828;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 18px;
}

#error_explanation h2 {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  font-weight: 600;
}

#error_explanation ul {
  margin: 0;
  padding-left: 20px;
}

/* OTP code input - centered, large */
.auth-otp-input {
  font-size: 20px !important;
  letter-spacing: 8px !important;
  text-align: center !important;
}

/* Button group (Verify + Resend) */
.auth-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.auth-actions .auth-submit {
  width: auto;
  min-width: 120px;
}

.auth-btn-outline {
  padding: 12px 20px;
  border: 2px solid var(--auth-primary);
  color: var(--auth-primary);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: white;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.auth-btn-outline:hover {
  background: rgba(0, 39, 76, 0.06);
}

.auth-btn-inline {
  display: inline;
  margin: 0;
}

/* Desktop - slightly larger card, more padding */
@media (min-width: 480px) {
  .auth-page {
    padding: 24px;
  }

  .auth-brand {
    margin-bottom: 32px;
  }

  .auth-brand-logo {
    height: 104px;
  }

  .auth-brand-name {
    font-size: 3.4rem;
  }

  .auth-card {
    padding: 40px 36px;
  }

  .auth-card h1 {
    font-size: 1.5rem;
  }

  .auth-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    border-top: 1px solid #eee;
    padding-top: 20px;
  }

  .auth-links a {
    display: inline-block;
    padding: 0;
    min-height: auto;
    border: none;
  }

  .auth-links a + a {
    border: none;
  }
}
