:root {
  --accent: #5B4CF0;
  --accent-soft: #EEECFB;
  --accent-border: #D6D1F5;
  --bg-page: #F0EEFA;
  --bg-card: #F6F5FC;
  --border: #E4E1F5;
  --text-primary: #1F1B33;
  --text-secondary: #635F76;
  --text-accent: #3C3489;
  --text-accent-soft: #5F5AA0;
  --success: #1D9E75;
  --danger: #E24B4A;
}

* { box-sizing: border-box; }

body.landing {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
}

.landing-frame {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  background: #FFFFFF;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

/* nav */
.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 0.5px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}
.icon { width: 1em; height: 1em; display: inline-block; flex-shrink: 0; }
.landing-nav .brand { font-weight: 500; font-size: 15px; }
.landing-nav .brand .icon, .landing-nav .links a .icon, .btn-primary .icon { margin-right: 5px; vertical-align: -2px; }
.landing-nav .links { display: flex; gap: 16px; }
.landing-nav .links a { font-size: 13px; text-decoration: none; cursor: pointer; }
.landing-nav .links a.student { color: var(--accent); }
.landing-nav .links a.tutor { color: var(--text-secondary); }

/* hero */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  padding: 32px 20px 26px;
  align-items: center;
}
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
}
.hero h1 { margin: 0 0 10px; font-size: 22px; font-weight: 500; }
.hero .subtitle { color: var(--text-secondary); margin: 0 0 18px; font-size: 14px; line-height: 1.6; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
}

.lead-form {
  display: none;
  max-width: 280px;
  margin: 14px 0 0;
  text-align: left;
}
.lead-form input, .lead-form textarea {
  width: 100%;
  margin-bottom: 8px;
  box-sizing: border-box;
  font-family: inherit;
}
.lead-form textarea { resize: vertical; }
.lead-form .error { font-size: 13px; color: var(--danger); margin: 4px 0 8px; }
.lead-form .confirm { display: none; font-size: 13px; color: var(--success); margin: 8px 0 0; }

.hero-photo {
  position: relative;
  width: 180px;
  height: 230px;
  margin: 0 auto;
}
.hero-photo .backdrop {
  position: absolute;
  top: 14px; left: 14px;
  width: 180px; height: 230px;
  background: var(--accent-soft);
  border-radius: 20px;
  transform: rotate(4deg);
}
.hero-photo img {
  position: relative;
  width: 180px; height: 230px;
  object-fit: cover;
  border-radius: 20px;
  transform: rotate(-4deg);
  display: block;
}
.hero-photo .streak {
  position: absolute;
  height: 3px;
  border-radius: 2px;
  transform: rotate(-20deg);
}
.hero-photo .streak.s1 { top: 6px; right: -8px; width: 26px; background: var(--accent); }
.hero-photo .streak.s2 { top: 17px; right: -14px; width: 18px; background: #A69DEA; }

/* stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 20px 28px;
  align-items: start;
}
@media (max-width: 640px) {
  .stats-row { grid-template-columns: 1fr; }
}
.stat-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 14px 12px;
}
.stat-card .list-row {
  display: flex; align-items: center; gap: 6px; margin-top: 5px;
}
.stat-card .list-row:first-of-type { margin-top: 8px; }
.stat-card .list-row .icon { font-size: 14px; color: var(--accent); }
.stat-card .list-row span { font-size: 11px; color: var(--text-secondary); }
.stat-card .label { font-size: 12px; font-weight: 500; margin: 0; }

.stat-badge {
  background: var(--accent-soft);
  border: 0.5px solid var(--accent-border);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
}
.stat-badge .icon { font-size: 18px; color: var(--accent); }
.stat-badge .title { font-size: 12px; font-weight: 500; margin: 6px 0 0; color: var(--text-accent); }
.stat-badge .sub { font-size: 11px; color: var(--text-accent-soft); margin: 3px 0 0; }

.stat-plain { background: var(--bg-card); border-radius: 10px; padding: 14px 10px; text-align: center; }
.stat-plain .icon { font-size: 18px; color: var(--accent); margin-bottom: 4px; display: block; }
.stat-plain .big { font-size: 16px; font-weight: 500; margin: 0; }
.stat-plain .small { font-size: 12px; color: var(--text-secondary); margin: 4px 0 0; }

/* benefits grid */
.benefits { padding: 0 20px 36px; }
.benefits h2 { margin: 0 0 14px; font-size: 18px; font-weight: 500; }
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 640px) {
  .benefits-grid { grid-template-columns: 1fr; }
}
.benefit-card { background: var(--bg-card); border-radius: 10px; padding: 14px; }
.benefit-card .icon { font-size: 20px; color: var(--accent); }
.benefit-card .title { font-size: 13px; font-weight: 500; margin: 8px 0 2px; }
.benefit-card .desc { font-size: 12px; color: var(--text-secondary); margin: 0; }

/* chat widget */
.chat-bubble { position: fixed; bottom: 20px; right: 20px; z-index: 40; }
.chat-toggle {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.chat-toggle .icon { font-size: 22px; }
.chat-panel {
  display: none;
  position: absolute; bottom: 58px; right: 0;
  width: 260px; background: #fff;
  border: 0.5px solid var(--border);
  border-radius: 12px; padding: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.chat-log { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; max-height: 240px; overflow: auto; }
.chat-bubble-msg { background: var(--bg-card); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.chat-bubble-msg.user { align-self: flex-end; background: var(--accent); color: #fff; max-width: 80%; }
.chat-panel input { width: 100%; margin-bottom: 6px; box-sizing: border-box; }
