/* NordRadio — стили сайта. Цвета бренда: оранжевый #EF7F1A, голубой #00A0E3, графит #5B5B5B.
   Три темы: светлая (по умолчанию), серая, тёмная — переключаются атрибутом data-theme на <html>. */
:root, [data-theme="light"] {
  --bg: #f6f8fa; --bg2: #ffffff; --surface: #ffffff; --surface2: #eef3f7;
  --text: #24282d; --muted: #6b737c; --line: #dde3e9;
  --accent: #EF7F1A; --accent-h: #d96d0c; --accent-text: #fff;
  --blue: #00A0E3; --graphite: #5B5B5B;
  --good: #1f9d55; --good-bg: #e3f6ea; --warn: #9a5b00; --warn-bg: #fff3e0; --bad: #c62828;
  --cell: #f2f6f9; --cell-has: #EF7F1A; --cell-off: repeating-linear-gradient(45deg, #eef1f4 0 4px, #f7f9fb 4px 8px);
  --shadow: 0 6px 24px rgba(20, 40, 60, .08);
  --hero: linear-gradient(135deg, #e9f6fd 0%, #fff4ea 100%);
  color-scheme: light;
}
[data-theme="gray"] {
  --bg: #3b3e42; --bg2: #44484d; --surface: #4a4e54; --surface2: #53585e;
  --text: #eef0f2; --muted: #b7bdc3; --line: #5d636a;
  --cell: #565b61; --cell-off: repeating-linear-gradient(45deg, #474b50 0 4px, #4d5156 4px 8px);
  --good: #6fdc9b; --good-bg: #2f4a3a; --warn: #ffc77a; --warn-bg: #5a4a33; --bad: #ff8a80;
  --shadow: 0 6px 24px rgba(0, 0, 0, .25);
  --hero: linear-gradient(135deg, #45505a 0%, #534a42 100%);
  color-scheme: dark;
}
[data-theme="dark"] {
  --bg: #0f1215; --bg2: #161a1f; --surface: #1a1f25; --surface2: #222830;
  --text: #e8ecef; --muted: #98a2ad; --line: #2b323a;
  --cell: #232a32; --cell-off: repeating-linear-gradient(45deg, #171b20 0 4px, #1c2127 4px 8px);
  --good: #5fd38d; --good-bg: #173226; --warn: #ffbd66; --warn-bg: #3a2b14; --bad: #ff7b72;
  --shadow: 0 6px 24px rgba(0, 0, 0, .45);
  --hero: radial-gradient(1200px 400px at 80% 0%, rgba(0,160,227,.18), transparent), radial-gradient(900px 400px at 0% 100%, rgba(239,127,26,.16), transparent), #0f1215;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 4.5vw, 46px); }
h2 { font-size: clamp(24px, 3.2vw, 34px); }
h3 { font-size: 20px; } h4 { font-size: 17px; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.section { padding: 56px 0; }
.wrap.section { padding-left: 16px; padding-right: 16px; }
.narrow { max-width: 560px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.good { color: var(--good); }
.lead { font-size: 18px; color: var(--muted); max-width: 820px; }
[hidden] { display: none !important; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none !important; transition: .15s; white-space: nowrap; color: var(--text); background: var(--surface2); }
.btn-accent { background: var(--accent); color: var(--accent-text); }
.btn-accent:hover { background: var(--accent-h); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-tg { background: #2AABEE; color: #fff; }
.btn-max { background: linear-gradient(135deg, #3f7bff, #8a4dff); color: #fff; }
.btn-lg { padding: 14px 22px; font-size: 17px; }
.btn-sm { padding: 7px 12px; font-size: 14px; }
.btn-block { width: 100%; margin-top: 10px; }
.btn.pulse { animation: pulse .6s; }
@keyframes pulse { 50% { transform: scale(1.04); } }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.chip.active, .chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); color: #fff; }

/* Шапка */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg2) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand img { height: 42px; width: auto; display: block; }
.logo-dark { display: none !important; }
[data-theme="dark"] .logo-light, [data-theme="gray"] .logo-light { display: none !important; }
[data-theme="dark"] .logo-dark, [data-theme="gray"] .logo-dark { display: inline-block !important; }
.mainnav { display: flex; gap: 4px; margin-left: auto; }
.mainnav a { color: var(--text); padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 15px; }
.mainnav a:hover, .mainnav a.active { background: var(--surface2); text-decoration: none; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; text-align: center; line-height: 20px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.theme-switch { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; }
.theme-switch button { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.theme-switch [data-theme-set="light"] { background: #f4f6f8; box-shadow: inset 0 0 0 1px #ccd; }
.theme-switch [data-theme-set="gray"] { background: #5B5B5B; }
.theme-switch [data-theme-set="dark"] { background: #111; box-shadow: inset 0 0 0 1px #444; }
.theme-switch button.on { border-color: var(--accent); }
.burger { display: none; margin-left: auto; background: none; border: 0; padding: 8px; cursor: pointer; }
.burger span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; }

.flashes { padding-top: 16px; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 10px; background: var(--good-bg); color: var(--good); }
.flash-err { background: #fdecea; color: #b42318; }
.flash-info { background: var(--surface2); color: var(--text); }
.warn { background: var(--warn-bg); color: var(--warn); padding: 8px 10px; border-radius: 8px; font-size: 14px; margin-top: 8px; }

/* Главный экран */
.hero { position: relative; background: var(--hero); overflow: hidden; }
.hero-in { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; padding-top: 64px; padding-bottom: 64px; position: relative; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--accent); font-size: 14px; }
.hero-text p { font-size: 18px; color: var(--muted); max-width: 620px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-art { display: flex; justify-content: center; }
.hero-art > img { border-radius: 20px; box-shadow: var(--shadow); }
.hero-icon { width: min(320px, 70vw); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; position: relative; }
.hero-icon img { width: 62%; position: relative; z-index: 2; filter: drop-shadow(0 10px 30px rgba(0,0,0,.15)); }
.hero-icon::before, .hero-icon::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--blue); opacity: .35; animation: ring 3s infinite; }
.hero-icon::after { border-color: var(--accent); animation-delay: 1.5s; }
@keyframes ring { from { transform: scale(.6); opacity: .6; } to { transform: scale(1.15); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hero-icon::before, .hero-icon::after { animation: none; } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: -32px; position: relative; z-index: 2; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 30px; color: var(--accent); line-height: 1.1; }
.stat span { color: var(--muted); font-size: 14px; }

.why { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: start; }
.why-text p { font-size: 17px; }
.why-img { border-radius: 16px; margin-bottom: 16px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cards-4 { grid-template-columns: repeat(4, 1fr); margin: 20px 0 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.cards .card { margin: 0; }
.card.mini h4 { color: var(--accent); }
.card p:last-child { margin-bottom: 0; }

/* Прайс */
.city-tabs, .tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.city-name { margin-top: 28px; font-size: 22px; border-left: 4px solid var(--blue); padding-left: 12px; }
.station-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.station-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; transition: transform .15s, border-color .15s; }
.station-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.sc-head { display: flex; gap: 14px; align-items: center; color: var(--text); text-decoration: none !important; }
.sc-head h4 { margin: 0; font-size: 19px; }
.st-logo { width: 64px; height: 64px; border-radius: 14px; object-fit: contain; flex: none; background: #fff; }
.st-logo.lg { width: 96px; height: 96px; border-radius: 20px; }
.st-badge { display: grid; place-items: center; background: var(--c); color: #fff; font-weight: 800; font-size: 12px; line-height: 1.1; text-align: center; padding: 6px; text-transform: uppercase; letter-spacing: .02em; }
.st-badge.lg { font-size: 16px; }
.sc-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ptable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ptable caption { text-align: left; font-weight: 700; font-size: 13px; color: var(--muted); padding-bottom: 4px; }
.ptable td { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.ptable td:last-child { text-align: right; font-weight: 700; }
.sc-package { display: flex; flex-direction: column; background: var(--surface2); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.sc-package b { color: var(--accent); }
.sc-package .muted { font-size: 13px; }
.station-card .btn-block { margin-top: auto; }
.notes { margin-top: 28px; padding: 20px 20px 20px 40px; background: var(--surface2); border-radius: 14px; color: var(--muted); font-size: 15px; }
.notes li { margin: 4px 0; }

.register-block { background: linear-gradient(135deg, rgba(0,160,227,.12), rgba(239,127,26,.12)); border: 1px solid var(--line); border-radius: 22px; padding: 32px; }
.contact-block { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 32px; box-shadow: var(--shadow); }
.contact-actions { display: flex; flex-direction: column; gap: 10px; }

/* Страница станции и калькулятор */
.back { display: inline-block; margin-bottom: 16px; }
.st-header { display: flex; gap: 24px; align-items: center; margin-bottom: 32px; }
.st-header h1 { margin-bottom: 4px; }
.calc { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.calc-controls { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.fld > span { font-weight: 600; font-size: 14px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
input:disabled { opacity: .55; cursor: not-allowed; }
.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-size: 14px; }
.check input { width: auto; }
.dur-presets { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.dur-presets .chip { padding: 3px 10px; font-size: 13px; }
.seg { display: flex; flex-direction: column; gap: 6px; }
.seg label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.seg input { width: auto; }
.seg .disabled { opacity: .5; }
.grid-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.grid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.mgrid { border-collapse: separate; border-spacing: 3px; font-size: 13px; min-width: 100%; }
.mgrid th { font-weight: 600; padding: 4px; white-space: nowrap; text-align: center; color: var(--muted); }
.mgrid thead th span { display: block; font-size: 11px; text-transform: uppercase; }
.mgrid thead th.we { color: var(--accent); }
.mgrid th.slot, .mgrid th.corner, .mgrid tr.sum th { position: sticky; left: 0; background: var(--surface); text-align: left; z-index: 1; color: var(--text); }
.mgrid th.slot small { display: block; color: var(--muted); font-weight: 400; }
.mgrid tr.grp td { font-weight: 700; color: var(--blue); padding: 8px 4px 2px; position: sticky; left: 0; }
.mgrid td.cell, .mgrid td.off { width: 38px; min-width: 38px; height: 34px; border-radius: 7px; text-align: center; font-weight: 800; }
.mgrid td.cell { background: var(--cell); cursor: pointer; user-select: none; -webkit-user-select: none; transition: background .1s; }
.mgrid td.cell:hover { outline: 2px solid var(--accent); }
.mgrid td.cell.has { background: var(--cell-has); color: #fff; }
.mgrid td.off { background: var(--cell-off); }
.mgrid tr.sum td { text-align: center; font-weight: 800; border-radius: 7px; height: 30px; }
.mgrid tr.sum td.ok { background: var(--good-bg); color: var(--good); }
.mgrid tr.sum td.few { background: var(--warn-bg); color: var(--warn); }
.calc-side { position: sticky; top: 84px; }
.result h3 { margin-bottom: 4px; }
.res-big { font-size: 32px; font-weight: 800; color: var(--accent); margin-bottom: 8px; }
.rrow { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 15px; border-bottom: 1px dashed var(--line); }
.rrow:last-child { border-bottom: 0; }
.rrow.good b { color: var(--good); }
.rrow.total { font-size: 20px; border-top: 2px solid var(--line); border-bottom: 0; padding-top: 10px; margin-top: 6px; }
.rrow.total b { color: var(--accent); }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.plan-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; }
.plan-total b { font-size: 22px; }

/* Медиаплан */
.plan-item .pi-head { display: flex; justify-content: space-between; gap: 16px; }
.pi-sum { font-size: 22px; font-weight: 800; color: var(--accent); white-space: nowrap; }
.pi-meta { color: var(--muted); font-size: 14px; margin: 6px 0; }
.pi-actions { display: flex; gap: 8px; margin-top: 10px; }
.plan-summary { max-width: 560px; margin-left: auto; }
.disc-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; padding: 10px 0; }
.disc-row .fld { margin: 0; width: 120px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.order-form .btn { margin-top: 8px; }

/* Авторизация, кабинет, ролики */
.auth-page { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: start; }
.auth-form { max-width: 480px; width: 100%; margin: 0 auto; }
.acc-head { display: flex; justify-content: space-between; align-items: center; }
.acc-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; align-items: start; }
.acc-grid .btn { margin: 4px 4px 0 0; }
.locked { padding: 40px; }
.locked .btn { margin: 6px; }
.chrono { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; background: var(--surface2); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.chrono-est { display: flex; gap: 20px; flex-wrap: wrap; }
.chrono-est .bad { color: var(--bad); }
.chrono-sw { display: flex; gap: 8px; align-items: center; }
.sw-time { font: 700 24px/1 ui-monospace, Menlo, Consolas, monospace; min-width: 70px; }

/* Подвал и плавающие контакты */
.footer { background: var(--bg2); border-top: 1px solid var(--line); padding: 40px 0 20px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer h4 { margin-bottom: 12px; }
.big-phone { font-size: 22px; font-weight: 800; color: var(--text); }
.messengers { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.copy { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.float-contacts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.fc { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.25); transition: transform .15s; }
.fc:hover { transform: scale(1.08); }
.fc svg { width: 24px; height: 24px; }
.fc-tg { background: #2AABEE; } .fc-max { background: linear-gradient(135deg, #3f7bff, #8a4dff); } .fc-phone { background: var(--accent); }

/* Адаптив */
@media (max-width: 1000px) {
  .calc { grid-template-columns: minmax(0, 1fr); }
  .calc-side { position: static; }
  .cards-4 { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .burger { display: block; }
  .mainnav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: var(--bg2); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  body.menu-open .mainnav { display: flex; }
  .top-actions { margin-left: 0; }
  .hide-sm { display: none; }
  .hero-in, .why, .contact-block, .auth-page, .acc-grid, .footer-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .hero-icon { width: 180px; }
  .hero-in { padding-top: 32px; }
}
@media (max-width: 560px) {
  .topbar-in { gap: 10px; }
  .brand img { height: 34px; }
  .theme-switch button { width: 16px; height: 16px; }
  .cards, .cards-4, .sc-prices { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat b { font-size: 24px; }
  .section { padding: 36px 0; }
  .register-block, .contact-block { padding: 20px; }
  .st-header { flex-direction: column; align-items: flex-start; }
  .station-grid { grid-template-columns: 1fr; }
  .fc { width: 44px; height: 44px; }
  .btn-lg { width: 100%; }
}
input[type=color] { height: 44px; padding: 4px; cursor: pointer; }
.sc-prices { align-items: start; }
.mgrid th.slot, .mgrid th.corner { width: 1%; }

/* Картинки оформления из админки */
.hero.has-bg { background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 82%, transparent) 45%, color-mix(in srgb, var(--bg) 15%, transparent) 100%), var(--hero-bg) center/cover no-repeat; }
.hero.has-bg .hero-text h1 { text-shadow: 0 2px 18px color-mix(in srgb, var(--bg) 70%, transparent); }
.hero-art > img { max-height: 460px; object-fit: cover; aspect-ratio: 1; }
.block-img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; min-height: 220px; }
.register-block.with-img { display: grid; grid-template-columns: 1fr 1.6fr; gap: 28px; align-items: center; }
.register-block.with-img .cards-4 { grid-template-columns: 1fr 1fr; }
.contact-block.with-img { grid-template-columns: 0.9fr 1.2fr 1fr; }
.why-img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.page-banner { background: linear-gradient(0deg, rgba(0,0,0,.55), rgba(0,0,0,.1)), var(--bg) center/cover no-repeat; min-height: 260px; display: flex; align-items: flex-end; }
.page-banner h1 { color: #fff; padding: 32px 0; margin: 0; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
@media (max-width: 860px) {
  .register-block.with-img, .contact-block.with-img { grid-template-columns: 1fr; }
  .hero.has-bg { background: linear-gradient(0deg, var(--bg) 35%, color-mix(in srgb, var(--bg) 55%, transparent) 100%), var(--hero-bg) center/cover no-repeat; }
}
.hero-in > * { min-width: 0; }
.hero-art > img { width: 100%; max-width: 440px; height: auto; }
@media (max-width: 860px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); }
  .hero-art > img { max-width: 240px; }
}
.page-banner .wrap { width: 100%; }
@media (max-width: 560px) { .btn-lg { white-space: normal; text-align: center; } }
.hero-solo { grid-template-columns: minmax(0, 1fr); min-height: 520px; padding-top: 80px; padding-bottom: 96px; }
.hero-solo .hero-text { max-width: 640px; }
@media (max-width: 860px) { .hero-solo { min-height: 0; padding-top: 48px; padding-bottom: 64px; } }

/* Плашка-заглушка логотипа: шрифт подбирается под длину самого длинного слова, текст не выходит за квадрат */
.st-badge { --box: 64px; overflow: hidden; padding: 5px; word-break: normal; overflow-wrap: anywhere; hyphens: none; }
.st-badge.lg { --box: 96px; }
.atable .st-badge { --box: 40px; padding: 3px; }
.st-badge, .st-badge.lg, .atable .st-badge { font-size: min(calc(var(--box) * 0.84 / (var(--len, 6) * 0.82)), calc(var(--box) * 0.24)); letter-spacing: 0; }
.st-badge > span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; }
