/* ==========================================================
   MAXZEETON.NG — TEACHER / ADMIN SIGN-IN
   Split layout: brand panel + form. Self-contained (does not load
   the marketing navbar/hero CSS), so nothing unstyled can flash.
   ========================================================== */

:root {
  --pl-brand: #E8192C;
  --pl-brand-dark: #C5141F;
  --pl-ink: #0D1117;
  --pl-muted: #4B5563;
  --pl-line: #E5E7EB;
  --pl-bg: #F4F5F8;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: #0B0D14; -webkit-text-size-adjust: 100%; }
body.portal-login {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Outfit', system-ui, sans-serif;
  color: var(--pl-ink);
  background: var(--pl-bg);
  overflow-x: hidden;
}
body.portal-login[data-portal-login="admin"] { --pl-brand: #E8192C; }

/* Splash while we check whether you're already signed in — no form flash. */
body.portal-login:not(.portal-ready) .pl-shell { visibility: hidden; }
body.portal-login:not(.portal-ready)::before {
  content: '';
  position: fixed; inset: 0; z-index: 50;
  background: #0B0D14 url('/assets/images/logo/maxzeeton_logo.png') center calc(50% - 20px) / 56px no-repeat;
}
body.portal-login:not(.portal-ready)::after {
  content: '';
  position: fixed; left: 50%; top: calc(50% + 32px); z-index: 51;
  width: 26px; height: 26px; margin-left: -13px;
  border: 3px solid rgba(255,255,255,.18); border-top-color: var(--pl-brand);
  border-radius: 50%;
  animation: pl-spin .8s linear infinite;
}
/* If scripts fail entirely, still show the form after 6s. */
body.portal-login:not(.portal-ready) .pl-shell { animation: pl-unhide 0s 6s forwards; }
body.portal-login:not(.portal-ready)::before { animation: pl-hide 0s 6s forwards; }
body.portal-login:not(.portal-ready)::after { animation: pl-spin .8s linear infinite, pl-hide 0s 6s forwards; }
@keyframes pl-spin { to { transform: rotate(360deg); } }
@keyframes pl-unhide { to { visibility: visible; } }
@keyframes pl-hide { to { opacity: 0; visibility: hidden; } }

.pl-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

/* ---------- Brand panel ---------- */
.pl-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(28px, 5vw, 56px);
  color: #fff;
  background: linear-gradient(160deg, #0B0D14 0%, #12141D 55%, #1A0E13 100%);
}
.pl-brand::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 30% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 30%, #000 20%, transparent 75%);
}
.pl-brand::after {
  content: '';
  position: absolute; width: 520px; height: 520px; right: -180px; bottom: -220px;
  background: radial-gradient(circle, rgba(232,25,44,.38), transparent 65%);
  filter: blur(10px);
}
.pl-brand > * { position: relative; z-index: 1; }

.pl-logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: 'Syne', sans-serif; font-weight: 800; font-size: 20px; }
.pl-logo img { width: 34px; height: 34px; object-fit: contain; }
.pl-logo .ng { color: var(--pl-brand); }

.pl-brand h2 { font-family: 'Syne', sans-serif; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.1; margin: 0 0 14px; letter-spacing: -.5px; }
.pl-brand h2 span { color: var(--pl-brand); }
.pl-brand p.lead { margin: 0; color: rgba(255,255,255,.72); font-size: 16px; line-height: 1.6; max-width: 46ch; }

.pl-points { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; }
.pl-points li { display: flex; align-items: flex-start; gap: 12px; color: rgba(255,255,255,.85); font-size: 14.5px; line-height: 1.5; }
.pl-points i { flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(232,25,44,.16); color: #FF7A86; font-size: 14px; }
.pl-brand small { color: rgba(255,255,255,.45); font-size: 12.5px; }

/* ---------- Form side ---------- */
.pl-formside { display: grid; place-items: center; padding: clamp(24px, 5vw, 56px); background: #fff; }
.pl-card { width: 100%; max-width: 420px; }
.pl-mobile-logo { display: none; margin-bottom: 26px; color: var(--pl-ink); }
.pl-mobile-logo .ng { color: var(--pl-brand); }
.pl-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: #FFF0F2; color: var(--pl-brand); font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.pl-card h1 { font-family: 'Syne', sans-serif; font-size: 30px; line-height: 1.15; margin: 14px 0 6px; letter-spacing: -.3px; }
.pl-sub { margin: 0 0 26px; color: var(--pl-muted); font-size: 15px; line-height: 1.55; }

.pl-form { display: grid; gap: 16px; }
.pl-field { display: grid; gap: 6px; }
.pl-field label { font-size: 13px; font-weight: 600; color: #1F2937; }
.pl-input { position: relative; }
.pl-input > i.lead-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #9CA3AF; font-size: 14px; pointer-events: none; }
.pl-input input {
  width: 100%;
  height: 50px;
  padding: 0 46px 0 42px;
  border: 1.5px solid var(--pl-line);
  border-radius: 12px;
  background: #FAFAFC;
  color: var(--pl-ink);
  font: inherit;
  font-size: 16px; /* prevents iOS zoom on focus */
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.pl-input input::placeholder { color: #9CA3AF; }
.pl-input input:hover { border-color: #D1D5DB; }
.pl-input input:focus { outline: none; border-color: var(--pl-brand); background: #fff; box-shadow: 0 0 0 4px rgba(232,25,44,.10); }
.pl-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 10px; background: none; color: #6B7280; cursor: pointer; }
.pl-toggle:hover { color: var(--pl-ink); background: #F3F4F6; }

.pl-row { display: flex; justify-content: flex-end; }
.pl-link { color: var(--pl-brand); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.pl-link:hover { text-decoration: underline; }

.pl-submit {
  height: 52px; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, var(--pl-brand), var(--pl-brand-dark));
  color: #fff; font: inherit; font-size: 15px; font-weight: 700; letter-spacing: .2px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 20px rgba(232,25,44,.28);
  transition: transform .12s, box-shadow .12s, opacity .12s;
}
.pl-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(232,25,44,.34); }
.pl-submit:disabled { opacity: .7; cursor: progress; }

.pl-msg { min-height: 20px; margin: 0; font-size: 14px; line-height: 1.45; }
.pl-msg[data-state='error'] { color: #B91C1C; background: #FEF2F2; border: 1px solid #FECACA; padding: 10px 12px; border-radius: 10px; }
.pl-msg[data-state='info'] { color: var(--pl-muted); }

.pl-alt { margin: 26px 0 0; padding-top: 20px; border-top: 1px solid var(--pl-line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: 13.5px; color: var(--pl-muted); }
.pl-alt a { color: var(--pl-ink); font-weight: 600; text-decoration: none; }
.pl-alt a:hover { color: var(--pl-brand); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .pl-shell { grid-template-columns: minmax(0, 1fr); }
  .pl-brand { display: none; }
  .pl-formside { place-items: start center; padding: 28px 20px 40px; background: linear-gradient(180deg, #fff 0%, #FAFAFC 100%); }
  .pl-mobile-logo { display: inline-flex; }
  .pl-card h1 { font-size: 26px; }
}

/* ---------- Password-reset pages ---------- */
.pl-section { margin: 0 0 4px; }
.pl-section[hidden] { display: none !important; }
.pl-section h2 { font-family: 'Syne', sans-serif; font-size: 16px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.pl-section h2 i { color: var(--pl-brand); font-size: 14px; }
.pl-or { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: #9CA3AF; font-size: 12.5px; text-transform: uppercase; letter-spacing: .8px; }
.pl-or::before, .pl-or::after { content: ''; flex: 1; height: 1px; background: var(--pl-line, #E5E7EB); }
.pl-submit--ghost { background: #fff; color: var(--pl-brand); border: 1.5px solid var(--pl-brand); box-shadow: none; }
.pl-submit--ghost:hover:not(:disabled) { background: #FFF0F2; box-shadow: none; }
.pl-msg[data-state='success'] { color: #166534; background: #F0FDF4; border: 1px solid #BBF7D0; padding: 10px 12px; border-radius: 10px; }
.pl-question { padding: 10px 12px; background: #F9FAFB; border: 1px dashed #D1D5DB; border-radius: 10px; color: #374151; }
.pl-opt { font-weight: 400; color: #9CA3AF; }
.pl-textarea { width: 100%; border: 1.5px solid #E5E7EB; background: #F9FAFB; border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 15px; color: var(--pl-ink); resize: vertical; min-height: 84px; }
.pl-textarea:focus { outline: none; border-color: var(--pl-brand); background: #fff; box-shadow: 0 0 0 4px rgba(232,25,44,.10); }
.pl-alt .fa-arrow-left { font-size: 11px; margin-right: 4px; }
