/* === Базовая типографика и сетка === */
:root {
    --bg: #f4f7f5;
    --surface: #ffffff;
    --text: #1a2e24;
    --muted: #5c6f64;
    --accent: #1b6f4a;
    --accent-dark: #145a3c;
    --ring: rgba(27, 111, 74, 0.35);
    --shadow: 0 12px 40px rgba(26, 46, 36, 0.08);
    --radius: 14px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.wrap {
    width: min(1120px, 92vw);
    margin-inline: auto;
}

/* === Шапка === */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid #e2ebe4;
    padding: 0.65rem 0;
    font-size: 0.9rem;
}

.topbar .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.topbar a[href^="tel:"] {
    font-weight: 600;
    color: var(--accent-dark);
    white-space: nowrap;
}

/* === Герой === */
.hero {
    padding: 3rem 0 3.5rem;
    background: linear-gradient(165deg, #e8f3ed 0%, var(--bg) 55%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 900px) {
    .hero-grid {
        grid-template-columns: 1.05fr 0.95fr;
    }
}

.hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    line-height: 1.2;
    margin: 0 0 1rem;
}

.hero-lead {
    color: var(--muted);
    margin: 0 0 1.5rem;
    max-width: 36rem;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.hero-phone-note {
    font-size: 0.9rem;
    color: var(--muted);
}

.hero-phone-note a {
    font-weight: 600;
}

/* === Кнопки === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.35rem;
    border-radius: 999px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 16px var(--ring);
}

.btn-primary:hover {
    background: var(--accent-dark);
    color: #fff;
    text-decoration: none;
}

.btn-ghost {
    background: var(--surface);
    color: var(--accent-dark);
    border: 2px solid #c5ddd0;
}

.btn-ghost:hover {
    border-color: var(--accent);
    text-decoration: none;
}

/* === Карточки услуг === */
.section {
    padding: 3rem 0;
}

.section-alt {
    background: var(--surface);
}

.section h2 {
    font-size: clamp(1.4rem, 3vw, 1.75rem);
    margin: 0 0 0.5rem;
}

.section-intro {
    color: var(--muted);
    max-width: 42rem;
    margin: 0 0 2rem;
}

.cards {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid #e2ebe4;
}

.section-alt .card {
    background: var(--surface);
}

.card h3 {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
}

.card p {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.card .tel-inline {
    font-size: 0.9rem;
}

/* === Медиа с подписью (демо) === */
.media-block {
    margin: 2rem 0;
}

.media-block figure {
    margin: 0;
    background: var(--surface);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px dashed #b8d4c4;
}

.media-block figcaption {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}

.demo-placeholder {
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #d4eadc 0%, #a8d4bc 50%, #7ebe9a 100%);
    border-radius: calc(var(--radius) - 4px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-dark);
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    padding: 1rem;
}

/* === Формы === */
.form-section {
    padding: 3rem 0 4rem;
}

.form-panel {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    border: 1px solid #e2ebe4;
    max-width: 520px;
}

.form-panel h2 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
}

.form-panel > p {
    margin: 0 0 1.25rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.form-row {
    margin-bottom: 1rem;
}

.form-row label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #c5ddd0;
    border-radius: 10px;
    font: inherit;
}

.form-row textarea {
    min-height: 90px;
    resize: vertical;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.form-phone-hint {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    color: var(--muted);
}

.form-phone-hint a {
    font-weight: 600;
}

.form-grid-2 {
    display: grid;
    gap: 1rem;
}

@media (min-width: 520px) {
    .form-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

/* === Подвал === */
.footer {
    background: #1a2e24;
    color: #c5ddd0;
    padding: 2rem 0;
    font-size: 0.9rem;
}

.footer a {
    color: #9ed4b4;
}

.footer .wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}

/* === Модальное окно === */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26, 46, 36, 0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
    width: min(480px, 100%);
    max-height: 90vh;
    overflow: auto;
    padding: 1.5rem;
    transform: translateY(20px);
    transition: transform 0.25s ease;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12);
}

.modal-backdrop.is-open .modal {
    transform: translateY(0);
}

@media (min-width: 520px) {
    .modal-backdrop {
        align-items: center;
    }

    .modal {
        border-radius: var(--radius);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    border: none;
    background: #e8f3ed;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text);
    flex-shrink: 0;
}

.modal-close:hover {
    background: #d4eadc;
}

/* === Плавающая кнопка телефона (мобильные) === */
.float-call {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 900;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 8px 28px rgba(27, 111, 74, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    animation: float-phone-pulse 2s ease-in-out infinite;
}

.float-call svg {
    width: 28px;
    height: 28px;
}

.float-call:hover {
    background: var(--accent-dark);
}

@media (max-width: 900px) {
    .float-call {
        display: flex;
    }
}

@keyframes float-phone-pulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 8px 28px rgba(27, 111, 74, 0.45);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 10px 36px rgba(27, 111, 74, 0.55);
    }
}

@keyframes float-phone-ring {
    0%,
    100% {
        transform: rotate(0deg);
    }
    20% {
        transform: rotate(-12deg);
    }
    40% {
        transform: rotate(12deg);
    }
    60% {
        transform: rotate(-8deg);
    }
    80% {
        transform: rotate(8deg);
    }
}

.float-call .phone-icon-anim {
    animation: float-phone-ring 2.5s ease-in-out infinite;
    transform-origin: center bottom;
}

/* === Страница спасибо === */
.page-thanks {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.thanks-wrap {
    width: 100%;
    max-width: 480px;
}

.thanks-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid #e2ebe4;
}

.thanks-card h1 {
    margin: 0 0 1rem;
    color: var(--accent-dark);
}

.thanks-card p {
    margin: 0 0 1rem;
    color: var(--muted);
}

.thanks-phone {
    font-size: 1.05rem;
    color: var(--text) !important;
}

.thanks-phone a {
    font-weight: 700;
    white-space: nowrap;
}
