/* ============================================================================
   Wisdomland World School — shared brand stylesheet for server-rendered pages
   (portal, allauth account pages, error pages).

   The color tokens below are copied verbatim from the SPA design system at
   wdl-quote/src/index.css (Tailwind v4 @theme block). The two files must be
   kept in sync — they rarely change. The component layer (.wl-card, .wl-input,
   .wl-btn-*, .section-label) reproduces the SPA's component rules in plain CSS
   so Django pages match the React app without depending on the JS bundle.
   ========================================================================== */

:root {
  --color-wl-green-950: #052e16;
  --color-wl-green-900: #0f3d22;
  --color-wl-green-800: #1b5e35;
  --color-wl-green-700: #25703f;
  --color-wl-green-600: #2e8b4e;
  --color-wl-green-500: #3aac62;
  --color-wl-green-400: #5cc97e;
  --color-wl-green-300: #86dfa0;
  --color-wl-green-200: #b4f0c4;
  --color-wl-green-100: #d6f8e2;
  --color-wl-green-50:  #f0faf4;

  --color-wl-gold-600:  #b45309;
  --color-wl-gold-500:  #d97706;
  --color-wl-gold-400:  #f59e0b;
  --color-wl-gold-300:  #fbbf24;
  --color-wl-gold-100:  #fef3c7;
  --color-wl-gold-50:   #fffbeb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--color-wl-green-50);
  color: #1c2b1e;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-wl-green-700); }

/* ─── Header (portal chrome) ─────────────────────────────────────────────── */
.wl-header {
  background: var(--color-wl-green-900);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wl-header .brand { font-weight: 700; }
.wl-header a { color: var(--color-wl-green-100); text-decoration: none; font-size: 14px; }
.wl-header a:hover { color: #fff; }
.wl-header .wl-user { color: var(--color-wl-green-300); margin-right: 12px; font-size: 14px; }

main { max-width: 960px; margin: 0 auto; padding: 32px 20px; }
.muted { color: #4b7a5a; }

/* ─── Section label ──────────────────────────────────────────────────────── */
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-wl-green-700);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-label::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1rem;
  background: var(--color-wl-green-500);
  border-radius: 2px;
}

/* ─── Card ───────────────────────────────────────────────────────────────── */
.wl-card {
  background: white;
  border-radius: 1rem;
  border: 1px solid var(--color-wl-green-100);
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(15,61,34,0.06);
}

/* ─── Inputs ─────────────────────────────────────────────────────────────── */
.wl-input {
  width: 100%;
  border: 1px solid #d1fae5;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  background: #f9fefb;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: #1c2b1e;
}
.wl-input:focus {
  border-color: var(--color-wl-green-500);
  box-shadow: 0 0 0 3px rgba(58,172,98,0.15);
  background: white;
}
.wl-input:disabled {
  background: #f1f5f2;
  color: #9ca3af;
  cursor: not-allowed;
}

.wl-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-wl-green-800);
  margin-bottom: 0.3rem;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.wl-btn-primary {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  background: var(--color-wl-green-700);
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.wl-btn-primary:hover { background: var(--color-wl-green-800); color: #fff; }

.wl-btn-ghost {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  background: transparent;
  color: var(--color-wl-green-700);
  border: 1px solid var(--color-wl-green-200);
  border-radius: 0.5rem;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.wl-btn-ghost:hover {
  background: var(--color-wl-green-50);
  border-color: var(--color-wl-green-400);
}

.wl-btn-block { width: 100%; }

/* ─── Microsoft SSO button ───────────────────────────────────────────────── */
.wl-btn-ms {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  text-decoration: none;
  background: #fff;
  color: #3b3b3b;
  border: 1px solid #d0d7de;
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.wl-btn-ms:hover { background: #f6f8fa; border-color: var(--color-wl-green-400); }
.wl-ms-logo { width: 18px; height: 18px; display: inline-block; }

/* ─── Auth page shell ────────────────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
}
.auth-brand {
  text-align: center;
  margin-bottom: 20px;
}
.auth-brand .name {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-wl-green-900);
}
.auth-brand .sub {
  font-size: 0.8rem;
  color: var(--color-wl-green-600);
  margin-top: 2px;
}
.auth-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-wl-green-900);
  margin: 0 0 4px;
}
.auth-subtitle {
  font-size: 0.85rem;
  color: #4b7a5a;
  margin: 0 0 18px;
}
.auth-field { margin-bottom: 14px; }
.auth-actions { margin-top: 18px; }
.auth-links {
  margin-top: 16px;
  font-size: 0.83rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.auth-links a { text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/* Divider with centered label */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #9caf9f;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-wl-green-100);
}

/* ─── Form errors & messages ─────────────────────────────────────────────── */
.field-error {
  color: #b91c1c;
  font-size: 0.78rem;
  margin-top: 4px;
}
.field-error ul { margin: 0; padding-left: 1rem; }

.wl-input.has-error { border-color: #fca5a5; background: #fef2f2; }

.alert {
  border-radius: 0.5rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.83rem;
  margin-bottom: 14px;
}
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: var(--color-wl-green-50); border: 1px solid var(--color-wl-green-200); color: var(--color-wl-green-800); }
.alert-info    { background: #fffbeb; border: 1px solid #fde68a; color: var(--color-wl-gold-600); }

.help-text { font-size: 0.76rem; color: #6b7280; margin-top: 4px; }
.help-text ul { margin: 4px 0 0; padding-left: 1.1rem; }

/* Auto-apply the .wl-input look to form widgets rendered by Django/allauth
   (which don't carry the wl-input class) inside the auth card. */
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="number"],
.auth-card input[type="tel"],
.auth-card select,
.auth-card textarea {
  width: 100%;
  border: 1px solid #d1fae5;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  background: #f9fefb;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: #1c2b1e;
  font-family: inherit;
}
.auth-card input[type="text"]:focus,
.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus,
.auth-card input[type="number"]:focus,
.auth-card input[type="tel"]:focus,
.auth-card select:focus,
.auth-card textarea:focus {
  border-color: var(--color-wl-green-500);
  box-shadow: 0 0 0 3px rgba(58,172,98,0.15);
  background: white;
}
/* Remember-me / checkbox rows */
.auth-card .checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: #4b7a5a;
}
.auth-card .checkbox-row input[type="checkbox"] { width: auto; accent-color: var(--color-wl-green-600); }
