:root {
  --bg-start: #0f172a;
  --bg-end: #020617;
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.15);
  --accent-2: #a855f7;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --card-bg: rgba(15, 23, 42, 0.95);
  --border-subtle: rgba(148, 163, 184, 0.35);
  --danger: #f97373;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(168, 85, 247, 0.7), transparent 50%),
    radial-gradient(circle at bottom, rgba(56, 189, 248, 0.6), transparent 55%),
    linear-gradient(135deg, var(--bg-start), var(--bg-end));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--text-main);
}

.app {
  width: 100%;
  max-width: 1180px;
  background: var(--card-bg);
  border-radius: 24px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.95);
  padding: 24px 24px 20px;
  position: relative;
  overflow: hidden;
}

.app::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(129, 140, 248, 0.32), transparent 60%);
  opacity: 0.9;
  pointer-events: none;
}

.app-inner {
  position: relative;
  z-index: 1;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.app-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-title h1 {
  font-size: 1.5rem;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.6);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-muted);
}

.app-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 8px;
}

@media (max-width: 800px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .app {
    padding: 18px 16px 16px;
  }
}

.card {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: radial-gradient(circle at top left, rgba(148, 163, 248, 0.13), rgba(15, 23, 42, 0.96));
  padding: 14px 14px 12px;
  backdrop-filter: blur(24px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 550;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.btn {
  border-radius: 999px;
  padding: 7px 14px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease-out;
}

.btn-primary {
  border-color: rgba(129, 140, 248, 0.9);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.7);
}

.btn:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.9);
  border-color: rgba(191, 219, 254, 0.7);
}

.btn-primary:hover {
  box-shadow: 0 18px 45px rgba(79, 70, 229, 0.9);
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.8);
  border-style: dashed;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.78rem;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.92);
  padding: 8px 11px;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.16s ease-out;
}

.input::placeholder {
  color: rgba(148, 163, 184, 0.85);
}

.input:focus {
  border-color: rgba(129, 140, 248, 0.95);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.6);
}

.small-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.list {
  margin-top: 8px;
  padding-right: 4px;
}

/* Only lists that ALSO have .list-scroll will scroll */
.list-scroll {
  max-height: 200px;
  overflow-y: auto;
}

.list-item {
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
  margin-bottom: 6px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.list-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: rgba(129, 140, 248, 0.18);
  border: 1px solid rgba(129, 140, 248, 0.5);
}

/* Chat layout */

.chat-shell {
  display: flex;
  flex-direction: column;
  height: 360px;
}

.chat-window {
  flex: 1;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.98));
  padding: 8px 10px;
  overflow-y: auto;
  font-size: 0.84rem;
}

.chat-message {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  max-width: 90%;
}

.chat-message.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.bubble {
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(31, 41, 55, 0.95);
  border: 1px solid rgba(75, 85, 99, 0.9);
}

.chat-message.user .bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: rgba(191, 219, 254, 0.7);
}

.chat-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.badge-soft {
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  opacity: 0.9;
}

/* Utility */

.back-link {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-bottom: 8px;
  padding: 4px 0;
  transition: color 0.15s ease-out;
}

.back-link:hover {
  color: var(--text-main);
}

.teacher-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
}

.sidebar {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.98));
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 380px;
}

.sidebar-section {
  border-radius: 12px;
  padding: 8px 8px 6px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(51, 65, 85, 0.9);
}

.sidebar-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.95);
  margin-bottom: 6px;
}

.sidebar-name {
  font-size: 0.95rem;
  font-weight: 550;
}

.sidebar-email {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.sidebar-footer {
  margin-top: auto;
}

.teacher-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.teacher-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 16px;
}

@media (max-width: 960px) {
  .teacher-layout {
    grid-template-columns: 1fr;
  }

  .teacher-main-grid {
    grid-template-columns: 1fr;
  }
}

/* Subscription badges + overlay */

.sub-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
}

.sub-badge-inactive {
  background: rgba(127, 29, 29, 0.3);
  border: 1px solid rgba(248, 113, 113, 0.7);
  color: #fecaca;
}

.sub-badge-active {
  background: rgba(22, 163, 74, 0.25);
  border: 1px solid rgba(74, 222, 128, 0.8);
  color: #bbf7d0;
}

.subscribe-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.subscribe-modal {
  max-width: 520px;
  width: 100%;
}

.hidden {
  display: none;
}

.app-landing {
  min-height: 100vh;
  padding-top: 64px; /* space for nav */
}

/* NAVBAR */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  backdrop-filter: blur(20px);
  background: radial-gradient(circle at top, rgba(15,23,42,0.96), rgba(15,23,42,0.98));
  border-bottom: 1px solid rgba(148,163,184,0.3);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.nav-title {
  font-weight: 600;
  font-size: 1rem;
}

.nav-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  gap: 14px;
  font-size: 0.86rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #a855f7);
  transition: width 0.18s ease-out;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 880px) {
  .nav-links {
    display: none;
  }
}

/* HERO */

.hero {
  padding: 28px 8px 12px;
}

.hero-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: stretch;
}

.hero-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-title {
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 1.1;
}

.hero-highlight {
  background: linear-gradient(90deg, #38bdf8, #a855f7);
  -webkit-background-clip: text;
  color: transparent;
}

.hero-subtitle {
  font-size: 0.96rem;
  color: var(--text-muted);
  max-width: 34rem;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.hero-footnote {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.hero-preview {
  align-self: stretch;
}

.hero-preview-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.1fr);
  gap: 12px;
}

.hero-teacher-pane {
  border-radius: 14px;
  padding: 10px;
  background: radial-gradient(circle at top left, rgba(30,64,175,0.4), rgba(15,23,42,0.95));
  border: 1px solid rgba(148,163,184,0.4);
  display: flex;
  flex-direction: column;
}

.teacher-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.teacher-list-item {
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(51,65,85,0.9);
}

.teacher-list-item.muted {
  opacity: 0.75;
}

.teacher-student-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.hero-teacher-note {
  color: var(--text-muted);
}

/* GENERIC SECTIONS */

.section {
  max-width: 1120px;
  margin: 20px auto 0;
  padding: 8px 8px 0;
}

.section-header {
  margin-bottom: 10px;
}

.section-header h2 {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.section-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 14px;
}

/* FAQ GRID */

.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.faq-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.faq-list li + li {
  margin-top: 4px;
}

/* BOTTOM CTA */

.cta-footer {
  margin-top: 28px;
  padding: 18px 8px 26px;
}

.cta-inner {
  max-width: 1120px;
  margin: 0 auto;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,0.5);
  background: radial-gradient(circle at top left, rgba(59,130,246,0.4), rgba(15,23,42,0.98));
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cta-inner h2 {
  font-size: 1.4rem;
}

.cta-inner p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cta-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
  color: var(--text-muted);
}

/* RESPONSIVE TWEAKS */

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-preview-grid {
    grid-template-columns: 1fr;
  }
  .split-section {
    grid-template-columns: 1fr;
  }
  .feature-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .nav-inner {
    padding-inline: 10px;
  }
  .hero {
    padding-inline: 10px;
  }
  .section,
  .cta-footer {
    padding-inline: 10px;
  }
}

.cta-inner {
  position: relative;
}

.cta-logo {
  position: absolute;
  right: 18px;
  bottom: 9px;
  width: 180px;
  opacity: 0.85;
  pointer-events: none;
}

.btn-lg {
  padding: 14px 26px;
  font-size: 1rem;
  border-radius: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.btn-xl {
  padding: 18px 34px;
  font-size: 1.08rem;
  border-radius: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.btn-primary.btn-xl {
  box-shadow: 0 8px 30px rgba(168, 85, 247, 0.35);
  transition: all 0.2s ease;
}

.btn-primary.btn-xl:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(168, 85, 247, 0.45);
}