/* ==========================================================================
   stomatolog-rzn.ru — современный адаптивный дизайн
   Чистый CSS, mobile-first, без внешних фреймворков.
   ========================================================================== */

/* --- 1. Переменные и сброс ------------------------------------------------ */
:root {
	--accent: #0f8a8c;
	--accent-strong: #0b6b6d;
	--accent-soft: #e3f5f4;
	--accent-contrast: #ffffff;

	--ink: #16212b;
	--ink-soft: #46586a;
	--muted: #6b7c8d;
	--bg: #ffffff;
	--bg-soft: #f4f7f8;
	--surface: #ffffff;
	--line: #e3eaed;

	--radius-sm: 10px;
	--radius: 16px;
	--radius-lg: 24px;

	--shadow-sm: 0 1px 2px rgba(16, 33, 43, .06), 0 4px 12px rgba(16, 33, 43, .05);
	--shadow: 0 10px 30px rgba(16, 33, 43, .09);

	--header-h: 64px;
	--container: 1140px;
	--gutter: clamp(16px, 4vw, 32px);
	--section-y: clamp(48px, 7vw, 88px);

	--font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-display: "Playfair Display", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
	:root {
		--accent: #38c2c0;
		--accent-strong: #7fdedb;
		--accent-soft: #10302f;
		--accent-contrast: #05201f;

		--ink: #e9f0f2;
		--ink-soft: #b7c6cd;
		--muted: #8fa1ab;
		--bg: #0d141b;
		--bg-soft: #121c25;
		--surface: #16212b;
		--line: #23323d;

		--shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
		--shadow: 0 12px 32px rgba(0, 0, 0, .45);
	}
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font);
	font-size: clamp(16px, 1.02vw + 14px, 18px);
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-strong); text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3 {
	margin: 0 0 .5em;
	line-height: 1.15;
	font-weight: 700;
	letter-spacing: -.02em;
	text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.2rem + 3.6vw, 3.1rem); }
h2 { font-size: clamp(1.55rem, 1.1rem + 2vw, 2.25rem); }
h3 { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

address { font-style: normal; }

:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 3px;
	border-radius: 4px;
}

.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.skip-link {
	position: absolute;
	left: 12px;
	top: -60px;
	z-index: 100;
	padding: 10px 16px;
	border-radius: var(--radius-sm);
	background: var(--accent);
	color: var(--accent-contrast);
	font-weight: 600;
	transition: top .2s ease;
}
.skip-link:focus { top: 12px; color: var(--accent-contrast); }

/* --- 2. Кнопки ------------------------------------------------------------ */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 12px 22px;
	border: 1.5px solid transparent;
	border-radius: 999px;
	font: inherit;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
	transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.btn--primary { background: var(--accent); color: var(--accent-contrast); }
.btn--primary:hover { background: var(--accent-strong); color: var(--accent-contrast); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn--sm { min-height: 42px; padding: 9px 18px; font-size: .95rem; }
.btn:active { transform: translateY(1px); }

/* --- 3. Шапка ------------------------------------------------------------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid transparent;
	transition: box-shadow .2s ease, border-color .2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }

.site-header__inner {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: var(--header-h);
}

.logo { display: inline-flex; flex: 0 0 auto; }
.logo img { width: auto; height: clamp(30px, 6vw, 40px); }

.site-nav {
	display: none;
	margin-inline: auto;
	gap: 4px;
}
.site-nav a {
	padding: 8px 14px;
	border-radius: 999px;
	color: var(--ink-soft);
	font-weight: 600;
	font-size: .98rem;
}
.site-nav a:hover { color: var(--ink); background: var(--bg-soft); }

.site-header__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.burger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1.5px solid var(--line);
	border-radius: 12px;
	background: transparent;
	cursor: pointer;
}
.burger span,
.burger span::before,
.burger span::after {
	display: block;
	width: 20px;
	height: 2px;
	border-radius: 2px;
	background: var(--ink);
	transition: transform .2s ease, opacity .2s ease;
}
.burger span { position: relative; }
.burger span::before,
.burger span::after { content: ""; position: absolute; left: 0; }
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* мобильное меню */
@media (max-width: 899px) {
	.site-nav {
		position: absolute;
		inset: 100% 0 auto 0;
		display: grid;
		gap: 2px;
		margin: 0;
		padding: 12px var(--gutter) 20px;
		background: var(--surface);
		border-bottom: 1px solid var(--line);
		box-shadow: var(--shadow);
	}
	.site-nav[hidden] { display: none; }
	.site-nav a { padding: 14px 12px; font-size: 1.05rem; }
	.site-header__actions .btn--sm { display: none; }
}

@media (min-width: 900px) {
	.burger { display: none; }
	.site-nav { display: flex; }
}

/* --- 4. Общие секции ------------------------------------------------------ */
.section {
	padding-block: var(--section-y);
	scroll-margin-top: calc(var(--header-h) + 12px);
}
.section--muted { background: var(--bg-soft); }

.eyebrow {
	margin: 0 0 12px;
	color: var(--accent-strong);
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.section h2 { max-width: 22ch; }

/* --- 5. Первый экран ------------------------------------------------------ */
.hero {
	padding-block: clamp(32px, 6vw, 72px) var(--section-y);
	background:
		radial-gradient(120% 90% at 85% -10%, var(--accent-soft) 0%, transparent 60%),
		var(--bg);
}
.hero__grid { display: grid; gap: clamp(28px, 5vw, 56px); align-items: center; }

.hero h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
.hero__role {
	margin: 0 0 1rem;
	color: var(--accent-strong);
	font-weight: 700;
	font-size: clamp(1.02rem, .95rem + .4vw, 1.2rem);
}
.hero__lead { max-width: 54ch; color: var(--ink-soft); font-size: clamp(1rem, .96rem + .3vw, 1.12rem); }

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 1.75rem;
}

.facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 14px;
	margin: 2.25rem 0 0;
	padding: 0;
	list-style: none;
}
.facts li {
	padding: 16px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
}
.facts strong {
	display: block;
	color: var(--accent-strong);
	font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
	line-height: 1.1;
}
.facts span { color: var(--muted); font-size: .92rem; line-height: 1.35; }

/* --- 6. Слайдер ----------------------------------------------------------- */
.slider { position: relative; }
.slider__track {
	position: relative;
	border-radius: var(--radius-lg);
	overflow: hidden;
	background: var(--bg-soft);
	box-shadow: var(--shadow);
}
.slide {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	transition: opacity .6s ease;
	pointer-events: none;
}
.slide.is-active { position: relative; opacity: 1; pointer-events: auto; }
.slide img { width: 100%; aspect-ratio: 1920 / 651; object-fit: cover; }

.slider__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 14px;
}
.slider__dot {
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}
.slider__dot::before {
	content: "";
	display: block;
	width: 100%;
	height: 4px;
	margin-top: 12px;
	border-radius: 999px;
	background: var(--line);
	transition: background-color .2s ease;
}
.slider__dot.is-active::before { background: var(--accent); }

/* --- 7. Блоки «О враче» и карточки --------------------------------------- */
.about { display: grid; gap: clamp(24px, 4vw, 48px); align-items: start; }
.about__text p { color: var(--ink-soft); max-width: 60ch; }
.about__card {
	padding: clamp(20px, 3vw, 30px);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background: var(--surface);
	box-shadow: var(--shadow-sm);
}
.facts-list { margin: 0; display: grid; gap: 16px; }
.facts-list dt {
	color: var(--muted);
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.facts-list dd { margin: 4px 0 0; font-weight: 600; }

.cards { display: grid; gap: clamp(16px, 2.2vw, 24px); margin-top: clamp(24px, 3vw, 40px); }
.card {
	padding: clamp(20px, 3vw, 30px);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background: var(--surface);
	box-shadow: var(--shadow-sm);
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
	transform: translateY(-3px);
	border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
	box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .4em; }
.card p { color: var(--ink-soft); }
.card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin-bottom: 16px;
	border-radius: 14px;
	background: var(--accent-soft);
	color: var(--accent-strong);
}
.card__icon svg { width: 26px; height: 26px; }
.card__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
	font-weight: 700;
}
.card__link::after { content: "→"; transition: transform .18s ease; }
.card__link:hover::after { transform: translateX(3px); }
.card--clinic address { color: var(--ink-soft); margin-bottom: 12px; }

/* --- 8. Контакты и подвал ------------------------------------------------- */
.contact-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
	margin: clamp(20px, 3vw, 32px) 0 0;
	padding: 0;
	list-style: none;
}
.contact-list li {
	padding: 16px 18px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--bg-soft);
}
.contact-list a { font-weight: 700; font-size: 1.05rem; word-break: break-word; }
.contact-list span { display: block; color: var(--muted); font-size: .88rem; }

.site-footer {
	padding-block: 28px;
	border-top: 1px solid var(--line);
	background: var(--bg-soft);
	color: var(--muted);
	font-size: .92rem;
}
.site-footer__inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 24px;
}
.site-footer p { margin: 0; }

/* --- 9. Адаптив ----------------------------------------------------------- */
@media (min-width: 700px) {
	.cards { grid-template-columns: repeat(3, 1fr); }
	.cards--two { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
	.hero__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
	.about { grid-template-columns: minmax(0, 1.2fr) minmax(0, .85fr); }
}

/* --- 10. Доступность и движение ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*,
	*::before,
	*::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
	}
	.slide { transition: none; }
}

@media (prefers-contrast: more) {
	.card, .about__card, .contact-list li, .facts li { border-color: var(--ink-soft); }
}

@media print {
	.site-header, .skip-link, .slider__dots, .hero__actions { display: none; }
	body { color: #000; background: #fff; }
}

/* --- 11. Форма онлайн-записи --------------------------------------------- */
.section-note { max-width: 64ch; color: var(--ink-soft); }
.section-note a { font-weight: 600; }

.booking-form {
	margin-top: clamp(24px, 3vw, 40px);
	padding: clamp(20px, 3vw, 32px);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background: var(--surface);
	box-shadow: var(--shadow-sm);
}

.form-grid { display: grid; gap: 16px; }

.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: .95rem; }

.field input,
.field textarea {
	width: 100%;
	min-height: 48px;
	padding: 12px 14px;
	border: 1.5px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--bg);
	color: var(--ink);
	font: inherit;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color .18s ease, box-shadow .18s ease;
}
.field textarea { min-height: 108px; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: .75; }
.field input:focus,
.field textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field input:user-invalid { border-color: #d2603f; }

.consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-top: 20px;
	color: var(--ink-soft);
	font-size: .92rem;
}
.consent input {
	width: 20px;
	height: 20px;
	margin: 2px 0 0;
	accent-color: var(--accent);
}

.form-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin-top: 24px;
}
.form-note { margin: 0; color: var(--muted); font-size: .9rem; }

.form-status { min-height: 1.3em; margin: 16px 0 0; font-weight: 600; }
.form-status.is-ok { color: var(--accent-strong); }
.form-status.is-error { color: #d2603f; }

.card__actions { display: flex; flex-wrap: wrap; gap: 10px 20px; }

.hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (min-width: 700px) {
	.form-grid { grid-template-columns: repeat(2, 1fr); }
	.field--wide { grid-column: 1 / -1; }
}
