/* Chalkline — one font, one blue, one yellow. Everything else is white and grey. */
:root {
  --blue: #1d4ed8;
  --blue-dark: #1e3a8a;
  --blue-light: #eef2ff;
  --yellow: #fbbf24;
  --text: #111827;
  --grey: #6b7280;
  --line: #e5e7eb;
  --bg-soft: #f8fafc;
  --white: #ffffff;
  --green: #15803d;
  --green-light: #f0fdf4;
  --red: #b91c1c;
  --radius: 10px;
  --font: "Plus Jakarta Sans", system-ui, "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--white); }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: var(--blue); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
[id] { scroll-margin-top: 90px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.section { padding-block: 64px; }
.section.soft { background: var(--bg-soft); }
.section-title { text-align: center; max-width: 640px; margin: 0 auto 40px; display: grid; gap: 10px; }
.section-title h2 { font-size: clamp(26px, 4vw, 34px); }
.section-title p { color: var(--grey); font-size: 18px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: var(--radius); border: 2px solid var(--blue); background: var(--blue); color: var(--white); font-weight: 700; text-decoration: none; cursor: pointer; min-height: 48px; }
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn.outline { background: var(--white); color: var(--blue); }
.btn.outline:hover { background: var(--blue-light); }
.btn.full { width: 100%; }
.btn.small { min-height: 40px; padding: 6px 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Header */
.header { position: sticky; top: 0; z-index: 10; background: var(--white); border-bottom: 1px solid var(--line); }
.header .container { display: flex; align-items: center; gap: 32px; min-height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; color: var(--text); text-decoration: none; }
.logo img { width: 32px; height: 32px; }
.menu { display: flex; gap: 24px; }
.menu a { color: var(--text); text-decoration: none; font-weight: 600; }
.menu a:hover, .menu a.active { color: var(--blue); }
.header-actions { margin-left: auto; display: flex; gap: 10px; }
.header-actions .btn { min-height: 40px; padding: 8px 16px; }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; font-weight: 600; cursor: pointer; }
@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .menu, .header-actions { display: none; }
  .header.open .container { flex-wrap: wrap; padding-bottom: 16px; }
  .header.open .menu { display: grid; gap: 4px; width: 100%; }
  .header.open .menu a { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .header.open .header-actions { display: flex; width: 100%; margin: 0; }
  .header.open .header-actions .btn { flex: 1; }
}

.load-error { background: #fef2f2; color: var(--red); border-bottom: 1px solid #fecaca; text-align: center; padding: 12px 20px; font-weight: 600; }
.demo-bar { background: var(--yellow); color: var(--text); text-align: center; font-size: 14px; font-weight: 600; padding: 6px 20px; }

/* Hero */
.hero { background: var(--blue-dark); color: var(--white); padding-block: 72px 80px; }
.hero h1 { font-size: clamp(34px, 6vw, 56px); max-width: 15ch; }
.hero p { font-size: 19px; color: #c7d2fe; margin-top: 16px; max-width: 520px; }
.searchbox { margin-top: 32px; background: var(--white); border-radius: 14px; padding: 8px; display: flex; gap: 8px; max-width: 640px; flex-wrap: wrap; }
.searchbox select { flex: 1 1 220px; border: 0; padding: 12px 14px; font-size: 17px; background: var(--white); border-radius: var(--radius); }
.searchbox .btn { flex: 0 0 auto; }
.hero-points { display: flex; gap: 24px; margin-top: 24px; flex-wrap: wrap; color: #c7d2fe; font-size: 15px; }
.hero-points span::before { content: "✓ "; color: var(--yellow); font-weight: 800; }

/* Subject picker */
.picker { position: relative; }
.searchbox .picker { flex: 1 1 260px; min-width: 0; }
.searchbox .picker-btn { border: 0; font-size: 17px; }
.filters .picker { flex: 0 1 280px; min-width: 200px; }
.picker-btn { color: var(--text); width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; text-align: left; font-weight: 600; }
.picker-btn:hover { border-color: #c7d2fe; }
.picker-btn[aria-expanded="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); }
.picker-icon { width: 20px; height: 20px; color: var(--blue); flex: 0 0 auto; }
.picker-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-value.placeholder { color: var(--grey); font-weight: 500; }
.picker-arrow { width: 18px; height: 18px; color: var(--grey); flex: 0 0 auto; transition: transform .15s; }
.picker-btn[aria-expanded="true"] .picker-arrow { transform: rotate(180deg); }
.picker-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; width: min(560px, calc(100vw - 40px)); background: var(--white); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(17, 24, 39, .16); overflow: hidden; }
.picker-search-wrap { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.picker-search-wrap svg { width: 20px; height: 20px; color: var(--grey); flex: 0 0 auto; }
.picker-search { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 16px; padding: 6px 0; background: none; }
.picker-list { max-height: min(420px, 60vh); overflow-y: auto; padding: 8px 12px 14px; display: grid; gap: 12px; }
.picker-group-name { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--grey); padding: 6px 4px 6px; }
.picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
@media (max-width: 480px) { .picker-grid { grid-template-columns: minmax(0, 1fr); } }
.picker-option { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border: 0; border-radius: 8px; background: none; cursor: pointer; text-align: left; }
.picker-option b { display: block; font-weight: 600; }
.picker-option small { display: block; font-size: 13px; color: var(--grey); }
.picker-option:hover, .picker-option:focus-visible { background: var(--bg-soft); outline: none; }
.picker-option:focus-visible { box-shadow: inset 0 0 0 2px var(--blue); }
.picker-option[aria-selected="true"] { background: var(--blue-light); }
.picker-option[aria-selected="true"] b { color: var(--blue); }
.picker-check { width: 20px; height: 20px; color: var(--blue); flex: 0 0 auto; visibility: hidden; }
.picker-option[aria-selected="true"] .picker-check { visibility: visible; }
.picker-none { text-align: center; color: var(--grey); padding: 20px; }

/* Sort buttons and toggle chip */
.segmented { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; gap: 2px; }
.segmented button { border: 0; background: none; padding: 8px 14px; border-radius: 7px; font-weight: 600; color: var(--grey); cursor: pointer; white-space: nowrap; }
.segmented button[aria-checked="true"] { background: var(--white); color: var(--text); box-shadow: 0 1px 3px rgba(17, 24, 39, .12); }
.chip-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-weight: 600; cursor: pointer; }
.chip-toggle::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); }
.chip-toggle[aria-pressed="true"] { border-color: var(--green); background: var(--green-light); color: var(--green); }
.chip-toggle[aria-pressed="true"]::before { border-color: var(--green); background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / 12px no-repeat; }

/* Subjects */
.subject-groups { display: grid; gap: 32px; }
.subject-group { display: grid; gap: 12px; }
.subject-group h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--grey); }
.subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.subject { display: block; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); font-weight: 700; background: var(--white); }
.subject span { display: block; font-weight: 400; font-size: 14px; color: var(--grey); }
.subject:hover { border-color: var(--blue); color: var(--blue); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; counter-reset: step; }
.step { display: grid; gap: 10px; }
.step::before { counter-increment: step; content: counter(step); width: 44px; height: 44px; border-radius: 50%; background: var(--blue); color: var(--white); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.step h3 { font-size: 20px; }
.step p { color: var(--grey); }

/* Features */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.feature { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 8px; align-content: start; }
.feature h3 { font-size: 18px; }
.feature p { color: var(--grey); }

/* Banner */
.banner { background: var(--blue-light); border-radius: 16px; padding: 40px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner h2 { font-size: clamp(24px, 3.5vw, 30px); }
.banner p { color: var(--grey); margin-top: 6px; }

/* Page header (inner pages) */
.page-top { background: var(--bg-soft); border-bottom: 1px solid var(--line); padding-block: 40px; }
.page-top h1 { font-size: clamp(28px, 4.5vw, 40px); }
.page-top p { color: var(--grey); margin-top: 8px; font-size: 18px; max-width: 640px; }

/* Tutor search */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding-block: 24px; }
.filters select, .filters input[type=search] { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); min-height: 46px; }
.filters input[type=search] { flex: 1 1 240px; min-width: 0; }
.filters label.check { display: flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; }
.filters input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--blue); }
.result-count { color: var(--grey); margin-bottom: 16px; }

.tutors { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; padding-bottom: 64px; }
@media (max-width: 400px) { .tutors { grid-template-columns: 1fr; } }
.tutor-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 14px; background: var(--white); text-decoration: none; color: var(--text); }
.tutor-card:hover { border-color: var(--blue); box-shadow: 0 6px 20px rgba(29, 78, 216, .08); }
.tutor-top { display: flex; gap: 14px; align-items: center; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--blue-light); color: var(--blue); display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: 0 0 auto; }
.avatar.big { width: 88px; height: 88px; font-size: 28px; }
.tutor-name { font-weight: 800; font-size: 18px; }
.tutor-subjects { color: var(--grey); font-size: 15px; }
.stars { color: var(--text); font-weight: 700; font-size: 15px; }
.stars::before { content: "★ "; color: var(--yellow); }
.tutor-bio { color: var(--grey); font-size: 15px; }
.card-labels { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tutor-bottom { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; }
.price { font-weight: 800; font-size: 20px; }
.price small { font-weight: 400; font-size: 14px; color: var(--grey); }
.label { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--green-light); color: var(--green); }
.label.new { background: var(--blue-light); color: var(--blue); }
.empty { text-align: center; padding: 48px 20px; color: var(--grey); grid-column: 1 / -1; }

/* Tutor profile */
.profile { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; padding-block: 40px 64px; align-items: start; }
@media (max-width: 900px) { .profile { grid-template-columns: 1fr; } }
.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile-head h1 { font-size: clamp(26px, 4vw, 34px); }
.profile-block { padding-block: 28px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.profile-block:last-child { border-bottom: 0; }
.profile-block h2 { font-size: 20px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fact { background: var(--bg-soft); border-radius: var(--radius); padding: 14px; text-align: center; }
.fact b { display: block; font-size: 22px; }
.fact span { font-size: 14px; color: var(--grey); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { padding-left: 30px; position: relative; }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: var(--green-light); color: var(--green); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.review { display: grid; gap: 4px; padding-block: 14px; border-top: 1px solid var(--line); }
.review:first-of-type { border-top: 0; padding-top: 0; }
.review small { color: var(--grey); }
.topics { display: flex; gap: 8px; flex-wrap: wrap; }
.topic { background: var(--bg-soft); border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; font-size: 14px; }

.book { border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: grid; gap: 18px; position: sticky; top: 92px; box-shadow: 0 8px 30px rgba(17, 24, 39, .06); background: var(--white); }
@media (max-width: 900px) { .book { position: static; } }
.book h2 { font-size: 20px; }
.choice { display: flex; gap: 12px; align-items: center; border: 2px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-light); }
.choice input { width: 18px; height: 18px; accent-color: var(--blue); margin: 0; }
.choice .grow { flex: 1; }
.choice small { display: block; color: var(--grey); }
.choices { display: grid; gap: 8px; }
.times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.time { position: relative; }
.time input { position: absolute; opacity: 0; inset: 0; }
.time span { display: block; text-align: center; border: 2px solid var(--line); border-radius: var(--radius); padding: 8px 4px; font-size: 14px; font-weight: 600; cursor: pointer; }
.time input:checked + span { border-color: var(--blue); background: var(--blue); color: var(--white); }
.time input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }
.field-label { font-weight: 700; font-size: 15px; }
.note { font-size: 14px; color: var(--grey); text-align: center; }
.success { background: var(--green-light); border-radius: var(--radius); padding: 18px; display: grid; gap: 8px; }
.success h3 { color: var(--green); }

/* Teach page */
.teach-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 48px; align-items: start; }
@media (max-width: 900px) { .teach-grid { grid-template-columns: 1fr; } }
.plan { border: 2px solid var(--blue); border-radius: 16px; padding: 28px; display: grid; gap: 18px; background: var(--white); }
.plan .amount { font-size: 48px; font-weight: 800; line-height: 1; }
.plan .amount small { font-size: 18px; font-weight: 500; color: var(--grey); }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 700; font-size: 15px; }
.form input:not([type=radio]), .form select { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 400; background: var(--white); }
.form-msg { font-size: 15px; }
.form-msg.error { color: var(--red); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--bg-soft); font-size: 14px; color: var(--grey); }
tr:last-child td { border-bottom: 0; }
td.num { text-align: right; font-weight: 700; white-space: nowrap; }

/* Safety page */
.promises { display: grid; gap: 16px; max-width: 800px; margin: 0 auto; }
.promise { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 8px; }
.promise h3 { font-size: 19px; }
.promise p { color: var(--grey); }

/* Log in */
.auth { max-width: 440px; margin: 0 auto; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: grid; gap: 24px; }
.auth h1 { font-size: 26px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-soft); border-radius: var(--radius); padding: 4px; }
.auth-tabs button { border: 0; background: none; padding: 10px; border-radius: 8px; font-weight: 700; color: var(--grey); cursor: pointer; }
.auth-tabs button[aria-selected="true"] { background: var(--white); color: var(--text); box-shadow: 0 1px 3px rgba(17, 24, 39, .1); }
.role { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.role legend { margin-bottom: 8px; padding: 0; }
.form .choice { display: flex; font-weight: 400; }

/* Footer */
.footer { background: var(--text); color: #d1d5db; padding-block: 48px 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.footer .logo { color: var(--white); }
.footer h4 { color: var(--white); margin: 0 0 10px; font-size: 15px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer a { color: #d1d5db; text-decoration: none; }
.footer a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid #374151; margin-top: 32px; padding-top: 20px; font-size: 14px; }
