/* ------------------------------------------------------------------
   Сайт репетитора — оформление главной страницы
   Акцентный цвет задаётся из админки: переменная --accent в <head>
------------------------------------------------------------------- */

:root {
  --accent: #2f6df6;
  --ink: #15181f;
  --ink-2: #3d4453;
  --muted: #6b7382;
  --line: #e6e4df;
  --bg: #fbfaf8;
  --bg-2: #f3f1ec;
  --white: #fff;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 22, 30, .05), 0 12px 32px -12px rgba(20, 22, 30, .14);
  --shadow-lg: 0 24px 60px -20px rgba(20, 22, 30, .28);
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.3rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 780px; }
.muted { color: var(--muted); }

/* ------------------------------- кнопки -------------------------------- */

.btn {
  --btn-bg: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  font-size: .97rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--btn-bg); color: #fff; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-ghost { background: transparent; border-color: color-mix(in srgb, currentColor 25%, transparent); color: inherit; }
.btn-ghost:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.btn-sm { padding: 9px 16px; font-size: .9rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ------------------------------- шапка --------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 20px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.logo-photo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.logo b { display: block; font-size: .98rem; letter-spacing: -.01em; }
.logo small { display: block; font-size: .76rem; color: var(--muted); }
.nav { display: flex; gap: 22px; }
.nav a { text-decoration: none; font-size: .93rem; color: var(--ink-2); padding: 4px 0; border-bottom: 1.5px solid transparent; }
.nav a:hover { color: var(--accent); border-color: var(--accent); }
.burger { display: none; background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--ink); }

/* -------------------------------- герой -------------------------------- */

.hero { padding: clamp(48px, 8vw, 96px) 0; background: var(--bg-2); }
.hero-dark {
  background:
    radial-gradient(900px 420px at 78% 18%, color-mix(in srgb, var(--accent) 42%, transparent), transparent 70%),
    linear-gradient(160deg, #171a22 0%, #0f1117 100%);
  color: #f2f3f5;
}
.hero-in { display: grid; grid-template-columns: 1.25fr .85fr; gap: 48px; align-items: center; }
.badge {
  display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent); margin-bottom: 18px;
}
.hero-dark .badge { background: rgba(255,255,255,.12); color: #fff; }
.hero h1 { margin-bottom: .3em; }
.lead { font-size: clamp(1.05rem, 2vw, 1.28rem); line-height: 1.5; color: var(--ink-2); max-width: 32em; }
.hero-dark .lead { color: rgba(255,255,255,.78); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }

.facts { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 40px 0 0; }
.facts div { min-width: 92px; }
.facts dt { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; color: var(--accent); }
.hero-dark .facts dt { color: #fff; }
.facts dd { margin: 2px 0 0; font-size: .86rem; color: var(--muted); }
.hero-dark .facts dd { color: rgba(255,255,255,.62); }

.hero-photo img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 24px; box-shadow: var(--shadow-lg); }
.hero-photo-empty {
  aspect-ratio: 4/5; border-radius: 24px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  font-size: 4rem; font-weight: 700; color: var(--accent); letter-spacing: .04em;
}
.hero-dark .hero-photo-empty { background: rgba(255,255,255,.08); color: #fff; }

/* ------------------------------- секции -------------------------------- */

.section { padding: clamp(48px, 7vw, 86px) 0; }
.section-alt { background: var(--bg-2); }
.section-title { margin-bottom: .3em; }
.section-sub { color: var(--muted); max-width: 46em; margin-bottom: 32px; }
.section-title + .cards, .section-title + .steps, .section-title + .reviews { margin-top: 32px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.card p { color: var(--ink-2); font-size: .95rem; }
.price { margin-top: auto; font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; }
.card-link { margin-top: 14px; font-size: .92rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.card-link:hover { text-decoration: underline; }

.steps { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; padding: 0; margin: 32px 0 0; }
.steps li { position: relative; padding-top: 8px; }
.step-n {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; margin-bottom: 14px;
}
.steps h3 { font-size: 1.02rem; }
.steps p { color: var(--ink-2); font-size: .93rem; }

.about-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 48px; align-items: start; }
.prose { color: var(--ink-2); font-size: 1.03rem; }
.about-photo { margin: 0; }
.about-photo img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 1/1; object-fit: cover; }

/* ------------------------------ расписание ------------------------------ */

.schedule-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 26px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.pill-free { background: color-mix(in srgb, #17a673 16%, transparent); color: #0e7a54; }
.hint { color: var(--muted); font-size: .9rem; }

.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.day {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.day-full { opacity: .62; }
.day-head { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.day-date { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 52px; padding: 6px; border-radius: 12px; background: var(--bg-2); }
.day-num { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.day-mon { font-size: .72rem; color: var(--muted); }
.day-meta { display: flex; flex-direction: column; }
.day-wd { font-weight: 600; font-size: .95rem; text-transform: capitalize; }
.day-wd.weekend { color: #c0392b; }
.day-free { font-size: .8rem; color: var(--muted); }

.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slot {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); font: inherit; cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s, transform .12s;
}
.slot:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--white)); transform: translateY(-1px); }
.slot-time { font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }
.slot-sub { font-size: .72rem; color: var(--muted); }
.slot-busy { cursor: not-allowed; background: var(--bg-2); color: var(--muted); border-style: dashed; }
.slot-busy:hover { border-color: var(--line); background: var(--bg-2); transform: none; }
.slot-busy .slot-time { text-decoration: line-through; font-weight: 600; }

.empty-state {
  background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 40px 24px; text-align: center; color: var(--ink-2);
}
.empty-state .btn { margin-top: 8px; }

/* -------------------------------- отзывы -------------------------------- */

.reviews-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.rating-line { color: var(--muted); font-size: .95rem; }
.rating-line b { color: var(--ink); }
.stars { color: #f5a623; letter-spacing: 1px; font-size: .95rem; }

.reviews { columns: 3 300px; column-gap: 20px; margin-top: 24px; }
.review {
  break-inside: avoid; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin: 0 0 20px; box-shadow: var(--shadow);
}
.review header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.review header > div:nth-child(2) { margin-right: auto; }
.review header b { display: block; font-size: .96rem; }
.review header small { color: var(--muted); font-size: .8rem; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
  font-weight: 700; font-size: .85rem; flex: none;
}
.review p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.reply { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); font-size: .9rem; color: var(--ink-2); }

/* --------------------------------- FAQ ---------------------------------- */

.faq details { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq details > div { padding-top: 10px; color: var(--ink-2); font-size: .95rem; }
.faq details > div p:last-child { margin-bottom: 0; }

/* ------------------------------- контакты ------------------------------- */

.contacts-box { display: grid; grid-template-columns: 1.2fr .9fr; gap: 40px; align-items: center; }
.contacts { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.contacts a {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px;
  font-weight: 600; transition: border-color .15s, transform .12s;
}
.contacts a:hover { border-color: var(--accent); transform: translateX(2px); }
.contacts small { display: block; font-size: .76rem; color: var(--muted); font-weight: 500; }
.ci { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--bg-2); font-size: 1rem; flex: none; }
.contacts-cta { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.contacts-cta p { color: var(--muted); }

/* -------------------------------- подвал -------------------------------- */

.footer { border-top: 1px solid var(--line); padding: 26px 0; font-size: .88rem; color: var(--muted); }
.footer-in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }

/* ------------------------------- модалки -------------------------------- */

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-back { position: absolute; inset: 0; background: rgba(16, 18, 24, .55); backdrop-filter: blur(2px); }
.modal-box {
  position: relative; width: min(460px, 100%); max-height: 92vh; overflow: auto;
  background: var(--white); border-radius: 20px; padding: 30px; box-shadow: var(--shadow-lg);
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-x { position: absolute; top: 12px; right: 14px; background: none; border: 0; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; }
.modal-slot { display: inline-block; background: var(--bg-2); border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: .95rem; }
.modal-box label { display: block; margin-bottom: 14px; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.modal-box input[type=text], .modal-box input[type=tel], .modal-box textarea {
  width: 100%; margin-top: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font: inherit; font-weight: 400; background: var(--bg); color: var(--ink);
}
.modal-box input:focus, .modal-box textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; border-color: var(--accent); }
.modal-box textarea { resize: vertical; }
.consent { font-size: .76rem; color: var(--muted); margin: 12px 0 0; }
.form-error { margin: 12px 0 0; color: #c0392b; font-size: .88rem; font-weight: 600; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.rate { display: flex; gap: 4px; margin-top: 6px; }
.rate button { background: none; border: 0; font-size: 1.7rem; line-height: 1; color: #d8d5cf; cursor: pointer; padding: 0 2px; }
.rate button.on { color: #f5a623; }
.done { text-align: center; padding: 14px 0; }
.done-ico { width: 58px; height: 58px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: color-mix(in srgb, #17a673 16%, transparent); color: #0e7a54; font-size: 1.7rem; }
.done p { color: var(--muted); }

/* ------------------------------ адаптивность ---------------------------- */

@media (max-width: 900px) {
  .hero-in, .about-grid, .contacts-box { grid-template-columns: 1fr; }
  .hero-photo { max-width: 340px; }
  .about-photo { max-width: 420px; }
  .reviews { columns: 2 280px; }
}

@media (max-width: 720px) {
  .nav {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .burger { display: block; order: 3; }
  .topbar-in .btn { order: 2; }
  .reviews { columns: 1; }
  .modal-box { padding: 24px 20px; }
  .facts { gap: 14px 26px; }
  .facts dt { font-size: 1.3rem; }
}
