/* Сайт Клиники современной медицины - вариант A («Светлая, дружелюбная»). Шрифт - настройка
   site.font (по умолчанию Manrope), приходит переменной --site-font из layout.html.
   #B460D4 - фирменный акцент; под белым текстом - #8A3DAD (контраст 4.5:1). */
:root {
    --brand: #B460D4;
    --brand-strong: #8A3DAD;
    --brand-deep: #7E36A0;
    --brand-link: #7A3399;
    --tint: #F6EEFA;
    --tint-2: #FAF5FC;
    --photo: #F3E8F8;
    --line: #EFE6F3;
    --line-strong: #E4D2EE;
    --ink: #1F1A24;
    --ink-2: #5B4A66;
    --ink-3: #6E5F78;
    --footer: #24122D;
    --radius: 16px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--site-font, 'Manrope', system-ui, sans-serif); color: var(--ink); background: #fff; }
a { color: var(--brand-link); text-decoration: none; }
a:hover { color: #5E2478; }
img { max-width: 100%; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

.btn-brand, .btn-ghost {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 24px; border-radius: 14px; font-weight: 700; font-size: 15px;
    border: 0; cursor: pointer; font-family: inherit; text-decoration: none;
}
.btn-brand { background: var(--brand-strong); color: #fff; }
.btn-brand:hover { background: var(--brand-deep); color: #fff; }
.btn-ghost { background: #fff; border: 2px solid var(--line-strong); color: #3A2F42; }
.btn-ghost:hover { border-color: var(--brand); color: var(--ink); }
.btn-lg { min-height: 56px; padding: 0 30px; font-size: 16px; }

.eyebrow { font-size: 13px; font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: .08em; }
.section { padding: 80px 0; }
.section-tint { background: var(--tint-2); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head h2 { margin: 10px 0 0; font-size: 40px; font-weight: 800; letter-spacing: -.01em; }
.muted { color: var(--ink-2); }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--tint); color: var(--brand-link); font-size: 13px; font-weight: 700; }
.photo-ph { background: var(--photo); border-radius: 20px; display: flex; align-items: center; justify-content: center; color: #8A6A9A; font-weight: 600; }

/* шапка */
.topbar { background: var(--tint); font-size: 13px; color: var(--ink-2); }
.topbar .wrap { display: flex; justify-content: space-between; gap: 16px; min-height: 40px; align-items: center; flex-wrap: wrap; }
.topbar span + span::before { content: '·'; margin: 0 10px; color: var(--ink-3); }
.site-header { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; gap: 36px; min-height: 84px; }
.logo { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.logo-mark { width: 44px; height: 44px; flex-shrink: 0; display: block; }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text b { font-size: 16px; font-weight: 800; }
.logo-text span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.nav { display: flex; gap: 26px; font-size: 15px; font-weight: 600; flex-grow: 1; }
.nav a { color: #3A2F42; }
.nav a:hover { color: var(--brand-link); }
.header-phone { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; }
.header-phone a { font-size: 17px; font-weight: 800; color: var(--ink); }
.header-phone span { font-size: 12px; color: var(--ink-3); }
.btn-cabinet { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 14px;
    border: 2px solid var(--line-strong); color: #3A2F42; font-weight: 700; font-size: 15px; white-space: nowrap; }
.btn-cabinet:hover { border-color: var(--brand); color: var(--ink); }
.menu-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }

/* главный экран */
.hero { padding: 56px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) 520px; gap: 56px; align-items: center; }
.hero h1 { overflow-wrap: anywhere; margin: 22px 0 18px; font-size: 58px; line-height: 1.06; font-weight: 800; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p { margin: 0; max-width: 540px; font-size: 19px; line-height: 1.6; color: var(--ink-2); }
.hero-actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.hero-facts { display: flex; gap: 24px; margin-top: 36px; font-size: 15px; font-weight: 600; color: #3A2F42; flex-wrap: wrap; }
.hero-facts span::before { content: '✓'; color: var(--brand); font-weight: 800; margin-right: 8px; }
.hero-photo { position: relative; height: 460px; }
.hero-photo .photo-ph { height: 100%; border-radius: 32px; }
.hero-card { position: absolute; left: -36px; bottom: 32px; width: 290px; padding: 18px 20px; border-radius: 20px; background: #fff; box-shadow: 0 18px 40px rgba(60, 20, 80, .14); }
.hero-card b { display: block; font-size: 15px; }
.hero-card span { font-size: 13px; color: var(--ink-2); }

/* карточки */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.news-card .photo-ph, .news-card img { height: 210px; width: 100%; object-fit: cover; border-radius: 20px; }
.news-card .meta { display: flex; gap: 10px; align-items: center; margin: 18px 0 8px; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.news-card h3 { margin: 0 0 8px; font-size: 21px; line-height: 1.3; font-weight: 800; }
.news-card h3 a { color: var(--ink); }
.news-card p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.service-tile { min-height: 80px; padding: 0 20px 0 24px; border-radius: 16px; background: #fff; border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink); font-size: 17px; font-weight: 700; }
.service-tile:hover { border-color: var(--brand); color: var(--ink); }
.arrow { width: 36px; height: 36px; flex-shrink: 0; border-radius: 999px; background: var(--tint); display: flex; align-items: center; justify-content: center; color: var(--brand-strong); }
.doctor-card { display: flex; flex-direction: column; color: var(--ink); }
.doctor-card .photo-ph, .doctor-card img { height: 300px; width: 100%; object-fit: cover; border-radius: 20px; }
.doctor-card h3 { margin: 16px 0 4px; font-size: 18px; line-height: 1.3; font-weight: 800; min-height: 47px; }
.doctor-card .pos { font-size: 14px; color: var(--ink-3); }
.doctor-card .next { font-size: 13px; font-weight: 700; color: #1E7A4F; margin-top: 6px; min-height: 18px; }
.doctor-card .btn-ghost { margin-top: 14px; }

/* прайс */
.price-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.price-table td { padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 16px; }
.price-table td.price { text-align: right; font-weight: 800; white-space: nowrap; }
.price-table tr:last-child td { border-bottom: 0; }

/* запись */
.booking { background: var(--brand-deep); color: #fff; border-radius: 32px; padding: 48px; display: grid; grid-template-columns: minmax(0, 1fr) 560px; gap: 48px; }
.booking h2 { margin: 0; font-size: 42px; line-height: 1.1; font-weight: 800; }
.booking .lead { margin: 16px 0 28px; font-size: 17px; line-height: 1.6; color: #F1E4F7; }
.branch-box { padding: 18px 20px; border-radius: 18px; background: rgba(255, 255, 255, .1); margin-bottom: 12px; }
.branch-box b { display: block; font-size: 16px; }
.branch-box span { font-size: 14px; color: #F1E4F7; }
.booking-form { background: #fff; color: var(--ink); border-radius: 24px; padding: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-content: start; }
.booking-form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field { min-width: 0; }
/* width/min-width - иначе select с длинным названием услуги и input[type=date] в iOS Safari
   распирают колонку шире экрана (горизонтальный скролл на iPhone SE) */
.field input, .field select, .field textarea { width: 100%; min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-strong); font: inherit; font-size: 15px; font-weight: 500; color: var(--ink); background: #fff; }
.field textarea { height: 70px; padding: 10px 14px; }
.field select { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%235B4A66' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 36px; text-overflow: ellipsis; }
.field input[type=date] { display: block; line-height: 48px; }
.booking > * { min-width: 0; }
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(180, 96, 212, .2); }
.slots { display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px; }
.slot { min-width: 72px; height: 42px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.slot.active { background: var(--brand-strong); color: #fff; border-color: var(--brand-strong); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.form-msg { font-size: 14px; font-weight: 600; }
.form-msg.err { color: #B3261E; }
.form-msg.ok { color: #1E7A4F; }

/* подвал */
.footer { background: var(--footer); color: #E6D8EE; padding: 56px 0 36px; }
.footer .cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px; }
.footer b { color: #fff; display: block; margin-bottom: 10px; }
.footer a { color: #E6D8EE; display: block; margin-bottom: 8px; }
.footer .bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .12); display: flex; justify-content: space-between; gap: 16px; font-size: 13px; color: #B7A3C3; flex-wrap: wrap; }

.page-hero { padding: 48px 0 24px; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.page-hero h1 { margin: 10px 0 0; font-size: 44px; font-weight: 800; letter-spacing: -.01em; }
.prose { font-size: 17px; line-height: 1.7; color: #3A2F42; max-width: 760px; white-space: pre-line; }

@media (max-width: 1100px) {
    .hero .wrap, .booking { grid-template-columns: minmax(0, 1fr); }
    .hero-photo { display: none; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nav { display: none; }
    .nav.open { display: flex; position: absolute; top: 84px; left: 0; right: 0; flex-direction: column; background: #fff; padding: 16px 24px; border-bottom: 1px solid var(--line); }
    .menu-toggle { display: block; margin-left: auto; }
    .site-header .wrap { gap: 16px; }
    .footer .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .wrap { padding: 0 16px; }
    /* шапка: кнопка записи есть на главном экране, в шапке оставляем логотип и меню */
    .site-header .wrap { gap: 12px; min-height: 64px; justify-content: space-between; }
    .site-header .btn-brand { display: none; }
    .btn-cabinet { min-height: 42px; padding: 0 12px; margin-left: auto; }
    .btn-cabinet span { display: none; }
    .menu-toggle { margin-left: 0 !important; }
    .nav.open { top: 64px; }
    .logo-mark { width: 38px; height: 38px; }
    .hero h1 { font-size: 36px; }
    .section { padding: 56px 0; }
    .section-head h2, .booking h2, .page-hero h1 { font-size: 30px; }
    .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .booking { padding: 20px 16px; border-radius: 24px; gap: 24px; }
    .slot { min-width: 64px; }
    .booking-form { grid-template-columns: minmax(0, 1fr); padding: 18px; }
    .booking-section .wrap { padding: 0 12px; }
    .header-phone { display: none; }
    .topbar { display: none; }
    .footer .cols { grid-template-columns: 1fr; }
}
