/* ==========================================================
   EMIS CBT STUDENT LOGIN — Unique Student Portal UI
========================================================== */

:root {
  --primary: #0f2b46;
  --primary-dark: #071827;
  --accent: #e11d48;
  --accent-dark: #be123c;

  --blue: #2563eb;
  --gold: #f59e0b;
  --green: #16a34a;

  --bg: #f5f8fc;
  --white: #ffffff;

  --text-main: #102a43;
  --text-muted: #64748b;
  --text-soft: #94a3b8;

  --border: #e2e8f0;

  --shadow-sm: 0 10px 26px rgba(15, 23, 42, 0.07);
  --shadow-md: 0 22px 56px rgba(15, 23, 42, 0.13);
  --shadow-lg: 0 34px 85px rgba(8, 26, 43, 0.2);

  --transition: 220ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-main);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

.hidden {
  display: none !important;
}

/* ==========================================================
   PAGE
========================================================== */

.student-login-page {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 10%, rgba(37, 99, 235, 0.12), transparent 28%),
    radial-gradient(circle at 90% 15%, rgba(225, 29, 72, 0.1), transparent 26%),
    radial-gradient(circle at 55% 100%, rgba(245, 158, 11, 0.12), transparent 34%),
    linear-gradient(135deg, #f8fbff 0%, #eef5ff 48%, #fff7fb 100%);
}

.student-stage {
  position: relative;
  min-height: 100vh;
  padding: 1.4rem;
}

.stage-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.orb-one {
  width: 220px;
  height: 220px;
  top: 7%;
  left: -70px;
  background: rgba(37, 99, 235, 0.16);
}

.orb-two {
  width: 280px;
  height: 280px;
  right: -90px;
  top: 12%;
  background: rgba(225, 29, 72, 0.12);
}

.orb-three {
  width: 210px;
  height: 210px;
  left: 45%;
  bottom: -90px;
  background: rgba(245, 158, 11, 0.14);
}

/* ==========================================================
   TOPBAR
========================================================== */

.student-topbar {
  position: relative;
  z-index: 3;
  max-width: 1180px;
  margin: 0 auto;
  min-height: 74px;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.student-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text-main);
  text-decoration: none;
}

.student-brand img {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  object-fit: cover;
  background: var(--white);
  padding: 3px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--shadow-sm);
}

.student-brand div {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.student-brand strong {
  font-family: Poppins, Inter, sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.student-brand span {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.top-status {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.top-status span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
}

.top-status i {
  color: var(--green);
  font-size: 0.55rem;
}

/* ==========================================================
   LAYOUT
========================================================== */

.student-layout {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  min-height: calc(100vh - 102px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  align-items: center;
  gap: 2.2rem;
}

/* ==========================================================
   LEFT CONTENT
========================================================== */

.student-welcome {
  position: relative;
  padding: 1rem 0;
}

.welcome-badge {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(225, 29, 72, 0.09);
  color: var(--accent);
  border: 1px solid rgba(225, 29, 72, 0.16);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.student-welcome h1 {
  max-width: 650px;
  margin: 0;
  font-family: Poppins, Inter, sans-serif;
  color: var(--primary-dark);
  font-size: clamp(2.4rem, 5vw, 5.2rem);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: -0.07em;
}

.student-welcome p {
  max-width: 520px;
  margin: 1.1rem 0 0;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.7;
  font-weight: 600;
}

/* ==========================================================
   PREVIEW CARD
========================================================== */

.exam-preview-card {
  width: min(100%, 510px);
  margin-top: 1.6rem;
  padding: 1.1rem;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62));
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.preview-top {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.preview-icon {
  width: 58px;
  height: 58px;
  min-width: 58px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--blue));
  color: var(--white);
  font-size: 1.35rem;
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.22);
}

.preview-top span {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.preview-top strong {
  display: block;
  margin-top: 0.15rem;
  color: var(--primary-dark);
  font-size: 1.2rem;
  font-weight: 950;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.preview-grid div {
  min-height: 82px;
  padding: 0.8rem;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 0.4rem;
  border-radius: 20px;
  background: rgba(248, 250, 252, 0.86);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.preview-grid i {
  color: var(--accent);
  font-size: 1.15rem;
}

.preview-grid span {
  color: var(--text-main);
  font-size: 0.76rem;
  font-weight: 900;
}

.student-mini-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.2rem;
}

.student-mini-tips span {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 38px;
  padding: 0 0.8rem;
  border-radius: 999px;
  background: var(--white);
  color: var(--text-muted);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 0.78rem;
  font-weight: 850;
}

.student-mini-tips i {
  color: var(--green);
}

/* ==========================================================
   LOGIN CARD
========================================================== */

.student-auth {
  display: grid;
  place-items: center;
}

.student-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 1.65rem;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  animation: cardEnter 520ms ease both;
}

.card-glow {
  position: absolute;
  width: 190px;
  height: 190px;
  right: -80px;
  top: -80px;
  border-radius: 999px;
  background: rgba(225, 29, 72, 0.1);
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-header {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 1.05rem;
}

.logo-wrap {
  width: 74px;
  height: 74px;
  margin: 0 auto 0.75rem;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.logo-wrap img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 18px;
}

.card-kicker {
  display: inline-flex;
  margin-bottom: 0.32rem;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-header h2 {
  margin: 0;
  font-family: Poppins, Inter, sans-serif;
  color: var(--primary-dark);
  font-size: 1.55rem;
  font-weight: 850;
  letter-spacing: -0.045em;
}

/* ==========================================================
   ERROR
========================================================== */

.error-banner {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin-bottom: 0.95rem;
  padding: 0.82rem;
  border-radius: 17px;
  background: rgba(225, 29, 72, 0.08);
  border: 1px solid rgba(225, 29, 72, 0.18);
  color: var(--accent);
  animation: errorEnter 280ms ease both;
}

@keyframes errorEnter {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error-banner strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 900;
}

.error-banner span {
  display: block;
  margin-top: 0.08rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
}

/* ==========================================================
   FORM
========================================================== */

.login-form {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.82rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.38rem;
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 850;
}

.input-box {
  position: relative;
  display: flex;
  align-items: center;
  transition: transform var(--transition);
}

.input-icon {
  position: absolute;
  left: 0.95rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  pointer-events: none;
  transition: color var(--transition);
}

.input-box input {
  width: 100%;
  height: 50px;
  padding: 0 0.95rem 0 2.65rem;
  border-radius: 17px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 720;
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

.input-box input::placeholder {
  color: var(--text-soft);
  font-weight: 650;
}

.input-box:focus-within .input-icon {
  color: var(--accent);
}

.input-box input:focus {
  border-color: rgba(225, 29, 72, 0.42);
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.1);
  background: var(--white);
}

/* ==========================================================
   OPTIONS
========================================================== */

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.05rem;
}

.remember-row {
  display: inline-flex;
  align-items: center;
  gap: 0.43rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.remember-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.secure-note {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 850;
}

/* ==========================================================
   BUTTON
========================================================== */

.login-btn {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.58rem;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary), var(--accent));
  color: var(--white);
  font-size: 0.92rem;
  font-weight: 900;
  box-shadow: 0 18px 34px rgba(15, 43, 70, 0.22);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    filter var(--transition);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 23px 46px rgba(15, 43, 70, 0.27);
  filter: saturate(1.07);
}

.login-btn:active {
  transform: translateY(0) scale(0.99);
}

.login-btn:disabled {
  cursor: wait;
  opacity: 0.88;
}

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
}

/* ==========================================================
   HELP / FOOTER
========================================================== */

.student-help-strip {
  position: relative;
  z-index: 1;
  margin-top: 1rem;
  padding: 0.78rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 17px;
  background: rgba(15, 43, 70, 0.06);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.student-help-strip i {
  color: var(--accent);
}

.footer-text {
  position: relative;
  z-index: 1;
  margin: 0.9rem 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.footer-text strong {
  color: var(--text-main);
}

/* ==========================================================
   JS STATES / TOAST
========================================================== */

.student-busy {
  cursor: wait;
}

.input-box.has-error input {
  border-color: rgba(225, 29, 72, 0.75);
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.12);
}

.input-box.is-focused {
  transform: translateY(-1px);
}

.input-box.has-value .input-icon {
  color: var(--primary);
}

.shake-card {
  animation: shakeCard 360ms ease both;
}

@keyframes shakeCard {
  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-7px);
  }

  40% {
    transform: translateX(7px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

.toast-container {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: min(360px, calc(100vw - 2rem));
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.82rem 0.88rem;
  border-radius: 16px;
  background: rgba(8, 26, 43, 0.96);
  color: #ffffff;
  box-shadow: 0 18px 45px rgba(8, 26, 43, 0.25);
  animation: toastIn 240ms ease both;
}

.toast.success {
  background: var(--primary);
}

.toast.error {
  background: var(--accent);
}

.toast.warning {
  background: #d97706;
}

.toast button {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.toast.is-leaving {
  animation: toastOut 230ms ease both;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
}

/* ==========================================================
   ORBIT LOADER
========================================================== */

.btn-loader,
.dynamic-loader {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.btn-loader {
  width: 28px;
  height: 28px;
}

.dynamic-loader {
  width: 82px;
  height: 82px;
}

.btn-loader .outer-circle,
.btn-loader .inner-circle,
.dynamic-loader .outer-circle,
.dynamic-loader .inner-circle {
  position: absolute;
  border-radius: 50%;
  border: 0;
  animation: orbitSpin 1.05s linear infinite;
}

.btn-loader .outer-circle {
  width: 27px;
  height: 27px;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.btn-loader .outer-circle::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.95);
  transform: translateX(-50%);
}

.btn-loader .inner-circle {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  animation-direction: reverse;
  animation-duration: 850ms;
}

.btn-loader .inner-circle::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffffff;
  transform: translateX(-50%);
}

.dynamic-loader .outer-circle {
  width: 82px;
  height: 82px;
  border: 2px solid rgba(255, 255, 255, 0.22);
}

.dynamic-loader .outer-circle::after {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow:
    0 0 18px rgba(255, 255, 255, 0.95),
    0 0 35px rgba(225, 29, 72, 0.65);
  transform: translateX(-50%);
}

.dynamic-loader .inner-circle {
  width: 46px;
  height: 46px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  animation-direction: reverse;
  animation-duration: 850ms;
}

.dynamic-loader .inner-circle::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(225, 29, 72, 0.85);
  transform: translateX(-50%);
}

@keyframes orbitSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================
   LOADING OVERLAY
========================================================== */

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(8, 26, 43, 0.7);
  backdrop-filter: blur(10px);
}

.loading-box {
  width: min(88vw, 260px);
  min-height: 178px;
  display: grid;
  place-items: center;
  padding: 1.8rem;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-lg);
}

.loading-box p {
  margin: 0.9rem 0 0;
  font-weight: 900;
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 980px) {
  .student-login-page {
    overflow: auto;
  }

  .student-stage {
    padding: 1rem;
  }

  .student-layout {
    grid-template-columns: 1fr;
    gap: 1.3rem;
    align-items: start;
  }

  .student-welcome {
    padding-top: 1rem;
  }

  .student-welcome h1 {
    max-width: 720px;
    font-size: clamp(2.2rem, 9vw, 4.2rem);
  }

  .student-card {
    max-width: 520px;
    margin: 0 auto 1rem;
  }
}

@media (max-width: 640px) {
  .student-stage {
    padding: 0.85rem;
  }

  .student-topbar {
    min-height: auto;
    padding: 0.4rem 0;
  }

  .student-brand img {
    width: 46px;
    height: 46px;
    border-radius: 15px;
  }

  .student-brand strong {
    font-size: 0.96rem;
  }

  .student-brand span,
  .top-status {
    display: none;
  }

  .welcome-badge {
    font-size: 0.66rem;
  }

  .student-welcome h1 {
    font-size: 2.1rem;
    line-height: 1.04;
  }

  .student-welcome p {
    font-size: 0.9rem;
    margin-top: 0.75rem;
  }

  .exam-preview-card {
    padding: 0.9rem;
    border-radius: 24px;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .preview-grid div {
    min-height: 54px;
    grid-template-columns: auto 1fr;
    justify-content: start;
    text-align: left;
  }

  .student-mini-tips {
    display: none;
  }

  .student-card {
    padding: 1.15rem;
    border-radius: 26px;
  }

  .logo-wrap {
    width: 66px;
    height: 66px;
    border-radius: 20px;
  }

  .logo-wrap img {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

  .card-header h2 {
    font-size: 1.35rem;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
  }

  .input-box input {
    height: 48px;
  }
}

@media (max-width: 420px) {
  .student-welcome h1 {
    font-size: 1.8rem;
  }

  .exam-preview-card {
    display: none;
  }
}

/* ==========================================================
   ACCESSIBILITY
========================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(225, 29, 72, 0.35);
  outline-offset: 3px;
}





/* ==========================================================
   STUDENT LOGIN HERO TEXT SIZE FIX
========================================================== */

.student-welcome h1 {
  max-width: 560px;
  font-size: clamp(2rem, 3.8vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.student-welcome p {
  max-width: 500px;
  font-size: 0.98rem;
}

@media (max-width: 980px) {
  .student-welcome h1 {
    font-size: clamp(2rem, 7vw, 3rem);
  }
}

@media (max-width: 640px) {
  .student-welcome h1 {
    font-size: 1.75rem;
    line-height: 1.12;
  }
}