/* =========================================================
   ExamiAi — Global-app sign-in
   Clean · calm · product-grade
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0,0&display=swap');

:root {
  --brand: #2962FF;
  --brand2: #1A4CFF;
  --brand-soft: #EEF3FF;
  --ink: #0B1220;
  --muted: #667085;
  --line: #E8EDF5;
  --surface: #ffffff;
  --canvas: #F4F6FA;
  --radius: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 24px 48px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html { color-scheme: light only; }

.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 22px;
  line-height: 1;
  vertical-align: middle;
  user-select: none;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 480px at 12% -10%, rgba(41, 98, 255, 0.14), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(14, 165, 233, 0.1), transparent 50%),
    radial-gradient(600px 400px at 50% 110%, rgba(41, 98, 255, 0.06), transparent 55%),
    var(--canvas);
  overflow-x: hidden;
}

#pageLoader {
  position: fixed;
  inset: 0;
  background: rgba(244, 246, 250, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
#pageLoader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-box { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.loader-ring {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid #E8EDF5; border-top-color: var(--brand);
  animation: spin 0.7s linear infinite;
}
.loader-text { font-size: 13px; font-weight: 600; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ——— Brand panel (desktop left / compact mobile top) ——— */
.visual {
  display: none;
  color: #fff;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg, #0B1220 0%, #12255A 42%, #2962FF 100%);
}

.visual::before,
.visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.visual::before {
  width: 420px; height: 420px;
  right: -140px; top: -160px;
  background: rgba(255, 255, 255, 0.07);
  animation: visualOrb 12s ease-in-out infinite;
}
.visual::after {
  width: 280px; height: 280px;
  left: -100px; bottom: -120px;
  background: rgba(96, 165, 250, 0.18);
  animation: visualOrb 10s ease-in-out infinite reverse;
}
@keyframes visualOrb {
  0%,100% { transform: translate(0,0); }
  50% { transform: translate(12px,-16px); }
}
.visual-art {
  position: absolute;
  right: -4%;
  bottom: 6%;
  width: min(320px, 48%);
  opacity: .22;
  pointer-events: none;
  z-index: 0;
  filter: saturate(1.05);
}

.visual-card {
  position: relative;
  z-index: 1;
  max-width: 440px;
}

.visual-brand { margin-bottom: 36px; }

.visual-logo {
  display: block;
  width: min(200px, 55vw);
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.visual-brand-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
}

.visual h1 {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.12;
  margin: 0 0 14px;
  color: #fff;
  max-width: 11ch;
}

.visual-lead {
  font-size: 16px;
  line-height: 1.55;
  font-weight: 500;
  max-width: 32ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.student-benefits {
  display: grid;
  gap: 12px;
  margin-top: 40px;
}

.app-highlight {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 0;
  background: transparent;
  border: 0;
}
.app-highlight .material-symbols-rounded {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  color: #fff;
}
.app-highlight strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}
.app-highlight span:last-child {
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.78;
  font-weight: 500;
}

/* ——— Auth ——— */
.auth-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(28px, env(safe-area-inset-top))
    20px
    max(28px, env(safe-area-inset-bottom));
}

.auth-card {
  width: 100%;
  max-width: 420px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid rgba(232, 237, 245, 0.95);
  box-shadow:
    0 1px 1px rgba(15, 23, 42, 0.03),
    0 12px 28px rgba(15, 23, 42, 0.06),
    0 32px 64px rgba(15, 23, 42, 0.08);
  padding: 0 28px 28px;
  overflow: hidden;
  animation: authEnter 0.45s var(--ease) both;
  position: relative;
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

@keyframes authEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Logo needs dark ground — “Ai” + sparkles are white */
.auth-logo-plate {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0 -28px 28px;
  padding: 22px 28px;
  background:
    radial-gradient(420px 160px at 12% 20%, rgba(41, 98, 255, 0.35), transparent 60%),
    linear-gradient(135deg, #070B14 0%, #0F1B3D 55%, #12255A 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-logo {
  display: block;
  width: min(196px, 62vw);
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.auth-brand-fallback {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
}

.progress {
  display: none;
}

.stage-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 22px;
  padding: 6px;
  border-radius: 18px;
  background: #F1F4F9;
  border: 1px solid #E4E9F2;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7);
}

.stage {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 14px;
  color: #667085;
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.22s var(--ease), color 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, transform 0.22s var(--ease);
}

.stage-ico {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.05);
  color: #98A2B3;
  transition: background 0.22s ease, color 0.22s ease;
}
.stage-ico .material-symbols-rounded {
  font-size: 18px;
}

.stage-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.stage-copy strong {
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: inherit;
}
.stage-copy small {
  font-size: 11px;
  font-weight: 550;
  color: #98A2B3;
  line-height: 1.2;
}

.stage.active {
  background: #fff;
  color: var(--brand);
  border-color: rgba(41, 98, 255, 0.12);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}
.stage.active .stage-ico {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 14px rgba(41, 98, 255, 0.28);
}
.stage.active .stage-copy small {
  color: #5B6B8C;
}

.stage.done {
  background: rgba(255, 255, 255, 0.55);
  color: #0F766E;
}
.stage.done .stage-ico {
  background: #D1FAE5;
  color: #059669;
}
.stage.done .stage-copy small {
  color: #0F766E;
}

/* legacy */
.progress,
.stage-track,
.stage-dot,
.stage-label,
.stage-line {
  display: none;
}

.steps { display: none; }

.top-band { padding: 0; background: none; }

.app-pill { display: none; }

.top-band h2 {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.04em;
  margin: 0;
  line-height: 1.15;
  color: var(--ink);
}

.top-band > p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  max-width: 34ch;
}

.flash-top {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #ECFDF5;
  color: #15803D;
  font-size: 13px;
  font-weight: 650;
  border: 1px solid #D1FAE5;
}

.content { padding: 22px 0 0; }

.label {
  display: block;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.field-card {
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
}

.form-card {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.input, .select {
  width: 100%;
  min-height: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  padding: 0 16px;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
}
.input-wrap { position: relative; }
.input-wrap .input { padding-left: 46px; }
.field-icon {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  font-size: 15px;
  pointer-events: none;
}
.input:focus, .select:focus {
  border-color: #93C5FD;
  box-shadow: 0 0 0 4px rgba(41, 98, 255, 0.12);
}
.input[readonly] { background: #F8FAFC; color: var(--muted); }

.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 10px;
  font-weight: 500;
}
.hint-demo {
  margin-top: 12px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}
.hint-demo strong {
  color: var(--ink);
  font-weight: 650;
}

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: 1fr; }

.section-title,
.section-sub {
  display: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  min-height: 52px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  border: none;
  padding: 0 18px;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.985); }
.btn-primary {
  background: linear-gradient(180deg, #3B72FF 0%, var(--brand) 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(41, 98, 255, 0.22);
}
.btn-primary:hover { background: linear-gradient(180deg, #4B7DFF 0%, var(--brand2) 100%); box-shadow: 0 10px 22px rgba(41, 98, 255, 0.28); }
.btn-light {
  background: var(--brand-soft);
  color: var(--brand);
}
.btn-block { width: 100%; }
.btn-compact { min-height: 44px; font-size: 13px; border-radius: 12px; flex: 1; }
.btn[disabled] { opacity: 0.65; cursor: wait; }

/* Animated primary CTA */
.btn-animated {
  animation: btnPulse 2.4s ease-in-out infinite;
}
.btn-animated::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.28) 48%,
    transparent 62%
  );
  transform: translateX(-120%);
  animation: btnShine 2.8s var(--ease) infinite;
  pointer-events: none;
}
.btn-animated .btn-label,
.btn-animated .btn-arrow {
  position: relative;
  z-index: 1;
}
.btn-animated .btn-arrow {
  font-size: 18px;
  transition: transform 0.2s var(--ease);
}
.btn-animated:hover .btn-arrow {
  transform: translateX(3px);
}
.btn-animated:hover,
.btn-animated:focus-visible {
  animation: none;
}
.btn-animated:active::after {
  animation: none;
}

@keyframes btnShine {
  0%, 35% { transform: translateX(-120%); }
  60%, 100% { transform: translateX(120%); }
}
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 8px 20px rgba(41, 98, 255, 0.22); }
  50% { box-shadow: 0 10px 28px rgba(41, 98, 255, 0.38); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-animated,
  .btn-animated::after {
    animation: none;
  }
}

.otp-box {
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #F8FAFF 0%, #F4F6FA 100%);
  border: 1px solid var(--line);
  margin-bottom: 4px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.otp-box .section-title,
.otp-box .section-sub {
  display: block;
}
.otp-box .section-title {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--ink);
}
.otp-box .section-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  font-weight: 500;
  line-height: 1.45;
}
.otp-email {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
  word-break: break-all;
  letter-spacing: -0.01em;
}

.footer-note {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
  text-align: center;
  font-weight: 500;
}
.footer-note .tagline {
  display: none;
}
.footer-note a {
  color: var(--brand);
  font-weight: 650;
  text-decoration: none;
}
.footer-note a:hover { text-decoration: underline; }

.fade-up { animation: authEnter 0.45s var(--ease) both; }

.swal-mobile-toast { border-radius: 16px !important; }
.swal2-styled.swal2-confirm {
  background: #2962FF !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
}

/* Desktop split — global product layout */
@media (min-width: 960px) {
  .shell {
    display: grid;
    grid-template-columns: minmax(420px, 1.05fr) minmax(480px, 0.95fr);
  }

  .visual {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: 64px 56px;
  }

  .auth-area {
    min-height: 100vh;
    padding: 48px 40px;
    background: transparent;
  }

  .auth-card {
    max-width: 420px;
    padding: 0 36px 32px;
  }
  .auth-logo-plate {
    margin: 0 -36px 32px;
    padding: 26px 36px;
  }
  .auth-logo { width: 210px; }

  .grid.two { grid-template-columns: 1fr 1fr; }
  .footer-note .tagline { display: block; margin-bottom: 8px; }
}
