/* ============================================================
   LUMOS — Auth Pages (Login & Register)
   ============================================================ */

#auth-container {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Grade discreta que some nas bordas */
  background:
    radial-gradient(ellipse at center, transparent 15%, var(--bg-primary) 72%),
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--bg-primary);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
[data-theme="light"] #auth-container {
  background:
    radial-gradient(ellipse at center, transparent 15%, var(--bg-primary) 72%),
    linear-gradient(rgba(15,23,42,.045) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(15,23,42,.045) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--bg-primary);
}

/* Aurora sutil nas cores da marca (dourado da lâmpada + prata) */
#auth-container::before,
#auth-container::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: -1;
  will-change: transform;
}
#auth-container::before {
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(245, 213, 106, .14), transparent 65%);
  top: -180px; left: -140px;
  animation: authAurora 18s var(--ease-out) infinite alternate;
}
#auth-container::after {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(200, 205, 213, .12), transparent 65%);
  bottom: -160px; right: -120px;
  animation: authAurora 22s var(--ease-out) infinite alternate-reverse;
}
@keyframes authAurora {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(60px, 40px, 0) scale(1.12); }
}

/* Auth card (vidro com borda em gradiente) */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg), var(--highlight), 0 0 80px rgba(245, 213, 106, 0.06);
  position: relative;
  animation: authSlide .5s var(--ease-out);
}
.auth-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, rgba(245,213,106,.35), rgba(255,255,255,.06) 35%, rgba(255,255,255,0) 60%, rgba(200,205,213,.18));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes authSlide {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Auth brand */
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
  margin-bottom: 2rem;
}
.auth-brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-brand-icon .brand-bulb {
  height: 56px;
  width: auto;
  filter: drop-shadow(0 0 18px rgba(255, 213, 79, .35));
}
.auth-brand-text {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #f5d56a 0%, #c8cdd5 65%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Auth heading */
.auth-heading { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: .25rem; }
.auth-subheading { font-size: .9rem; color: var(--text-secondary); margin-bottom: 1.75rem; }

/* Auth form */
.auth-form { display: flex; flex-direction: column; gap: 1.125rem; }

/* Auth footer */
.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: .875rem;
  color: var(--text-secondary);
}
.auth-footer a {
  color: var(--primary);
  font-weight: 600;
}
.auth-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Botão principal do login */
.auth-submit { margin-top: .25rem; gap: .6rem; }

/* Alerta de erro do login */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .75rem .9rem;
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, .35);
  color: var(--text-primary);
  font-size: .85rem;
  line-height: 1.45;
  animation: authShake .4s var(--ease-out);
}
.auth-alert::before {
  content: '!';
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  margin-top: 1px;
}
@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* Mostrar/ocultar senha */
.input-wrap.has-toggle input { padding-right: 44px; }
.input-wrap .input-toggle {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}
.input-wrap .input-toggle:hover { color: var(--text-primary); background: var(--surface-hover); }
.input-wrap .input-toggle svg {
  position: static;
  transform: none;
  width: 18px; height: 18px;
  pointer-events: none;
}
.input-wrap .input-toggle .eye-closed,
.input-wrap .input-toggle.is-visible .eye-open { display: none; }
.input-wrap .input-toggle.is-visible .eye-closed { display: block; }

.auth-capslock { color: var(--warning); font-weight: 500; }

/* Botão de demonstração */
.auth-demo-btn {
  font-size: .8rem;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 99px;
  padding: 7px 16px;
}
.auth-demo-btn:hover { color: var(--text-primary); border-color: var(--border-light); border-style: solid; }

/* Indicador de status do servidor */
.auth-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin: 1.5rem auto 0;
  width: fit-content;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border-subtle);
  transition: color var(--transition), border-color var(--transition);
}
.auth-status-dot {
  position: relative;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}
.auth-status-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: inherit;
  opacity: 0;
}
.auth-status[data-state="checking"] .auth-status-dot { animation: statusBlink 1s ease-in-out infinite; }
.auth-status[data-state="online"]   { color: var(--text-secondary); }
.auth-status[data-state="online"]   .auth-status-dot { background: var(--success); }
.auth-status[data-state="online"]   .auth-status-dot::after { animation: statusPing 2.4s var(--ease-out) infinite; }
.auth-status[data-state="degraded"] { color: var(--warning); border-color: rgba(245, 158, 11, .3); }
.auth-status[data-state="degraded"] .auth-status-dot { background: var(--warning); }
.auth-status[data-state="offline"]  { color: var(--danger); border-color: rgba(239, 68, 68, .3); }
.auth-status[data-state="offline"]  .auth-status-dot { background: var(--danger); }
@keyframes statusPing {
  0%   { transform: scale(.6); opacity: .6; }
  80%, 100% { transform: scale(1.8); opacity: 0; }
}
@keyframes statusBlink { 50% { opacity: .3; } }

/* ---- REGISTER: Multi-step ---- */
.auth-card-wide { max-width: 580px; }

/* Progress bar */
.register-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 2rem;
}
.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .375rem;
  flex: 1;
  position: relative;
}
.progress-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.progress-step.completed:not(:last-child)::after { background: var(--primary); }
.progress-step-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  transition: all var(--transition);
}
.progress-step.active .progress-step-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.progress-step.completed .progress-step-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-inverse);
}
.progress-step-label {
  font-size: .7rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.progress-step.active .progress-step-label,
.progress-step.completed .progress-step-label { color: var(--primary); }

/* Step container */
.register-step { display: none; animation: authSlide .3s ease; }
.register-step.active { display: block; }

/* Subject row in register */
.subject-row {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: 1rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: .75rem;
  position: relative;
}
.subject-row .remove-subject-btn {
  position: absolute;
  top: .5rem; right: .5rem;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}
.subject-row .remove-subject-btn:hover { background: var(--danger); color: #fff; }
.subject-fields { flex: 1; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }

@media (max-width: 500px) {
  .subject-fields { grid-template-columns: 1fr; }
  .auth-card { padding: 1.75rem 1.25rem; }
  #auth-container { padding: 1rem; align-items: flex-start; padding-top: max(1.5rem, env(safe-area-inset-top)); }
}

/* Day-of-week checkboxes */
.days-wrap { display: flex; flex-wrap: wrap; gap: .4rem; }
.day-chip {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 36px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  color: var(--text-secondary);
}
.day-chip.selected {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

/* Color picker for subjects */
.color-picker { display: flex; gap: .4rem; flex-wrap: wrap; }
.color-option {
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: all var(--transition);
}
.color-option.selected { border-color: var(--text-primary); transform: scale(1.15); }

/* Login/register toggle animation */
.auth-slide-enter {
  animation: authSlide .45s var(--ease-out);
}