/* ==========================================================================
   MARKAZ-UL-HUFFAZ — AUTHENTICATION STYLES (auth.css)
   One shared stylesheet for all login and authentication interfaces:
     - Parent Login  (--auth-accent: #24474f Primary Green)
     - Staff Login   (--auth-accent: #ab8126 Gold)
     - Super Admin   (--auth-accent: #1d2e2e Darker Green)
   ========================================================================== */

:root {
  --muh-primary: #24474f;
  --muh-primary-dark: #1a343a;
  --muh-primary-light: #f0f5f4;
  --muh-gold: #ab8126;
  --muh-gold-dark: #8c671b;
  --muh-gold-light: #faf5ec;
  --muh-dark: #1d2e2e;
  --muh-white: #ffffff;
  --muh-bg: #f8faf9;
  --muh-text: #1a2527;
  --muh-text-muted: #536467;
  --muh-border: #dbe4e2;
  --muh-danger: #dc2626;
  --muh-danger-bg: #fef2f2;
  --muh-font: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --muh-font-ar: 'Amiri', 'Traditional Arabic', serif;

  /* Default role color is Primary Green */
  --auth-accent: var(--muh-primary);
  --auth-accent-dark: var(--muh-primary-dark);
  --auth-accent-light: var(--muh-primary-light);
}

/* Role-specific color token overrides */
body.auth-parent,
.auth-wrapper.auth-parent {
  --auth-accent: #24474f;
  --auth-accent-dark: #1a343a;
  --auth-accent-light: #f0f5f4;
}

body.auth-staff,
.auth-wrapper.auth-staff {
  --auth-accent: #ab8126;
  --auth-accent-dark: #8c671b;
  --auth-accent-light: #faf5ec;
}

body.auth-superadmin,
.auth-wrapper.auth-superadmin {
  --auth-accent: #1d2e2e;
  --auth-accent-dark: #121f1f;
  --auth-accent-light: #e8eeee;
}

/* Base Body on Auth Pages */
body.is-auth-page {
  font-family: var(--muh-font);
  background: radial-gradient(circle at 50% 20%, #ffffff 0%, #f4f7f6 100%);
  color: var(--muh-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  margin: 0;
  box-sizing: border-box;
}

/* Auth Center Container */
.auth-container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

/* Brand Emblem Header */
.auth-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-brand-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin: 0 auto 0.75rem;
  display: block;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(29, 46, 46, 0.08);
  background: #ffffff;
  padding: 6px;
}

.auth-school-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--muh-dark);
  letter-spacing: -0.01em;
  margin: 0 0 0.25rem;
}

.auth-school-sub {
  font-size: 0.8125rem;
  color: var(--muh-text-muted);
  margin: 0;
}

/* Auth Card */
.auth-card {
  background: var(--muh-white);
  border: 1px solid var(--muh-border);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(29, 46, 46, 0.07);
  overflow: hidden;
  position: relative;
}

/* Role Accent Top Stripe */
.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--auth-accent);
}

.auth-card-header {
  padding: 1.75rem 1.75rem 1rem;
  text-align: center;
  border-bottom: 1px solid #f0f4f3;
}

.auth-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--auth-accent-light);
  color: var(--auth-accent);
  margin-bottom: 0.5rem;
}

.auth-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--muh-text);
  margin: 0 0 0.35rem;
}

.auth-card-desc {
  font-size: 0.8125rem;
  color: var(--muh-text-muted);
  margin: 0;
}

.auth-card-body {
  padding: 1.75rem;
}

/* Form Groups & Inputs */
.auth-form-group {
  margin-bottom: 1.25rem;
}

.auth-form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muh-text);
  margin-bottom: 0.4rem;
}

.auth-form-group input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--muh-border);
  border-radius: 8px;
  font-size: 0.9375rem;
  font-family: inherit;
  background: #ffffff;
  color: var(--muh-text);
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.auth-form-group input:focus {
  outline: none;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(36, 71, 79, 0.15);
}

body.auth-staff .auth-form-group input:focus {
  box-shadow: 0 0 0 3px rgba(171, 129, 38, 0.18);
}

body.auth-superadmin .auth-form-group input:focus {
  box-shadow: 0 0 0 3px rgba(29, 46, 46, 0.20);
}

/* Buttons */
.auth-submit-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--auth-accent);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.auth-submit-btn:hover {
  background: var(--auth-accent-dark);
  box-shadow: 0 4px 12px rgba(29, 46, 46, 0.18);
}

/* Alert notifications */
.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  line-height: 1.4;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.auth-alert-danger {
  background: var(--muh-danger-bg);
  border: 1px solid #1b1a1aff;
  color: var(--muh-danger);
}

.auth-alert-danger,
.auth-alert-danger * {
  color: var(--muh-danger) !important;
}

.auth-alert-info {
  background: var(--auth-accent-light);
  border: 1px solid var(--muh-border);
  color: var(--auth-accent);
}

.auth-alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.auth-alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* Footer / Extra links */
.auth-card-footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f0f4f3;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muh-text-muted);
}

.auth-resend-wrapper {
  margin-bottom: 0.85rem;
}

.auth-resend-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0.65rem;
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.auth-resend-status.is-cooling {
  background: var(--auth-accent-light);
  border: 1px solid var(--muh-border);
  color: var(--muh-text);
}

.auth-resend-status.is-cooling strong {
  color: var(--auth-accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.auth-resend-status.is-ready {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-weight: 600;
}

.auth-status-icon {
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
}

.auth-resend-link.is-disabled,
.auth-resend-action-link.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
  text-decoration: none !important;
}

.auth-resend-text {
  margin: 0 0 0.75rem 0;
  color: var(--muh-text-muted);
}

.auth-footer-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.auth-card-footer a {
  color: var(--auth-accent);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s;
}

.auth-card-footer a:hover {
  text-decoration: underline;
}

/* Return to website link */
.auth-back-link {
  text-align: center;
  margin-top: 1.5rem;
}

.auth-back-link a {
  font-size: 0.8125rem;
  color: var(--muh-text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.15s;
}

.auth-back-link a:hover {
  color: var(--muh-dark);
}

/* Responsive adjustment */
@media (max-width: 480px) {
  .auth-card-header {
    padding: 1.25rem 1.25rem 0.75rem;
  }
  .auth-card-body {
    padding: 1.25rem;
  }
  .auth-brand-logo {
    width: 80px;
    height: 80px;
  }
}
