:root {
  --navy-950: #071b2a;
  --navy-900: #092336;
  --navy-800: #123a54;
  --blue-700: #0969c7;
  --blue-600: #1781e4;
  --cyan-400: #42c8dc;
  --gold-400: #f2bd59;
  --ink: #132638;
  --muted: #607184;
  --line: #dbe5ed;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-solid: #ffffff;
  --page: #eff6fa;
  --success: #167a4c;
  --danger: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 15%, rgba(66, 200, 220, .18), transparent 28rem),
    radial-gradient(circle at 88% 86%, rgba(23, 129, 228, .14), transparent 30rem),
    linear-gradient(145deg, #f8fcff 0%, var(--page) 48%, #e8f1f6 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .34;
  background-image:
    linear-gradient(rgba(9, 35, 54, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(9, 35, 54, .035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

button, input, select { font: inherit; }
a { color: inherit; }

.auth-page {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  padding: clamp(20px, 4vw, 48px);
}
.auth-shell {
  width: min(1080px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, .78fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 32px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(7, 27, 42, .18), 0 2px 10px rgba(7, 27, 42, .08);
  backdrop-filter: blur(18px);
}
.auth-visual {
  position: relative;
  min-height: 650px;
  padding: clamp(34px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 78% 22%, rgba(66, 200, 220, .32), transparent 16rem),
    radial-gradient(circle at 16% 88%, rgba(242, 189, 89, .2), transparent 18rem),
    linear-gradient(145deg, var(--navy-950), var(--navy-800));
}
.auth-visual::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -150px;
  bottom: -150px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 50px rgba(255,255,255,.025), 0 0 0 100px rgba(255,255,255,.018);
}
.logo-lockup {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 15px;
}
.site-logo {
  width: 66px;
  height: 66px;
  padding: 7px;
  object-fit: contain;
  border-radius: 20px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
}
.logo-lockup strong { display: block; font-size: 1.08rem; letter-spacing: .01em; }
.logo-lockup span { display: block; margin-top: 3px; color: rgba(255,255,255,.72); font-size: .9rem; }
.hero-copy { position: relative; z-index: 1; max-width: 600px; }
.hero-copy .eyebrow {
  display: inline-flex;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  font-size: .73rem;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.hero-copy h1 {
  max-width: 12ch;
  margin: 20px 0 15px;
  font-size: clamp(2.35rem, 5vw, 4.45rem);
  line-height: .98;
  letter-spacing: -.045em;
}
.hero-copy p {
  max-width: 48ch;
  margin: 0;
  color: rgba(255,255,255,.74);
  font-size: 1.03rem;
  line-height: 1.7;
}
.subject-pills { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.subject-pills span {
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  color: rgba(255,255,255,.78);
  font-size: .82rem;
}

.auth-card {
  padding: clamp(32px, 5vw, 58px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-card .mobile-brand { display: none; }
.auth-card h2 { margin: 0; color: var(--navy-900); font-size: clamp(1.8rem, 3vw, 2.45rem); letter-spacing: -.035em; }
.auth-card > p { margin: 10px 0 0; color: var(--muted); line-height: 1.65; }
.auth-form { display: grid; gap: 18px; margin-top: 28px; }
.form-field { display: grid; gap: 8px; }
.form-field > span { font-size: .9rem; font-weight: 800; color: #253e51; }
.form-field small { color: var(--muted); line-height: 1.45; }
input, select {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid #cbd9e3;
  border-radius: 14px;
  background: rgba(255,255,255,.94);
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
input::placeholder { color: #94a4b2; }
input:focus, select:focus {
  outline: 0;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(23, 129, 228, .13);
}
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.password-toggle:hover { background: #edf5fa; color: var(--blue-700); }
.primary-action {
  width: 100%;
  min-height: 52px;
  margin-top: 3px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-700), var(--blue-600));
  box-shadow: 0 12px 26px rgba(9, 105, 199, .24);
  font-weight: 850;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.primary-action:hover { transform: translateY(-1px); box-shadow: 0 16px 30px rgba(9, 105, 199, .29); }
.primary-action:active { transform: translateY(0); }
.message {
  min-height: 22px;
  margin: 0;
  color: var(--danger);
  font-size: .9rem;
  font-weight: 700;
}
.message.success { color: var(--success); }
.auth-note {
  margin-top: 22px;
  padding: 13px 14px;
  border: 1px solid #d7e5ee;
  border-radius: 14px;
  background: #f3f8fb;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.55;
}
.auth-footer {
  padding-top: 24px;
  text-align: center;
  color: #718292;
  font-size: .86rem;
}

.student-page { min-height: 100vh; }
.student-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px clamp(18px, 5vw, 64px);
  color: #fff;
  background: rgba(9, 35, 54, .94);
  box-shadow: 0 8px 28px rgba(7, 27, 42, .18);
  backdrop-filter: blur(14px);
}
.student-brand { display: flex; align-items: center; gap: 12px; }
.student-brand img { width: 46px; height: 46px; padding: 5px; border-radius: 14px; background: #fff; object-fit: contain; }
.student-brand strong, .student-brand small { display: block; }
.student-brand small { margin-top: 2px; color: rgba(255,255,255,.66); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.user-chip { padding: 8px 11px; border-radius: 999px; background: rgba(255,255,255,.1); color: rgba(255,255,255,.86); font-size: .86rem; }
.logout-link, .back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  font-weight: 750;
}
.logout-link:hover, .back-link:hover { background: rgba(255,255,255,.1); }
.student-main { width: min(1120px, calc(100% - 36px)); margin: clamp(32px, 5vw, 64px) auto; }
.student-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: clamp(28px, 5vw, 54px);
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(135deg, var(--navy-950), var(--navy-800));
  box-shadow: 0 22px 56px rgba(7, 27, 42, .18);
}
.student-hero::after {
  content: "";
  position: absolute;
  width: 290px;
  height: 290px;
  right: -100px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(66,200,220,.28), transparent 68%);
}
.student-hero > * { position: relative; z-index: 1; }
.student-hero .eyebrow { margin: 0 0 10px; color: var(--cyan-400); font-size: .75rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.student-hero h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.8rem); letter-spacing: -.04em; }
.student-hero p { max-width: 58ch; margin: 14px 0 0; color: rgba(255,255,255,.72); line-height: 1.7; }
.class-badge { min-width: 140px; padding: 20px; border: 1px solid rgba(255,255,255,.16); border-radius: 22px; background: rgba(255,255,255,.09); text-align: center; }
.class-badge span { display: block; color: rgba(255,255,255,.64); font-size: .75rem; text-transform: uppercase; letter-spacing: .09em; }
.class-badge strong { display: block; margin-top: 7px; font-size: 1.3rem; }
.student-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 20px; }
.info-card {
  padding: 24px;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 10px 32px rgba(18, 58, 84, .08);
}
.info-card .icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: #e8f5fb; color: var(--blue-700); font-weight: 900; }
.info-card h2 { margin: 18px 0 8px; font-size: 1.08rem; }
.info-card p { margin: 0; color: var(--muted); line-height: 1.62; }
.student-footer { padding: 10px 20px 34px; text-align: center; color: #718292; font-size: .86rem; }

.security-shell { width: min(680px, 100%); }
.security-shell .auth-card { min-height: 600px; }
.security-header { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.security-header img { width: 58px; height: 58px; padding: 6px; border-radius: 17px; background: #fff; box-shadow: 0 8px 22px rgba(7,27,42,.12); }
.security-list { margin: 16px 0 0; padding-left: 20px; color: var(--muted); line-height: 1.7; }
.back-dark { color: var(--navy-800); border-color: #cad9e3; }
.back-dark:hover { background: #edf5fa; }

@media (max-width: 820px) {
  .auth-page { padding: 16px; }
  .auth-shell { grid-template-columns: 1fr; border-radius: 24px; }
  .auth-visual { display: none; }
  .auth-card { padding: 32px 24px; }
  .auth-card .mobile-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; color: var(--navy-900); }
  .auth-card .mobile-brand img { width: 54px; height: 54px; padding: 5px; border-radius: 16px; background: #fff; box-shadow: 0 8px 22px rgba(7,27,42,.11); }
  .auth-card .mobile-brand strong, .auth-card .mobile-brand span { display: block; }
  .auth-card .mobile-brand span { margin-top: 2px; color: var(--muted); font-size: .85rem; }
  .student-grid { grid-template-columns: 1fr; }
  .student-hero { grid-template-columns: 1fr; }
  .class-badge { width: fit-content; text-align: left; }
  .student-header { align-items: flex-start; }
  .user-chip { display: none; }
}

@media (max-width: 520px) {
  .student-brand small { display: none; }
  .student-brand strong { font-size: .9rem; }
  .logout-link { padding-inline: 10px; font-size: .86rem; }
  .student-main { width: min(100% - 24px, 1120px); }
  .student-hero { padding: 26px 22px; border-radius: 22px; }
}
