:root {
    --green-900: #10322a;
    --green-800: #143d31;
    --green-700: #1b5140;
    --green-500: #2f6d55;
    --gold: #c9a227;
    --gold-dark: #a9861c;
    --sand: #f7f3ea;
    --paper: #ffffff;
    --ink: #1b2320;
    --muted: #5f6d66;
    --line: #e3e8e4;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(16, 50, 42, .08);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--green-700); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

.container { width: min(1160px, 92vw); margin: 0 auto; }
.container.narrow { width: min(760px, 92vw); }
.muted { color: var(--muted); }
.lead { font-size: 1.125rem; color: var(--muted); }

.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* ---------- кнопки и поля ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: #23200f; box-shadow: 0 6px 18px rgba(201, 162, 39, .28); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-outline { border-color: var(--green-500); color: var(--green-700); background: transparent; }
.btn-ghost { border-color: rgba(255, 255, 255, .5); color: #fff; background: rgba(255, 255, 255, .08); }
.btn-block { width: 100%; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.field em { font-style: normal; opacity: .7; }

input[type="text"], input[type="tel"], input[type="number"], input[type="password"], input[type="file"], select, textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid rgba(47, 109, 85, .35);
    border-color: var(--green-500);
}

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: var(--muted); margin: 4px 0 16px; }
.consent input { margin-top: 4px; }

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

.form-note { font-size: .8rem; color: var(--muted); margin-top: 10px; }

.alert { border-radius: 12px; padding: 12px 16px; margin: 0 0 14px; font-size: .95rem; }
.alert p:last-child { margin-bottom: 0; }
.alert-ok { background: #e9f5ee; border: 1px solid #b9dfc8; color: #14512f; }
.alert-error { background: #fdecec; border: 1px solid #f3c2c2; color: #8a1f1f; }
.alert-warn { background: #fff7e0; border: 1px solid #f0dca1; color: #6b5312; }

/* ---------- шапка ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(16, 50, 42, .97);
    backdrop-filter: blur(6px);
    color: #fff;
}

.header-inner { display: flex; align-items: center; gap: 22px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand img { width: 44px; height: 44px; border-radius: 12px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.05rem; letter-spacing: .02em; }
.brand-text small { font-size: .76rem; color: rgba(255, 255, 255, .7); }

.nav { display: flex; gap: 18px; margin-left: auto; }
.nav a { color: rgba(255, 255, 255, .88); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--gold); }

.header-actions { display: flex; align-items: center; gap: 14px; }
.phone { color: #fff; text-decoration: none; font-weight: 600; white-space: nowrap; }

/* ---------- hero ---------- */

.hero {
    position: relative;
    color: #fff;
    background: var(--green-900) url("/img/banner-1920.webp") center/cover no-repeat;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(9, 32, 26, .92) 0%, rgba(12, 44, 35, .75) 45%, rgba(12, 44, 35, .35) 100%);
}

.hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 40px;
    padding: 64px 0 72px;
    align-items: start;
}

.hero h1 { color: #fff; }
.hero .lead { color: rgba(255, 255, 255, .85); max-width: 34em; }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; color: var(--gold); margin-bottom: 10px; }

.hero-points { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 8px; }
.hero-points li { position: relative; padding-left: 26px; color: rgba(255, 255, 255, .92); }
.hero-points li::before { content: "✓"; position: absolute; left: 0; color: var(--gold); font-weight: 700; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-form { padding: 26px; }
.hero-form h2 { font-size: 1.25rem; }

/* ---------- карточки ---------- */

.card {
    background: var(--paper);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.card-form { padding: 26px; }

.house-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.house-card-media { position: relative; display: block; background: var(--sand); }
.house-card-media img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.house-card-stub { aspect-ratio: 3 / 2; display: grid; place-items: center; color: var(--muted); }
.badge {
    position: absolute; left: 12px; top: 12px;
    background: rgba(16, 50, 42, .88); color: #fff;
    font-size: .75rem; padding: 6px 12px; border-radius: 999px;
}
.house-card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.house-card-body h3 { margin-bottom: 6px; }
.house-card-body h3 a { text-decoration: none; color: var(--ink); }
.house-card-body p { font-size: .92rem; }

.params { list-style: none; display: flex; gap: 18px; padding: 0; margin: 12px 0 18px; flex-wrap: wrap; }
.params li { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); }
.params strong { color: var(--ink); font-size: 1rem; }

.house-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.price { font-size: 1.2rem; font-weight: 700; color: var(--green-700); }
.price-lg { font-size: 1.6rem; display: block; margin-bottom: 4px; }

/* ---------- секции ---------- */

.section { padding: 62px 0; }
.section-alt { background: var(--sand); }
.section-cta { background: var(--green-900); color: #fff; }
.section-cta h2 { color: #fff; }
.section-cta .muted { color: rgba(255, 255, 255, .75); }
.section-cta .card-form { background: var(--paper); color: var(--ink); }
.section-cta .card-form .muted { color: var(--muted); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.link-more { text-decoration: none; font-weight: 600; white-space: nowrap; }

.feature { background: var(--paper); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.feature p { font-size: .94rem; margin-bottom: 0; color: var(--muted); }

.faq { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 10px 0 0; color: var(--muted); }

.steps { padding-left: 20px; }
.steps li { margin-bottom: 10px; }

.features-list { padding-left: 20px; }
.features-list li { margin-bottom: 6px; }

/* ---------- страница объекта ---------- */

.page-head { background: var(--sand); padding: 42px 0 34px; }
.page-head h1 { margin-bottom: .35em; }
.page-head-object { background: linear-gradient(180deg, var(--sand), #fff); }

.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--muted); }

.object-layout { display: grid; grid-template-columns: 1fr 380px; gap: 34px; align-items: start; }

.object-gallery { margin: 0 0 32px; }
.object-gallery-main { width: 100%; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.object-gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.object-gallery-thumbs img { border-radius: 12px; cursor: pointer; aspect-ratio: 3 / 2; object-fit: cover; }
.object-gallery-stub { background: var(--sand); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--muted); }

.params-table { width: 100%; border-collapse: collapse; margin-bottom: 26px; }
.params-table th, .params-table td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.params-table th { width: 40%; font-weight: 500; color: var(--muted); }

.sticky { position: sticky; top: 88px; }

/* ---------- контакты ---------- */

.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.contact-phone { font-size: 1.8rem; font-weight: 700; margin-bottom: 4px; }
.contact-phone a { text-decoration: none; color: var(--green-700); }

.legal h2 { font-size: 1.15rem; margin-top: 26px; }

/* ---------- футер ---------- */

.site-footer { background: #0d2a22; color: rgba(255, 255, 255, .8); padding: 42px 0 26px; font-size: .92rem; }
.site-footer a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.footer-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-legal p { font-size: .82rem; margin: 0 0 4px; }

/* ---------- плавающие кнопки и чат ---------- */

.call-fab, .chat-fab {
    position: fixed;
    z-index: 60;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
}

.call-fab {
    right: 20px; bottom: 88px;
    width: 54px; height: 54px;
    display: grid; place-items: center;
    background: var(--paper); font-size: 1.3rem;
}

.chat-fab { right: 20px; bottom: 20px; padding: 15px 22px; background: var(--gold); color: #23200f; }

.chat-panel {
    position: fixed;
    right: 20px; bottom: 88px;
    z-index: 70;
    width: min(380px, 92vw);
    max-height: min(560px, 80vh);
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
    overflow: hidden;
}

.chat-panel[hidden] { display: none; }
.chat-head { background: var(--green-800); color: #fff; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: .95rem; }
.chat-head button { background: none; border: none; color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.chat-body { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.chat-msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: .93rem; white-space: pre-line; }
.chat-msg.user { align-self: flex-end; background: var(--green-700); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.bot { align-self: flex-start; background: var(--sand); border-bottom-left-radius: 4px; }
.chat-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 8px; }
.chat-quick button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: .82rem; cursor: pointer; }
.chat-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.chat-form input { border-radius: 999px; }
.chat-form button { border: none; background: var(--gold); color: #23200f; border-radius: 999px; width: 42px; font-size: 1.1rem; cursor: pointer; }
.chat-note { font-size: .72rem; color: var(--muted); padding: 0 16px 12px; margin: 0; }

/* ---------- админка ---------- */

.login-body { display: grid; place-items: center; min-height: 100vh; background: #11231d; }
.login-card { width: min(420px, 92vw); }

.admin-form h2 { font-size: 1.1rem; margin-top: 20px; }
.admin-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.admin-two-col { display: grid; grid-template-columns: 1.4fr .9fr; gap: 22px; align-items: start; }
.admin-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
.admin-photos figure { margin: 0; }
.admin-photos img { border-radius: 10px; aspect-ratio: 3 / 2; object-fit: cover; }
.admin-photos figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: .78rem; margin-top: 6px; }
.admin-filters { display: flex; gap: 12px; align-items: end; margin-bottom: 12px; }

/* ---------- адаптив ---------- */

@media (max-width: 1000px) {
    .hero-inner { grid-template-columns: 1fr; padding: 44px 0 52px; }
    .object-layout { grid-template-columns: 1fr; }
    .sticky { position: static; }
    .contact-layout { grid-template-columns: 1fr; }
    .admin-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .nav { display: none; }
    .header-actions .btn { display: none; }
    .header-actions { margin-left: auto; }
    .section { padding: 44px 0; }
    .call-fab { bottom: 80px; }
    .chat-panel { right: 10px; left: 10px; width: auto; bottom: 78px; }
}
