/* =====================================================================
   OSCAR-Junior — base.css
   All page-specific styles in one file (home + login, + future pages).
   Generic foundation (tokens, reset, shared components) lives in layout.css.
   ===================================================================== */

/* ===================== HOME PAGE ===================== */

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(239, 251, 253, 0.78);
  border-bottom: 1px solid rgba(13, 148, 136, 0.1);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav__links a {
  font-weight: 800;
  color: var(--ink-soft);
  font-size: 0.98rem;
  transition: color 0.15s;
}
.nav__links a:hover {
  color: var(--teal-600);
}
.nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav__toggle {
  display: none;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 72px 0 90px;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  color: var(--teal-700);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}
.hero__eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal-500);
}

.hero__title {
  font-size: clamp(2.6rem, 5.4vw, 4.3rem);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero__title .pop {
  background: linear-gradient(120deg, var(--cyan-500), var(--teal-600));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lead {
  font-size: 1.18rem;
  color: var(--ink-soft);
  max-width: 30ch;
  margin-bottom: 32px;
  font-weight: 600;
}
.hero__cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.hero__meta {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}
.hero__meta .stat {
  display: flex;
  flex-direction: column;
}
.hero__meta .stat b {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--teal-600);
  line-height: 1;
}
.hero__meta .stat span {
  font-size: 0.88rem;
  color: var(--ink-faint);
  font-weight: 700;
}

/* Hero art */
.hero__art {
  position: relative;
  display: grid;
  place-items: center;
}
.brain-card {
  position: relative;
  width: min(420px, 100%);
  aspect-ratio: 1/1;
  background: linear-gradient(160deg, #fff, var(--surface-tint));
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.brain-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 20%, rgba(34, 211, 238, 0.22), transparent 45%),
    radial-gradient(circle at 80% 85%, rgba(20, 184, 166, 0.2), transparent 45%);
}
.brain-card .mascot {
  width: 74%;
  position: relative;
  z-index: 1;
  animation: drift 6s ease-in-out infinite;
}

.float-chip {
  position: absolute;
  z-index: 2;
  background: #fff;
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  animation: drift 5s ease-in-out infinite;
}
.float-chip i {
  font-style: normal;
  font-size: 1.2rem;
}
.float-chip--a {
  top: 8%;
  left: -6%;
  animation-delay: 0.4s;
}
.float-chip--b {
  bottom: 14%;
  right: -8%;
  animation-delay: 1.2s;
}
.float-chip--c {
  bottom: -4%;
  left: 14%;
  animation-delay: 2s;
}

/* ---------- Section heading ---------- */
.section {
  padding: 80px 0;
}
.section__head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 52px;
}
.section__kicker {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--teal-500);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.82rem;
  margin-bottom: 12px;
}
.section__title {
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.section__sub {
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* ---------- Lesson cards ---------- */
.lessons {
  background: var(--surface);
  border-radius: var(--r-xl);
  margin-block: 0;
}
.lessons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.lesson {
  position: relative;
  padding: 28px 24px 26px;
  border-radius: var(--r-lg);
  background: var(--surface-tint);
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.08);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  overflow: hidden;
}
.lesson:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}
.lesson__num {
  position: absolute;
  top: 18px;
  right: 22px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.4rem;
  color: rgba(13, 148, 136, 0.12);
  line-height: 1;
}
.lesson__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  margin-bottom: 16px;
}
.lesson h3 {
  font-size: 1.22rem;
  margin-bottom: 8px;
}
.lesson p {
  color: var(--ink-soft);
  font-size: 0.96rem;
  font-weight: 600;
}
.lesson__tag {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--teal-600);
}

/* color variants */
.lesson--1 .lesson__icon {
  background: #dbf4ff;
}
.lesson--2 .lesson__icon {
  background: #d7fbf4;
}
.lesson--3 .lesson__icon {
  background: #e3f0ff;
}
.lesson--4 .lesson__icon {
  background: #fff1d6;
}
.lesson--5 .lesson__icon {
  background: #e0fbff;
}
.lesson--6 .lesson__icon {
  background: #d9f7ee;
}

/* ---------- Feature strip ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.feature {
  background: linear-gradient(160deg, var(--surface), var(--surface-tint));
  border-radius: var(--r-lg);
  padding: 30px 26px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(13, 148, 136, 0.08);
}
.feature__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  margin-bottom: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--cyan-400), var(--teal-500));
  box-shadow: 0 8px 16px -6px rgba(13, 148, 136, 0.5);
}
.feature__icon svg {
  width: 26px;
  height: 26px;
}
.feature h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.feature p {
  color: var(--ink-soft);
  font-size: 0.96rem;
}

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  background: linear-gradient(130deg, var(--teal-600), var(--cyan-500));
  border-radius: var(--r-xl);
  padding: 64px 40px;
  text-align: center;
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.cta-band::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.18), transparent 45%);
}
.cta-band h2 {
  color: #fff;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  margin-bottom: 14px;
  position: relative;
}
.cta-band p {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.1rem;
  margin-bottom: 28px;
  position: relative;
}
.cta-band .btn--primary {
  position: relative;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 56px 0 36px;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
}
.footer__about {
  max-width: 280px;
}
.footer__about p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-top: 14px;
}
.footer__cols {
  display: flex;
  gap: 64px;
  flex-wrap: wrap;
}
.footer__col h4 {
  font-size: 1rem;
  margin-bottom: 14px;
  color: var(--ink);
}
.footer__col a {
  display: block;
  color: var(--ink-soft);
  font-size: 0.93rem;
  padding: 5px 0;
  transition: color 0.15s;
}
.footer__col a:hover {
  color: var(--teal-600);
}
.footer__bottom {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid rgba(13, 148, 136, 0.12);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--ink-faint);
  font-size: 0.88rem;
  font-weight: 700;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }
  .hero__art {
    order: -1;
  }
  .lessons-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .nav__links {
    display: none;
  }
  /* No room beside "Log in" on phones; the hero has its own call to action. */
  .nav__get-started {
    display: none;
  }
  .lessons-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 48px 0 64px;
  }
  .section {
    padding: 56px 0;
  }
  .hero__meta {
    gap: 22px;
  }
  .float-chip--a,
  .float-chip--b {
    display: none;
  }
}

/* ===================== LOGIN PAGE ===================== */

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

/* ---------- Left: brand / welcome panel ---------- */
.login-aside {
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, var(--teal-600), var(--cyan-500) 70%, var(--blue-400));
  color: #fff;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-aside::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.18), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.14), transparent 42%);
}
.login-aside > * {
  position: relative;
  z-index: 1;
}
.login-aside .brand__name,
.login-aside .brand__name span {
  color: #fff;
}
.login-aside .brand__mark {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
}

.aside-hero {
  margin-top: auto;
}
.aside-hero h1 {
  color: #fff;
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.aside-hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.08rem;
  max-width: 34ch;
}
.aside-art {
  width: 200px;
  margin: 28px 0;
  animation: drift 6s ease-in-out infinite;
}
.aside-foot {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 700;
}

/* ---------- Right: login forms ---------- */
.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  background: var(--bg);
}
.login-box {
  width: 100%;
  max-width: 420px;
}

.login-box__head {
  margin-bottom: 28px;
}
.login-box__head h2 {
  font-size: 1.85rem;
  letter-spacing: -0.01em;
}
.login-box__head p {
  color: var(--ink-soft);
  margin-top: 6px;
}

/* Role chooser */
.role-grid {
  display: grid;
  gap: 14px;
}
.role-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  background: var(--surface);
  padding: 18px 20px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
  width: 100%;
}
.role-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--teal-400);
}
.role-btn__icon {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
}
.role-btn--admin .role-btn__icon {
  background: linear-gradient(135deg, var(--blue-300), var(--blue-500));
}
.role-btn--teacher .role-btn__icon {
  background: linear-gradient(135deg, var(--teal-400), var(--teal-600));
}
.role-btn--student .role-btn__icon {
  background: linear-gradient(135deg, var(--cyan-300), var(--cyan-500));
}
.role-btn__text b {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
}
.role-btn__text span {
  font-size: 0.9rem;
  color: var(--ink-faint);
  font-weight: 700;
}
.role-btn__arrow {
  margin-left: auto;
  color: var(--ink-faint);
  transition:
    transform 0.15s,
    color 0.15s;
}
.role-btn:hover .role-btn__arrow {
  transform: translateX(4px);
  color: var(--teal-600);
}

/* Credentials form (revealed after role pick) */
.cred {
  display: block;
}
.cred[hidden] {
  display: none;
} /* hidden until a role is chosen */
.cred.active {
  display: block;
  animation: slideIn 0.35s ease;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.cred__role-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  padding: 8px 16px 8px 8px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
  font-family: var(--font-display);
  font-weight: 600;
}
.cred__role-badge .mini-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}

.field {
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--blue-200);
  border-radius: var(--r-md);
  padding: 14px 16px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.field input::placeholder {
  color: var(--ink-faint);
  font-weight: 600;
}
.field input:focus {
  outline: none;
  border-color: var(--teal-400);
  box-shadow: 0 0 0 4px var(--ring);
}

.field--pw {
  position: relative;
}
.field--pw .toggle-pw {
  position: absolute;
  right: 14px;
  top: 39px;
  color: var(--ink-faint);
  font-size: 0.85rem;
  font-family: var(--font-display);
  font-weight: 500;
}

.cred__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  font-size: 0.9rem;
}
.cred__row label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-weight: 700;
  cursor: pointer;
}
.cred__row a {
  color: var(--teal-600);
  font-weight: 800;
}

.cred .btn {
  width: 100%;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  color: var(--ink-soft);
  font-weight: 800;
  font-size: 0.92rem;
}
.back-link:hover {
  color: var(--teal-600);
}

/* Error / status message */
.form-msg {
  display: none;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 0.92rem;
}
.form-msg.show {
  display: block;
}
.form-msg--error {
  background: #fee6e2;
  color: #b42318;
}
.form-msg--ok {
  background: #d7fbf0;
  color: var(--teal-700);
}

.login-foot-link {
  text-align: center;
  margin-top: 26px;
  font-size: 0.9rem;
  color: var(--ink-faint);
  font-weight: 700;
}
.login-foot-link a {
  color: var(--teal-600);
  font-weight: 800;
}

#formMsg {
  display: none;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
}
#formMsg.show {
  display: block;
}
#formMsg.error {
  background: #ffe0e9;
  color: #c2185b;
}
#formMsg.ok {
  background: #d7f5ec;
  color: #0e7c93;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .login-page {
    grid-template-columns: 1fr;
  }
  .login-aside {
    padding: 32px;
    min-height: 230px;
  }
  .aside-art {
    display: none;
  }
  .aside-hero {
    margin-top: 18px;
  }
}
