/* WebRating — стили. Мобильный дизайн в первую очередь. */

:root {
  --ink: #0a2540;
  --ink-2: #334e68;
  --muted: #627d98;
  --line: #dde5ee;
  --bg: #f5f8fb;
  --card: #ffffff;
  --sky: #0aa5c2;
  --sky-dark: #087f96;
  --sky-soft: #e3f6fa;
  --gold: #e3b341;
  --gold-soft: #fbf1d6;
  --green: #1f9d6a;
  --green-soft: #e1f5ec;
  --blue: #4a6fa5;
  --blue-soft: #e8eef8;
  --red: #c0392b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(10,37,64,.06), 0 8px 24px rgba(10,37,64,.06);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* орнамент «қошқар мүйіз» — стилизованные бараньи рога */
  --ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='48' viewBox='0 0 96 48' fill='none' stroke='%23e3b341' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M48 44V22'/%3E%3Cpath d='M48 22c-6-10-18-10-20 0-1 6 6 8 8 3 1-3-2-5-4-3'/%3E%3Cpath d='M48 22c6-10 18-10 20 0 1 6-6 8-8 3-1-3 2-5 4-3'/%3E%3Cpath d='M0 44h96' stroke-opacity='.35'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  line-height: 1.5; font-size: 16px;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--sky-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 5.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4.5vw, 2.25rem); }
h3 { font-size: 1.125rem; font-weight: 700; }
p { margin: 0 0 1em; }
b { font-weight: 700; }
small { font-size: .8em; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hide-mobile { display: none !important; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 760px; }
.section { padding: 56px 0; }
.section-lead { color: var(--ink-2); font-size: 1.05rem; max-width: 760px; margin-bottom: 28px; }
.note-line { color: var(--ink-2); margin-top: 24px; }
.fineprint { color: var(--muted); font-size: .875rem; margin-top: 16px; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px; border: 1.5px solid transparent;
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none !important;
  transition: background .15s, color .15s, border-color .15s, transform .05s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #10345a; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-lg { padding: 14px 22px; font-size: 1.05rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.link-btn { background: none; border: 0; color: var(--sky-dark); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* 1. Шапка */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; }
.logo-mark { width: 36px; height: 36px; }
.logo-text { font-weight: 800; font-size: 1.2rem; line-height: 1; display: flex; flex-direction: column; }
.logo-text small { font-weight: 600; color: var(--muted); font-size: .65rem; margin-top: 3px; display: none; }
.main-nav { display: none; gap: 22px; font-weight: 600; }
.main-nav a { color: var(--ink-2); white-space: nowrap; }
.main-nav a:hover { color: var(--ink); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.burger { width: 40px; height: 40px; border: 0; background: none; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 8px; cursor: pointer; }
.burger span { height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.main-nav.is-open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: #fff; padding: 12px 16px 16px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.main-nav.is-open a { padding: 10px 0; border-bottom: 1px solid var(--line); }
.main-nav.is-open a:last-child { border-bottom: 0; }

/* 2. Первый экран */
.hero { position: relative; background: linear-gradient(180deg, #ffffff 0%, #edf5f9 100%); padding: 48px 0 72px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 300px at 90% 0%, rgba(10,165,194,.14), transparent 70%),
              radial-gradient(400px 260px at 0% 100%, rgba(227,179,65,.16), transparent 70%);
}
.hero .container { position: relative; }
.hero h1 { max-width: 820px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; margin: 18px -16px 14px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink-2); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer;
}
.tab.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab.is-soon:hover { border-color: var(--sky); color: var(--ink); }
.soon { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--gold-soft); color: #8a6412; padding: 2px 7px; border-radius: 999px; }
.hero-sub { font-size: clamp(1.15rem, 3.5vw, 1.5rem); font-weight: 700; color: var(--ink); margin: 6px 0 8px; }
.hero-lead { color: var(--ink-2); max-width: 680px; font-size: 1.05rem; }
.stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 10px 24px; margin: 22px 0 6px; }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 1.6rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.stat span { color: var(--muted); font-weight: 600; font-size: .8rem; }
.updated { color: var(--muted); font-size: .9rem; margin-bottom: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions .btn { flex: 1 1 auto; }

/* Орнамент-разделитель */
.ornament { height: 48px; background: var(--ornament) repeat-x center bottom; opacity: .9; }
.ornament-bottom { position: absolute; left: 0; right: 0; bottom: 0; }
.ornament-top { transform: scaleY(-1); opacity: .7; }

/* 3. Карточки */
.cards { display: grid; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card p { color: var(--ink-2); margin-bottom: .6em; font-size: .95rem; }
.card p:last-child { margin-bottom: 0; }
.card-icon { font-size: 1.6rem; margin-bottom: 8px; line-height: 1; }
.card-tall { display: flex; flex-direction: column; }
.card-tall .btn, .card-tall .btn-row { margin-top: auto; }
.card-tall p + .btn, .card-tall p + .btn-row { margin-top: 12px; }

/* 4. Фильтры */
.section-rating { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rating-head { margin-bottom: 20px; }
.rating-dates { color: var(--muted); margin: 0; }
.filters { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 18px; }
.filter-search { grid-column: 1 / -1; }
.filters input[type="search"], .filters select, .form input, .form select, .form textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: .95rem; color: var(--ink);
}
.filters input:focus, .filters select:focus, .form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--sky); outline-offset: 1px; border-color: var(--sky); }
.filter-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-weight: 600; font-size: .85rem; color: var(--ink-2); cursor: pointer; }
.chip.is-on { background: var(--sky-soft); border-color: var(--sky); color: var(--sky-dark); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--ink-2); margin-left: auto; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; flex: 0 0 auto; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.switch input:checked + .switch-track { background: var(--sky); }
.switch input:checked + .switch-track::after { left: 19px; }
.filter-footer { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .9rem; }
.found { font-weight: 700; }
.hint { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; margin: 0; }

/* Легенда уровней */
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.lvl { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: .8rem; white-space: nowrap; }
.lvl::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.lvl-leader { background: var(--gold-soft); color: #7a5a0f; }
.lvl-strong { background: var(--green-soft); color: var(--green); }
.lvl-reliable { background: var(--blue-soft); color: var(--blue); }

/* 5. Список студий */
.table-head { display: none; }
.studio-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.studio {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; transition: border-color .15s;
}
.studio:hover { border-color: #c5d2e0; }
.studio.is-open { border-color: var(--sky); }
.studio-row {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 6px 10px; align-items: center; padding: 14px 14px; width: 100%;
  background: none; border: 0; font: inherit; text-align: left; cursor: pointer; color: inherit;
}
.studio-rank { font-weight: 800; font-size: 1.15rem; color: var(--ink); grid-row: 1 / span 2; align-self: start; padding-top: 2px; }
.studio-name { font-weight: 800; font-size: 1.05rem; }
.studio-meta { grid-column: 2; color: var(--muted); font-size: .85rem; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.studio-meta span { white-space: nowrap; }
.studio-level { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
.studio-level .lvl-short { display: inline; }
.studio-level .lvl-full { display: none; }
.studio-detail { display: none; padding: 0 14px 16px 14px; border-top: 1px dashed var(--line); margin-top: 0; }
.studio.is-open .studio-detail { display: block; }
.studio-detail h4 { margin: 14px 0 6px; font-size: .95rem; font-weight: 800; }
.studio-detail p { color: var(--ink-2); font-size: .95rem; }
.year-line { font-size: .875rem !important; color: var(--muted) !important; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.gap-warn { color: #9a5b00; font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.tag { padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; border: 1px solid var(--line); color: var(--ink-2); background: #fff; }
.tag.good { background: var(--green-soft); border-color: transparent; color: var(--green); }
.tag.weak { background: #f1f4f7; border-color: transparent; color: var(--muted); }
.detail-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: .9rem; font-weight: 600; }
.detail-fine { color: var(--muted); font-size: .8rem; margin: 12px 0 0; }
.detail-fine a { display: block; margin-top: 4px; }
.empty { text-align: center; color: var(--muted); padding: 32px 0; }
.more-wrap { text-align: center; margin-top: 18px; }
.more-wrap .btn { min-width: 240px; }

/* 6. Формы */
.section-match { background: linear-gradient(180deg, var(--bg), #e9f3f7); }
.form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.field label input, .field label select, .field label textarea { margin-top: 6px; font-weight: 400; }
.field .opt { color: var(--muted); font-weight: 500; }
.field-row { display: grid; gap: 0 12px; }
.form textarea { resize: vertical; }
.form .btn { width: 100%; }
.consent { color: var(--muted); font-size: .8rem; margin: 12px 0 0; }
.error { display: none; color: var(--red); font-size: .85rem; margin: 6px 0 0; }
.field.has-error .error { display: block; }
.field.has-error input { border-color: var(--red); }
.success { background: var(--green-soft); color: var(--green); padding: 12px 14px; border-radius: 10px; font-weight: 700; margin: 14px 0 0; }
.form.is-sent > :not(.success) { display: none; }
.form.is-sent .success { display: block; margin-top: 0; }

/* 7. Значок */
.badge-preview { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--ink); font-weight: 700; font-size: .85rem; margin: 6px 0 14px; background: #fff; }
.badge-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--ink); color: var(--gold); display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; }
.code { background: #0f1f2e; color: #d7e3f0; padding: 12px 14px; border-radius: 10px; font-size: .78rem; line-height: 1.5; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 0 0 12px; }

/* 8. Методика и список */
.section-method { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.list { padding-left: 20px; color: var(--ink-2); }
.list li { margin-bottom: 8px; }
.two-col { display: grid; gap: 16px; margin: 16px 0; }
.two-col p { color: var(--ink-2); }
.section-method h3 { margin-top: 24px; }

/* 9. FAQ */
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; padding: 0 16px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 28px 14px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-2); margin: 0 0 14px; }

/* 10. Подвал */
.site-footer { background: var(--ink); color: #c9d6e3; margin-top: 0; }
.site-footer .ornament-top { opacity: .5; }
.footer-inner { display: grid; gap: 24px; padding: 32px 16px 24px; }
.footer-title { color: #fff; font-weight: 700; margin-bottom: 6px; }
.footer-muted { color: #8fa6bd; font-size: .9rem; margin: 0; }
.footer-nav, .footer-contacts { display: flex; flex-direction: column; gap: 10px; }
.site-footer a { color: #e3ecf5; font-weight: 600; }
.site-footer a small { color: #8fa6bd; font-weight: 500; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 16px; color: #8fa6bd; font-size: .85rem; }

/* Модалка */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10,37,64,.55); }
.modal-dialog { position: relative; background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 24px 18px 28px; box-shadow: 0 -8px 40px rgba(0,0,0,.25); }
.modal-close { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border: 0; background: var(--bg); border-radius: 50%; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink-2); }
.modal .form { border: 0; box-shadow: none; padding: 0; }
.modal h3 { padding-right: 36px; }
body.modal-open { overflow: hidden; }

/* Планшет и шире */
@media (min-width: 640px) {
  .hide-mobile { display: inline-flex !important; }
  .logo-text small { display: block; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .form .btn { width: auto; }
  .hero-actions .btn { flex: 0 0 auto; }
  .cards-3 { grid-template-columns: repeat(3, 1fr); }
  .cards-5 { grid-template-columns: repeat(3, 1fr); }
  .two-col { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .filter-search { grid-column: auto; }
  .modal { align-items: center; padding: 20px; }
  .modal-dialog { border-radius: 18px; padding: 28px 28px 32px; }
  .footer-inner { grid-template-columns: 1.4fr 1fr 1fr; }
}

/* Десктоп */
@media (min-width: 960px) {
  .section { padding: 72px 0; }
  .main-nav { display: flex; }
  .burger { display: none; }
  .cards-5 { grid-template-columns: repeat(5, 1fr); }
  .hero { padding: 72px 0 96px; }
  .tabs { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }

  .table-head { display: grid; grid-template-columns: 56px 1fr 180px 80px 150px 170px; gap: 12px; padding: 0 18px 8px; color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
  .studio-list { gap: 8px; }
  .studio-row { grid-template-columns: 56px 1fr 180px 80px 150px 170px; gap: 12px; padding: 14px 18px; align-items: center; }
  .studio-rank { grid-row: auto; padding-top: 0; }
  .studio-meta { display: contents; }
  .studio-meta span { font-size: .95rem; color: var(--ink-2); white-space: normal; }
  .studio-meta .m-city { grid-column: 3; }
  .studio-meta .m-year { grid-column: 4; }
  .studio-meta .m-price { grid-column: 5; }
  .studio-level { grid-column: 6; grid-row: auto; }
  .studio-level .lvl-short { display: none; }
  .studio-level .lvl-full { display: inline; }
  .studio-detail { padding: 0 18px 20px 86px; }
}
