:root {
  --bg: #f4f7ff;
  --panel: #ffffff;
  --panel-soft: #eef3ff;
  --primary: #2f6cf6;
  --primary-dark: #1f56d7;
  --accent: #ffb703;
  --text: #1b1f2a;
  --muted: #5d6474;
  --line: #dfe7ff;
  --shadow: 0 18px 38px rgba(30, 70, 160, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: linear-gradient(180deg, #f7f9ff 0%, #eef3ff 100%);
  color: var(--text);
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 249, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(47, 108, 246, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 80px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, #8bb2ff 100%);
  color: white;
  font-weight: 700;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.header-cta,
.primary-btn,
.secondary-btn,
.contract-btn,
.arrow-btn,
.teacher-signup-btn {
  border: none;
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-cta,
.primary-btn,
.contract-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 12px 24px rgba(47, 108, 246, 0.2);
}

.teacher-signup-btn {
  padding: 0.8rem 1rem;
  border: 1px solid rgba(47, 108, 246, 0.2);
  background: transparent;
  color: var(--primary);
  font-weight: 700;
}

.primary-btn,
.secondary-btn,
.contract-btn,
.header-cta {
  padding: 0.9rem 1.4rem;
  font-weight: 700;
}

.secondary-btn {
  background: #edf2ff;
  color: var(--primary);
  border: 1px solid rgba(47, 108, 246, 0.15);
}

.header-cta:hover,
.primary-btn:hover,
.secondary-btn:hover,
.contract-btn:hover,
.arrow-btn:hover {
  transform: translateY(-1px);
}

.hero {
  padding: 72px 0 32px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 42px;
}

.eyebrow {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.74rem;
  color: var(--primary);
  background: rgba(47, 108, 246, 0.08);
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
}

.hero-copy h1 {
  margin: 20px 0 18px;
  font-size: clamp(2.6rem, 4vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.06em;
}

.hero-copy p {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
}

.stats {
  display: flex;
  gap: 30px;
  list-style: none;
  padding: 0;
  margin: 30px 0 0;
  flex-wrap: wrap;
}

.stats li {
  display: grid;
  gap: 3px;
}

.stats strong {
  font-size: 1.3rem;
}

.stats span {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-visual {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-card {
  position: absolute;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: var(--shadow);
  border: 6px solid rgba(255, 255, 255, 0.7);
}

.visual-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.big-card {
  width: 430px;
  height: 520px;
  right: 60px;
  top: 0;
}

.small-card {
  width: 210px;
  height: 220px;
  bottom: 0;
  left: 10px;
}

.teachers-section,
.info-section,
.reviews-section {
  padding: 56px 0;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-header h2,
.info-section h2,
.reviews-section h2 {
  margin: 12px 0 0;
  font-size: clamp(2rem, 2.6vw, 2.8rem);
  letter-spacing: -0.05em;
}

.carousel-controls {
  display: flex;
  gap: 12px;
}

.arrow-btn {
  width: 46px;
  height: 46px;
  background: var(--panel);
  border: 1px solid rgba(47, 108, 246, 0.1);
  font-size: 1.3rem;
  color: var(--primary);
}

.teacher-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 22px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 10px;
  scrollbar-width: none;
}

.teacher-carousel::-webkit-scrollbar {
  display: none;
}

.teacher-card {
  background: var(--panel);
  border: 1px solid rgba(47, 108, 246, 0.08);
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 12px 24px rgba(16, 36, 72, 0.05);
  scroll-snap-align: start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.teacher-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 30px rgba(16, 36, 72, 0.08);
}

.teacher-card.active {
  border-color: rgba(47, 108, 246, 0.25);
  box-shadow: 0 18px 26px rgba(47, 108, 246, 0.1);
}

.teacher-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 18px;
}

.teacher-card-content {
  padding-top: 16px;
}

.teacher-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.teacher-name {
  font-size: 1.2rem;
  font-weight: 700;
}

.teacher-tag {
  background: #edf2ff;
  color: var(--primary);
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.teacher-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 14px;
}

.teacher-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.teacher-subjects span {
  background: #f4f7ff;
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.teacher-card button {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: none;
  background: #eff5ff;
  color: var(--primary);
  font-weight: 700;
}

.profile-section {
  padding: 12px 0 56px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 34px;
  background: var(--panel);
  border: 1px solid rgba(47, 108, 246, 0.08);
  border-radius: 28px;
  padding: 26px;
  box-shadow: var(--shadow);
}

.profile-card img {
  width: 100%;
  height: 100%;
  min-height: 430px;
  object-fit: cover;
  border-radius: 24px;
}

.profile-content {
  padding: 10px 12px;
}

.profile-content h3 {
  margin: 18px 0 10px;
  font-size: clamp(2rem, 2.5vw, 2.6rem);
  letter-spacing: -0.06em;
}

.profile-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-weight: 600;
}

.profile-content > p {
  color: var(--muted);
  line-height: 1.8;
  font-size: 1.04rem;
  margin: 24px 0;
}

.subjects-box,
.history-box {
  background: #f8faff;
  border: 1px solid rgba(47, 108, 246, 0.08);
  border-radius: 18px;
  padding: 18px 20px;
  margin-top: 18px;
}

.subjects-box h4,
.history-box h4 {
  margin: 0 0 12px;
  font-size: 1.06rem;
}

.subjects-box ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.history-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.price-row {
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.price-label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 6px;
}

#profilePrice {
  font-size: clamp(1.5rem, 2vw, 2.1rem);
}

.contract-btn {
  padding: 1rem 1.5rem;
  border-radius: 14px;
  font-size: 1rem;
}

.info-section {
  background: #edf2ff;
}

.steps-grid,
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.step-card,
.review-card {
  background: var(--panel);
  border: 1px solid rgba(47, 108, 246, 0.08);
  border-radius: 22px;
  padding: 24px 22px;
  box-shadow: 0 10px 24px rgba(16, 36, 72, 0.04);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #edf2ff;
  font-weight: 800;
  color: var(--primary);
}

.step-card h3 {
  margin: 18px 0 10px;
}

.step-card p,
.review-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.review-card strong {
  display: inline-block;
  margin-top: 18px;
  font-size: 0.95rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 31, 58, 0.58);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.teacher-modal {
  width: min(700px, 100%);
  max-height: min(850px, calc(100vh - 40px));
  overflow-y: auto;
  background: var(--panel);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 24px 64px rgba(10, 22, 48, 0.34);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.modal-header h2 {
  margin: 12px 0 0;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}

.close-modal {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: #edf2ff;
  color: var(--primary);
  font-size: 1.8rem;
  line-height: 1;
}

.teacher-form {
  display: grid;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.teacher-form label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
}

.teacher-form input,
.teacher-form textarea {
  width: 100%;
  border: 1px solid #cedcff;
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  color: var(--text);
  background: #fbfcff;
  outline: none;
}

.teacher-form input:focus,
.teacher-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 108, 246, 0.12);
}

.teacher-form textarea {
  min-height: 90px;
  resize: vertical;
}

.optional {
  color: var(--muted);
  font-weight: 500;
}

.form-status {
  min-height: 1.3rem;
  margin: 0;
  color: var(--primary-dark);
  font-size: 0.9rem;
  font-weight: 600;
}

.form-status.is-error {
  color: #ba1a1a;
}

.booking-teacher {
  padding: 14px 16px;
  border: 1px solid #d8e4ff;
  border-radius: 12px;
  background: #f5f8ff;
  color: var(--muted);
}

.booking-teacher strong {
  color: var(--text);
}

.booking-confirmation h3 {
  margin: 18px 0 10px;
  font-size: 1.5rem;
}

.booking-confirmation p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.7;
}

.booking-confirmation .contract-btn {
  display: inline-block;
  text-decoration: none;
}

.classroom-body {
  min-height: 100vh;
  background: #10182d;
}

.classroom-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.classroom-header,
.classroom-content {
  display: flex;
  gap: 18px;
}

.classroom-header {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.classroom-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

.room-status {
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  background: rgba(255, 255, 255, 0.12);
  color: #dce7ff;
  font-weight: 600;
  font-size: 0.85rem;
}

.classroom-content {
  align-items: stretch;
}

.classroom-stage {
  position: relative;
  flex: 1;
  min-height: 600px;
  overflow: hidden;
  border-radius: 18px;
  background: #19233e;
}

.classroom-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#remoteVideo { display: none; }
#remoteVideo.is-visible { display: block; }

#localVideo {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 180px;
  height: 120px;
  border: 3px solid white;
  border-radius: 12px;
  background: #111;
}

.stage-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  color: #dce7ff;
  text-align: center;
}

.room-panel {
  width: 330px;
  padding: 28px;
  border-radius: 18px;
  background: #fff;
}

.room-panel h1 { margin: 16px 0 10px; font-size: 1.65rem; }
.room-panel p { color: var(--muted); line-height: 1.65; }
.role-control { display: grid; gap: 8px; margin: 22px 0 12px; font-weight: 700; }
.role-control select, .room-link-btn, .call-controls button { padding: 0.8rem; border-radius: 10px; font: inherit; }
.role-control select { border: 1px solid #cedcff; }
.room-panel .contract-btn { width: 100%; border: 0; }
.room-link-btn { width: 100%; margin-top: 10px; border: 1px solid #cedcff; background: #f5f8ff; color: var(--primary); font-weight: 700; }
.call-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.call-controls button { border: 1px solid #cedcff; background: #fff; font-weight: 700; }
#shareScreen { grid-column: 1 / -1; color: var(--primary); }
#leaveRoom { grid-column: 1 / -1; color: #ba1a1a; }

@media (max-width: 860px) {
  .classroom-content { flex-direction: column; }
  .classroom-stage { min-height: 380px; }
  .room-panel { width: 100%; }
}

@media (max-width: 960px) {
  .hero-grid,
  .profile-grid,
  .steps-grid,
  .reviews-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 420px;
  }

  .big-card {
    right: 30px;
    width: 280px;
    height: 360px;
  }

  .small-card {
    width: 170px;
    height: 180px;
    left: 0;
  }
}

@media (max-width: 720px) {
  .main-nav {
    display: none;
  }

  .hero {
    padding-top: 52px;
  }

  .hero-actions,
  .price-row,
  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .teacher-carousel {
    grid-auto-columns: minmax(240px, 80%);
  }

  .header-inner {
    min-height: 72px;
  }

  .header-cta {
    display: none;
  }

  .teacher-modal {
    padding: 22px 18px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
