/* EduRise Auth — premium static UI (no heavy animations) */
:root {
  --ed-bg: #eef2ff;
  --ed-surface: #ffffff;
  --ed-text: #0f172a;
  --ed-muted: #64748b;
  --ed-border: #e2e8f0;
  --ed-primary: #6366f1;
  --ed-primary-2: #8b5cf6;
  --ed-primary-soft: rgba(99, 102, 241, 0.12);
  --ed-danger: #ef4444;
  --ed-success: #10b981;
  --ed-showcase: linear-gradient(160deg, #0f172a 0%, #1e1b4b 45%, #312e81 100%);
  --ed-radius: 14px;
  --ed-radius-lg: 24px;
  --ed-shadow: 0 32px 64px -16px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.04);
}

html.auth-root.dark {
  --ed-bg: #020617;
  --ed-surface: #0f172a;
  --ed-text: #f8fafc;
  --ed-muted: #94a3b8;
  --ed-border: #1e293b;
  --ed-primary-soft: rgba(99, 102, 241, 0.2);
  --ed-shadow: 0 32px 64px -16px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }

html.auth-root, html.auth-root body { height: 100%; margin: 0; }

body.auth-body {
  font-family: Inter, Cairo, system-ui, sans-serif;
  background: var(--ed-bg);
  color: var(--ed-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Mesh background */
.ed-auth {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.ed-auth__mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 15% 10%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(ellipse 55% 45% at 85% 85%, rgba(6, 182, 212, 0.14), transparent 50%),
    radial-gradient(ellipse 40% 35% at 70% 20%, rgba(139, 92, 246, 0.1), transparent 45%),
    var(--ed-bg);
}

html.auth-root.dark .ed-auth__mesh {
  background:
    radial-gradient(ellipse 70% 55% at 15% 10%, rgba(99, 102, 241, 0.22), transparent 55%),
    radial-gradient(ellipse 55% 45% at 85% 85%, rgba(6, 182, 212, 0.12), transparent 50%),
    #020617;
}

/* Toolbar */
.ed-auth__toolbar {
  position: fixed;
  top: 1rem;
  inset-inline: 1rem;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.ed-auth__toolbar > * { pointer-events: auto; }

.ed-auth__home {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--ed-surface);
  border: 1px solid var(--ed-border);
  color: var(--ed-text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.ed-auth__home svg { opacity: 0.7; }

.ed-auth__theme {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--ed-border);
  background: var(--ed-surface);
  color: var(--ed-muted);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

/* Main card */
.ed-auth__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1080px;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  border-radius: var(--ed-radius-lg);
  overflow: hidden;
  box-shadow: var(--ed-shadow);
  background: var(--ed-surface);
}

@media (min-width: 920px) {
  .ed-auth__card {
    grid-template-columns: 1fr 1fr;
    min-height: 640px;
  }

  .ed-auth__card--tall {
    min-height: 700px;
  }
}

/* Showcase panel */
.ed-showcase {
  background: var(--ed-showcase);
  color: #fff;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.ed-showcase::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.5;
  pointer-events: none;
}

.ed-showcase > * { position: relative; z-index: 1; }

.ed-illus {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  display: block;
}

.ed-showcase__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.ed-showcase__brand img {
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.ed-showcase__eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a5b4fc;
  margin-bottom: 0.5rem;
}

.ed-showcase__copy h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.ed-showcase__copy p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
  max-width: 36ch;
}

.ed-showcase__features {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ed-showcase__features li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.ed-showcase__features strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
}

.ed-showcase__features small {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
}

.ed-showcase__feat-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ed-showcase__feat-icon--violet { background: rgba(129, 140, 248, 0.25); color: #c7d2fe; }
.ed-showcase__feat-icon--cyan { background: rgba(34, 211, 238, 0.2); color: #a5f3fc; }
.ed-showcase__feat-icon--amber { background: rgba(251, 191, 36, 0.2); color: #fde68a; }

.ed-showcase__roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ed-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.ed-pill--solid {
  background: rgba(99, 102, 241, 0.35);
  border-color: rgba(165, 180, 252, 0.35);
}

@media (max-width: 919.98px) {
  .ed-showcase { padding: 1.75rem 1.25rem; }
  .ed-illus { max-width: 260px; }
  .ed-showcase__features { display: none; }
}

/* Form panel */
.ed-panel {
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: var(--ed-surface);
  min-width: 0;
  overflow-x: hidden;
}

@media (min-width: 920px) {
  .ed-panel {
    padding: 2rem 1.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 57px);
  }
}

.ed-panel form {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.ed-panel__head {
  margin-bottom: 1.75rem;
}

.ed-panel__head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.ed-panel__head p {
  margin: 0;
  color: var(--ed-muted);
  font-size: 0.92rem;
}

.ed-field { margin-bottom: 1.1rem; min-width: 0; }

.ed-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--ed-text);
}

.ed-label--req::after { content: ' *'; color: var(--ed-danger); }

.ed-input {
  width: 100%;
  max-width: 100%;
  padding: 0.72rem 0.95rem;
  border: 1.5px solid var(--ed-border);
  border-radius: var(--ed-radius);
  background: var(--ed-surface);
  color: var(--ed-text);
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ed-select {
  width: 100%;
  max-width: 100%;
  min-height: 46px;
  padding: 0.78rem 1rem;
  padding-inline-end: 2.75rem;
  border: 1.5px solid var(--ed-border);
  border-radius: var(--ed-radius);
  background: var(--ed-surface);
  color: var(--ed-text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.ed-select-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.ed-select-wrap::after {
  content: '';
  position: absolute;
  inset-inline-end: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.85;
}

.ed-select-wrap:focus-within::after {
  opacity: 1;
}

html.auth-root.dark .ed-select-wrap::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23818cf8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.ed-field--full {
  grid-column: 1 / -1;
}

.ed-input:hover,
.ed-select:hover { border-color: #cbd5e1; }

.ed-input:focus,
.ed-select:focus {
  outline: none;
  border-color: var(--ed-primary);
  box-shadow: 0 0 0 4px var(--ed-primary-soft);
}

.ed-input-wrap {
  position: relative;
}

.ed-input-wrap .ed-input { padding-inline-start: 2.75rem; }

.ed-input-wrap__icon {
  position: absolute;
  inset-inline-start: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ed-muted);
  pointer-events: none;
  display: flex;
}

.ed-grid-2 {
  display: grid;
  gap: 0 0.75rem;
  width: 100%;
  min-width: 0;
}

@media (min-width: 520px) {
  .ed-grid-2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.ed-phone {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1.5px solid var(--ed-border);
  border-radius: var(--ed-radius);
  overflow: hidden;
  background: var(--ed-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ed-phone:focus-within {
  border-color: var(--ed-primary);
  box-shadow: 0 0 0 4px var(--ed-primary-soft);
}

.ed-phone__prefix {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0.72rem 0.65rem;
  background: linear-gradient(135deg, var(--ed-primary-soft), transparent);
  color: var(--ed-primary);
  font-weight: 800;
  font-size: 0.88rem;
  border-inline-end: 1.5px solid var(--ed-border);
  white-space: nowrap;
}

.ed-phone__input {
  flex: 1;
  border: none;
  padding: 0.72rem 0.95rem;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.4;
  background: transparent;
  color: var(--ed-text);
  min-width: 0;
}

.ed-phone__input:focus { outline: none; }

.ed-hint {
  font-size: 0.78rem;
  color: var(--ed-muted);
  margin: 0 0 1rem;
  line-height: 1.5;
  padding: 0.65rem 0.85rem;
  background: var(--ed-primary-soft);
  border-radius: 10px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.ed-section {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ed-muted);
  margin: 1.5rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ed-border);
}

.ed-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}

.ed-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--ed-muted);
  cursor: pointer;
  line-height: 1.45;
}

.ed-check input { margin-top: 0.15rem; accent-color: var(--ed-primary); }

.ed-link {
  color: var(--ed-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.ed-link:hover { text-decoration: underline; }

.ed-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: var(--ed-radius);
  background: linear-gradient(135deg, var(--ed-primary) 0%, var(--ed-primary-2) 100%);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.ed-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.42);
}

.ed-btn:active { transform: translateY(0); }
.ed-btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.ed-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.35rem 0;
  color: var(--ed-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.ed-divider::before,
.ed-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ed-border);
}

.ed-footer {
  text-align: center;
  font-size: 0.88rem;
  color: var(--ed-muted);
  margin-top: 1.25rem;
}

.ed-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--ed-radius);
  font-size: 0.85rem;
  margin-bottom: 1.1rem;
  font-weight: 500;
}

.ed-alert--success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--ed-success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.ed-alert--warning {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

html.auth-root.dark .ed-alert--warning { color: #fbbf24; }

.ed-error {
  display: block;
  font-size: 0.78rem;
  color: var(--ed-danger);
  margin-top: 0.35rem;
  font-weight: 500;
}

/* Solo card (forgot password) */
.ed-auth--solo .ed-auth__card {
  max-width: 440px;
  grid-template-columns: 1fr;
  min-height: auto;
}

.ed-auth--solo .ed-panel { padding: 2rem; }

/* Legacy class aliases for JS */
.au-digits-only,
.auth-digits-only {}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .ed-btn:hover { transform: none; }
}
