/* Login / auth screens — dark, glowing-grid theme. Deliberately scoped to
   its own file and its own dark palette: internal Admin/Teacher tool
   screens (app.css) stay plain and light on purpose — this treatment is
   for the pages a person sees before they're "in the tool", where a bit
   of brand personality earns its keep without hurting scannability of
   data tables (there are no data tables here). */

/* Browsers apply their own default margin/height to html/body — left
   alone, that shows up as a strip of plain white around the dark
   full-bleed screen below (worst on mobile, but visible on desktop
   too). Reset it here so .auth-screen actually reaches every edge. */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #060b16;
}

.auth-screen {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  background: #060b16;
}

/* ---------- Hero panel (left / top) ---------- */

.auth-hero {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  background:
    radial-gradient(circle at 15% 15%, rgba(34,211,238,0.16), transparent 45%),
    linear-gradient(160deg, #123156 0%, #0c2544 35%, #081a33 65%, #050f21 100%);
  color: #fff;
  box-sizing: border-box;
}

.auth-hero-brand {
  position: relative;
  z-index: 2;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.auth-hero-copy {
  position: relative;
  z-index: 2;
  max-width: 480px;
}

.auth-hero-copy h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  line-height: 1.15;
  font-weight: 800;
  margin: 0 0 0.75rem;
  animation: auth-fade-up 0.6s ease-out both;
}

.auth-hero-copy p {
  color: #9fb4d4;
  font-size: 1.02rem;
  margin: 0;
  animation: auth-fade-up 0.6s ease-out 0.1s both;
}

.auth-hero-footer {
  position: relative;
  z-index: 2;
  color: #6f89ad;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Glowing tile grid — decorative, bottom-right of the hero panel.
   Tiles are plain divs (see login.php / register.php for the loop that
   emits them) so each can get its own animation-delay without hand
   writing dozens of nth-child rules. */
.auth-grid {
  position: absolute;
  right: -40px;
  bottom: -40px;
  display: grid;
  grid-template-columns: repeat(5, 56px);
  grid-auto-rows: 56px;
  gap: 10px;
  z-index: 1;
  transform: rotate(-6deg);
}

.auth-grid .tile {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(34,211,238,0.35), rgba(15,118,150,0.12));
  box-shadow: 0 0 0 rgba(34,211,238,0);
  animation: tile-glow 4.5s ease-in-out infinite;
}

@keyframes tile-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(34,211,238,0); opacity: 0.55; }
  50% { box-shadow: 0 0 22px rgba(34,211,238,0.55); opacity: 1; }
}

/* ---------- Form panel (right / bottom) ---------- */

.auth-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #0a1120;
  box-sizing: border-box;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: #101a2e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 2rem;
  box-sizing: border-box;
  animation: auth-fade-up 0.5s ease-out both;
}

.auth-card h2 {
  color: #fff;
  font-size: 1.4rem;
  margin: 0 0 0.35rem;
}

.auth-card .auth-subtitle {
  color: #8ea3c4;
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}

.auth-card label {
  display: block;
  color: #c3d1e8;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.auth-card .form-group { margin-bottom: 1.1rem; }

.auth-card input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  background: #0a1224;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-card input::placeholder { color: #4a5b7a; }

.auth-card input:focus {
  outline: none;
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34,211,238,0.18);
}

.auth-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(120deg, #22d3ee, #0ea5b7);
  color: #06222b;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.auth-btn:hover {
  box-shadow: 0 6px 20px rgba(34,211,238,0.3);
  transform: translateY(-1px);
}

.auth-alert {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  animation: alert-in 0.25s ease-out both;
}
.auth-alert-error { background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.auth-alert-success { background: rgba(34,197,94,0.12); color: #86efac; border: 1px solid rgba(34,197,94,0.3); }

.auth-link {
  color: #22d3ee;
  font-size: 0.85rem;
  text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

.auth-forgot {
  margin: 1.25rem 0 0;
  text-align: center;
  color: #6f89ad;
  font-size: 0.82rem;
}

@keyframes auth-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero panel only shows on wider screens — same reasoning as before:
   on a phone this whole block of markup+CSS never needs to render, and
   there are no images to fetch either way in this version, so mobile
   just gets the card centered on the dark background full-width. */
@media (max-width: 899px) {
  .auth-hero { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-hero-copy h1, .auth-hero-copy p, .auth-card, .auth-alert { animation: none; }
  .auth-grid .tile { animation: none; opacity: 0.8; }
}
