/* Darres auth — fast, illustration-first */
:root {
  --au-navy: #0d1b2a;
  --au-navy-2: #132536;
  --au-teal: #00bfa6;
  --au-teal-dim: #0a9e8b;
  --au-bg: #f3f7f9;
  --au-surface: #ffffff;
  --au-text: #0d1b2a;
  --au-muted: #5a7080;
  --au-border: rgba(13, 27, 42, 0.1);
  --au-danger: #dc5348;
  --au-ok: #16a06b;
  --au-radius: 18px;
  --au-shadow: 0 18px 48px rgba(13, 27, 42, 0.12);
  --au-display: "Outfit", system-ui, sans-serif;
  --au-body: system-ui, -apple-system, "Segoe UI", sans-serif;
}

html.auth-root.dark {
  --au-bg: #071018;
  --au-surface: #0f1f2e;
  --au-text: #eef6f8;
  --au-muted: #8aa0b0;
  --au-border: rgba(238, 246, 248, 0.12);
  --au-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

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

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

body.auth-body {
  font-family: var(--au-body);
  background: var(--au-bg);
  color: var(--au-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

html[dir="rtl"] body.auth-body {
  font-family: Cairo, var(--au-body);
}

html[dir="rtl"] .au-brand__mark,
html[dir="ltr"] .au-brand__ar { font-family: Cairo, var(--au-body); }

/* Shell */
.au {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  position: relative;
}

.au__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 8% 12%, rgba(0, 191, 166, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 45% at 92% 88%, rgba(13, 27, 42, 0.08), transparent 50%),
    var(--au-bg);
  pointer-events: none;
}

html.auth-root.dark .au__bg {
  background:
    radial-gradient(ellipse 60% 50% at 8% 12%, rgba(0, 191, 166, 0.16), transparent 55%),
    radial-gradient(ellipse 50% 45% at 92% 88%, rgba(0, 191, 166, 0.06), transparent 50%),
    var(--au-bg);
}

.au__bar {
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top));
  inset-inline: 1rem;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.au__bar > * { pointer-events: auto; }

.au__back,
.au__theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--au-border);
  background: color-mix(in srgb, var(--au-surface) 88%, transparent);
  backdrop-filter: blur(8px);
  color: var(--au-text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13, 27, 42, 0.06);
}

.au__back { padding: 0 0.95rem; }
.au__theme { width: 40px; padding: 0; color: var(--au-muted); }

.au__stage {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  background: var(--au-surface);
  border: 1px solid var(--au-border);
  border-radius: calc(var(--au-radius) + 6px);
  box-shadow: var(--au-shadow);
  overflow: hidden;
  animation: au-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.au__stage--solo { grid-template-columns: 1fr; max-width: 440px; }

@keyframes au-rise {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* Visual panel */
.au-visual {
  position: relative;
  min-height: 420px;
  background:
    linear-gradient(160deg, var(--au-navy) 0%, var(--au-navy-2) 48%, #0a3d3a 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  overflow: hidden;
}

.au-visual__glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 191, 166, 0.35), transparent 68%);
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  filter: blur(2px);
  animation: au-pulse 4.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes au-pulse {
  0%, 100% { opacity: 0.55; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.9; transform: translateX(-50%) scale(1.08); }
}

  .au-brand {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: 1.25rem;
}

.au-brand__logo {
  display: block;
  margin: 0 auto 0.75rem;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.au-brand__ar {
  display: block;
  font-size: clamp(2.1rem, 4vw, 2.7rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  color: #fff;
}

.au-brand__mark {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--au-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--au-teal);
}

.au-scene {
  position: relative;
  z-index: 2;
  width: min(280px, 78%);
  aspect-ratio: 1;
}

.au-scene svg { width: 100%; height: 100%; display: block; }

.au-float {
  animation: au-float 5s ease-in-out infinite;
  transform-origin: center;
}

.au-float--delay { animation-delay: -2.2s; }
.au-float--slow { animation-duration: 7s; }

@keyframes au-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.au-orbit {
  animation: au-spin 18s linear infinite;
  transform-origin: 140px 140px;
}

@keyframes au-spin {
  to { transform: rotate(360deg); }
}

.au-play-pulse {
  animation: au-play 2.4s ease-in-out infinite;
  transform-origin: 140px 148px;
}

@keyframes au-play {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.92; }
}

/* Form panel */
.au-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.35rem, 3.5vw, 2.4rem);
  min-height: 420px;
}

.au-panel__head {
  margin-bottom: 1.25rem;
}

.au-panel__head h1 {
  margin: 0;
  font-family: var(--au-display);
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

html[dir="rtl"] .au-panel__head h1 { font-family: Cairo, var(--au-display); }

.au-panel__head p {
  margin: 0.35rem 0 0;
  color: var(--au-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Teacher chip (private portal) */
.au-teacher {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--au-teal) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--au-teal) 22%, transparent);
  animation: au-rise 0.5s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.au-teacher__photo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--au-teal) 55%, #fff);
  background: var(--au-navy);
  flex-shrink: 0;
}

.au-teacher__meta { min-width: 0; }

.au-teacher__name {
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.au-teacher__tag {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--au-teal-dim);
}

html.auth-root.dark .au-teacher__tag { color: var(--au-teal); }

/* Fields */
.au-form { display: flex; flex-direction: column; gap: 0.85rem; }

.au-field { display: flex; flex-direction: column; gap: 0.35rem; }

.au-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--au-muted);
}

.au-label--req::after {
  content: " *";
  color: var(--au-teal-dim);
}

.au-input,
.au-select {
  width: 100%;
  height: 46px;
  padding: 0 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--au-border);
  background: var(--au-bg);
  color: var(--au-text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

html.auth-root.dark .au-input,
html.auth-root.dark .au-select {
  background: color-mix(in srgb, var(--au-navy) 55%, var(--au-surface));
}

.au-input:focus,
.au-select:focus {
  outline: none;
  border-color: var(--au-teal);
  box-shadow: 0 0 0 3px rgba(0, 191, 166, 0.18);
}

.au-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.au-input-wrap__icon {
  position: absolute;
  inset-inline-start: 0.85rem;
  color: var(--au-muted);
  display: flex;
  pointer-events: none;
}

.au-input-wrap .au-input { padding-inline-start: 2.55rem; }

.au-phone {
  display: flex;
  gap: 0.5rem;
}

.au-phone__prefix {
  flex: 0 0 auto;
  min-width: 3.4rem;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--au-border);
  background: var(--au-bg);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--au-muted);
  direction: ltr;
}

.au-phone__input { flex: 1; }

.au-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.au-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

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

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

.au-link {
  color: var(--au-teal-dim);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.85rem;
}

html.auth-root.dark .au-link { color: var(--au-teal); }

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

.au-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 48px;
  margin-top: 0.25rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--au-teal) 0%, var(--au-teal-dim) 100%);
  color: #04241f;
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.au-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.au-btn:active { transform: none; }
.au-btn:disabled { opacity: 0.65; cursor: wait; transform: none; }

.au-footer {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--au-muted);
}

.au-legal {
  margin: 0.55rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--au-muted);
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.au-alert {
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.au-alert--ok {
  background: color-mix(in srgb, var(--au-ok) 14%, transparent);
  color: var(--au-ok);
  border: 1px solid color-mix(in srgb, var(--au-ok) 28%, transparent);
}

.au-alert--warn {
  background: color-mix(in srgb, #f0a202 16%, transparent);
  color: #9a6700;
  border: 1px solid color-mix(in srgb, #f0a202 30%, transparent);
}

.au-alert--err {
  background: color-mix(in srgb, var(--au-danger) 12%, transparent);
  color: var(--au-danger);
  border: 1px solid color-mix(in srgb, var(--au-danger) 25%, transparent);
}

.au-error {
  color: var(--au-danger);
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0;
}

.au-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--au-muted);
}

/* Mobile */
@media (max-width: 860px) {
  .au__stage {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .au-visual {
    min-height: 0;
    padding: 1.35rem 1.1rem 1.1rem;
  }

  .au-scene {
    width: min(168px, 52%);
    margin-top: 0.25rem;
  }

  .au-brand { margin-bottom: 0.5rem; }
  .au-brand__ar { font-size: 1.75rem; }

  .au-panel {
    min-height: 0;
    padding: 1.25rem 1.15rem 1.4rem;
  }

  .au-visual__glow {
    width: 180px;
    height: 180px;
    top: 8%;
  }
}

@media (max-width: 480px) {
  .au-grid-2 { grid-template-columns: 1fr; }
  .au { padding-inline: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .au__stage,
  .au-teacher,
  .au-float,
  .au-orbit,
  .au-play-pulse,
  .au-visual__glow {
    animation: none !important;
  }
}

