/* ==========================================================================
   NaijaAlert — Authentication Pages Styles
   Login, Sign Up, Forgot Password
   ========================================================================== */

/* ---------- Auth Layout ---------- */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}

.auth-brand {
  background: var(--grad-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}
.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 80%, rgba(18, 100, 163, 0.35) 0%, transparent 55%),
              radial-gradient(circle at 80% 20%, rgba(11, 143, 85, 0.25) 0%, transparent 55%);
  pointer-events: none;
}
.auth-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 420px;
}
.auth-brand-logo {
  display: block;
  max-width: 220px;
  height: auto;
  margin-bottom: 36px;
}
.auth-brand h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}
.auth-brand p {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 32px;
}
.auth-brand-features {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.auth-brand-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.auth-brand-feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  flex: 0 0 auto;
}
.auth-brand-feature-icon svg {
  width: 20px; height: 20px;
}
.auth-brand-feature strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.auth-brand-feature span {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}

.auth-form-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px;
  position: relative;
}
.auth-form-wrap {
  width: 100%;
  max-width: 440px;
}

/* ---------- Auth Header ---------- */
.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.auth-header-logo {
  display: block;
  max-height: 36px;
  width: auto;
}
.auth-header-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--blue);
}
.auth-header-link:hover { text-decoration: underline; }

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 20px;
}
.auth-back:hover { color: var(--text); }
.auth-back svg { width: 16px; height: 16px; }

/* ---------- Auth Card ---------- */
.auth-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
}
.auth-card h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text);
}
.auth-card .auth-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 28px;
}

/* ---------- Auth Form ---------- */
.auth-form .field {
  margin-bottom: 18px;
}
.auth-form label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.auth-form label .required {
  color: var(--red);
  margin-left: 2px;
}
.auth-form input,
.auth-form select,
.auth-form textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.98rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(18, 100, 163, 0.12);
}
.auth-form input::placeholder,
.auth-form textarea::placeholder {
  color: var(--muted);
  font-weight: 400;
}
.auth-form input.error,
.auth-form select.error,
.auth-form textarea.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.08);
}
.auth-form .field-error {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--red);
  font-weight: 500;
}
.auth-form .field-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- Password Input ---------- */
.password-wrap {
  position: relative;
}
.password-wrap input {
  padding-right: 48px;
}
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.password-toggle:hover {
  color: var(--text);
  background: var(--bg);
}
.password-toggle svg {
  width: 18px; height: 18px;
}

/* ---------- Password Strength ---------- */
.password-strength {
  margin-top: 8px;
}
.password-strength-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 6px;
}
.password-strength-fill {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease, background-color 0.3s ease;
}
.password-strength-fill.weak { width: 25%; background: var(--red); }
.password-strength-fill.fair { width: 50%; background: var(--amber); }
.password-strength-fill.good { width: 75%; background: var(--blue); }
.password-strength-fill.strong { width: 100%; background: var(--green); }
.password-strength-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- Checkbox ---------- */
.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  cursor: pointer;
}
.auth-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  margin-top: 2px;
  flex: 0 0 auto;
  cursor: pointer;
}
.auth-checkbox span {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
}
.auth-checkbox a {
  color: var(--blue);
  font-weight: 600;
}
.auth-checkbox a:hover { text-decoration: underline; }

/* ---------- Auth Buttons ---------- */
.auth-submit {
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  margin-top: 6px;
}
.auth-submit-primary {
  background: var(--grad-main);
  color: #fff;
  box-shadow: 0 8px 22px rgba(11, 143, 85, 0.28);
}
.auth-submit-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(11, 143, 85, 0.36);
}
.auth-submit-primary:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}
.auth-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.auth-submit .spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Auth Footer Links ---------- */
.auth-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 0.92rem;
  color: var(--muted);
}
.auth-footer a {
  color: var(--blue);
  font-weight: 700;
}
.auth-footer a:hover { text-decoration: underline; }

/* ---------- Error / Success Cards ---------- */
.auth-alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 18px;
  display: none;
}
.auth-alert.visible { display: block; }
.auth-alert-error {
  background: rgba(217, 45, 32, 0.08);
  color: var(--red-dark);
  border: 1px solid rgba(217, 45, 32, 0.2);
}
.auth-alert-success {
  background: rgba(11, 143, 85, 0.08);
  color: var(--green);
  border: 1px solid rgba(11, 143, 85, 0.2);
}
.auth-alert-icon {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 8px;
}
.auth-alert-icon svg {
  width: 18px; height: 18px;
}

/* ---------- Emergency Access ---------- */
.auth-emergency {
  margin-top: 24px;
  padding: 18px;
  background: rgba(217, 45, 32, 0.06);
  border: 1px solid rgba(217, 45, 32, 0.18);
  border-radius: var(--radius-sm);
  text-align: center;
}
.auth-emergency p {
  font-size: 0.88rem;
  color: var(--red-dark);
  font-weight: 600;
  margin-bottom: 10px;
}
.auth-emergency .btn {
  width: 100%;
}

/* ---------- Auth Footer ---------- */
.auth-page-footer {
  grid-column: 1 / -1;
  padding: 20px 48px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: #fff;
}
.auth-page-footer a {
  color: var(--blue);
  font-weight: 600;
  margin: 0 8px;
}
.auth-page-footer a:hover { text-decoration: underline; }

/* ---------- Reveal Animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .auth-brand {
    padding: 32px 24px;
  }
  .auth-brand-inner {
    max-width: 100%;
  }
  .auth-brand-logo {
    max-width: 160px;
    margin-bottom: 20px;
  }
  .auth-brand h2 { font-size: 1.3rem; }
  .auth-brand p { font-size: 0.92rem; margin-bottom: 20px; }
  .auth-brand-features { flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .auth-brand-feature { flex: 1 1 200px; }
  .auth-form-side {
    padding: 24px;
    justify-content: flex-start;
  }
  .auth-card { padding: 24px; }
  .auth-page-footer {
    padding: 16px 24px;
  }
}

@media (max-width: 480px) {
  .auth-brand { padding: 24px 18px; }
  .auth-brand-features { flex-direction: column; }
  .auth-form-side { padding: 16px; }
  .auth-card { padding: 20px; }
  .auth-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .auth-page-footer { padding: 14px 18px; font-size: 0.78rem; }
}
