/* vernova9.ru — styles. Visual language follows the 2014 sales brochure of the house:
   sky with clouds, orange title bands, navy accents, serif headings. */

:root {
    --orange: #f15a22;
    --orange-dark: #d2470f;
    --navy: #112369;
    --navy-light: #2a3f8f;
    --sky-top: #7fbfea;
    --sky-bottom: #e9f4fc;
    --text: #1b2330;
    --muted: #5b6577;
    --line: #d7e3ee;
    --card: #ffffff;
    --card-soft: #f3f8fc;
    --link: #1f4ea1;
    --ok: #2e8b57;
    --shadow: 0 6px 24px rgba(17, 35, 105, 0.12);
    --radius: 12px;
    --font-head: "PT Serif", Georgia, "Times New Roman", serif;
    --font-body: "PT Sans", "Segoe UI", Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --sky-top: #0b1a3f;
        --sky-bottom: #141f3a;
        --text: #e8eef7;
        --muted: #a9b4c8;
        --line: #2e3c5e;
        --card: #1b2748;
        --card-soft: #22305a;
        --link: #8fb8ff;
        --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
    }
}
:root[data-theme="dark"] {
    --sky-top: #0b1a3f;
    --sky-bottom: #141f3a;
    --text: #e8eef7;
    --muted: #a9b4c8;
    --line: #2e3c5e;
    --card: #1b2748;
    --card-soft: #22305a;
    --link: #8fb8ff;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.55;
    background: linear-gradient(180deg, var(--sky-top) 0, var(--sky-bottom) 520px, var(--sky-bottom) 100%);
    min-height: 100vh;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.35em; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.5em 0.7em; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; background: var(--card-soft); }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.95em; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.topband { height: 6px; background: var(--orange); }
.site-header {
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(17, 35, 105, 0.08);
    position: sticky; top: 0; z-index: 50;
}
:root[data-theme="dark"] .site-header { background: rgba(14, 24, 56, 0.9); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .site-header { background: rgba(14, 24, 56, 0.9); }
}
.site-header .wrap { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-family: var(--font-head); }
.brand:hover { text-decoration: none; }
.brand .logo {
    width: 42px; height: 42px; border-radius: 8px; background: var(--orange); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: 1.4rem; flex: none;
}
.brand .name { font-size: 1.15rem; font-weight: 700; line-height: 1.1; }
.brand .sub { font-size: 0.8rem; color: var(--muted); font-family: var(--font-body); }
nav.main { margin-left: auto; display: flex; align-items: center; gap: 4px; }
nav.main > ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
nav.main li { margin: 0; position: relative; }
nav.main a, nav.main button.navbtn {
    display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); font-weight: 700;
    font-size: 0.98rem; background: none; border: 0; cursor: pointer; font-family: inherit; white-space: nowrap;
}
nav.main a:hover, nav.main button.navbtn:hover, nav.main li.open > button.navbtn { background: rgba(241, 90, 34, 0.12); text-decoration: none; }
nav.main a.active { color: var(--orange-dark); }
nav.main li.has-sub > button.navbtn::after { content: " ▾"; font-size: 0.8em; }
nav.main ul.sub {
    display: none; position: absolute; top: 100%; left: 0; width: max-content; min-width: 100%; list-style: none; margin: 4px 0 0; padding: 6px;
    background: var(--card); border-radius: 10px; box-shadow: var(--shadow); border: 1px solid var(--line); z-index: 60;
}
nav.main li.open > ul.sub { display: block; }
/* the last menu ("УК" for guests) opens to the left, so it does not run off the right edge */
nav.main > ul > li:last-child > ul.sub { left: auto; right: 0; }
nav.main ul.sub a { font-weight: 400; padding: 8px 12px; }
nav.main a.private-link { color: var(--navy-light); }
nav.main a.private-link::before { content: "🔒 "; }
.authbtn {
    margin-left: 6px; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--orange); color: var(--orange-dark);
    font-weight: 700; background: transparent; cursor: pointer; font-family: inherit; font-size: 0.95rem; white-space: nowrap;
}
.authbtn:hover { background: var(--orange); color: #fff; }
.authbtn.in { border-color: var(--navy-light); color: var(--navy-light); }
.authbtn.in:hover { background: var(--navy-light); color: #fff; }
.burger { display: none; margin-left: auto; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; font-size: 1.6rem; color: var(--text); }

/* the full menu needs about 1060 px after login (two more items and the logout button) */
@media (max-width: 1080px) {
    .burger { display: block; }
    nav.main { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: 8px 16px 16px; }
    nav.main.open { display: block; }
    nav.main > ul { flex-direction: column; }
    nav.main ul.sub { position: static; width: auto; box-shadow: none; border: 0; padding: 0 0 0 14px; display: block; background: none; }
    nav.main li.has-sub > button.navbtn { display: none; }
    nav.main li.has-sub::before { content: attr(data-title); display: block; padding: 10px 12px 2px; font-weight: 700; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; }
    .authbtn { margin: 10px 0 0 12px; }
}

/* ---------- hero ---------- */
.hero {
    position: relative; overflow: hidden; color: #fff;
    background: url("../img/sky.jpg") center / cover no-repeat;
}
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(17, 35, 105, 0.72) 0%, rgba(17, 35, 105, 0.35) 55%, rgba(17, 35, 105, 0.05) 100%); }
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 24px; align-items: end; padding-top: 48px; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 0.3em; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); }
.hero .lead { font-size: 1.15rem; max-width: 36em; margin-bottom: 1.4em; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35); }
.hero .pic { text-align: center; }
.hero .pic img { max-height: 440px; width: auto; display: block; margin: 0 auto; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35)); }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font-weight: 700;
    background: var(--orange); color: #fff; border: 2px solid var(--orange); cursor: pointer; font-family: inherit; font-size: 1rem;
}
.btn:hover { background: var(--orange-dark); border-color: var(--orange-dark); text-decoration: none; }
.btn.ghost { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.7); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.28); }
.btn.navy { background: var(--navy); border-color: var(--navy); }
.btn.navy:hover { background: var(--navy-light); border-color: var(--navy-light); }
.btn.outline { background: transparent; color: var(--orange-dark); }
.btn.outline:hover { background: var(--orange); color: #fff; }
.btn.sm { padding: 6px 12px; font-size: 0.9rem; }
@media (max-width: 760px) {
    .hero .wrap { grid-template-columns: 1fr; padding-top: 28px; }
    .hero .pic img { max-height: 300px; }
}

/* ---------- sections ---------- */
.section { padding: 36px 0; }
.band {
    background: var(--orange); color: #fff; font-family: var(--font-head); font-size: 1.5rem; font-weight: 700;
    padding: 10px 18px; border-radius: 10px 10px 0 0; margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.band small { font-family: var(--font-body); font-size: 0.85rem; font-weight: 400; opacity: 0.9; }
.band + .panel { border-radius: 0 0 var(--radius) var(--radius); }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.panel + .band { margin-top: 28px; }
.panel h2:first-child, .panel h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 18px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.card .icon { font-size: 1.8rem; line-height: 1; }
.card h3 { margin: 4px 0 2px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card .more { margin-top: auto; padding-top: 8px; font-weight: 700; }
.card.soft { background: var(--card-soft); box-shadow: none; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dt { margin-top: 8px; font-size: 0.85rem; } }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.tag.news { background: rgba(47, 98, 168, 0.14); color: var(--link); }
.tag.notice { background: rgba(241, 90, 34, 0.16); color: var(--orange-dark); }
.tag.urgent { background: #d7263d; color: #fff; }
.note { border-left: 4px solid var(--orange); background: var(--card-soft); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 14px 0; }
.note.blue { border-color: var(--navy-light); }
.phone { font-weight: 700; white-space: nowrap; }
.src { font-size: 0.85rem; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; aspect-ratio: 4 / 3; }
@media (max-width: 600px) { .gallery { grid-template-columns: 1fr 1fr; } }
.doclist { list-style: none; padding: 0; margin: 0; }
.doclist li { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; }
.doclist li:last-child { border-bottom: 0; }
.doclist .ext { flex: none; font-size: 0.75rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--navy); color: #fff; text-transform: uppercase; }
.doclist .meta { color: var(--muted); font-size: 0.88rem; margin-left: auto; white-space: nowrap; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.toc a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-weight: 700; font-size: 0.92rem; }
.votes { width: auto; min-width: 320px; }
.votes td, .votes th { text-align: center; }
.votes td:first-child, .votes th:first-child { text-align: left; }
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 3px; background: var(--orange); border-radius: 2px; }
.timeline .item { position: relative; margin-bottom: 26px; }
.timeline .item::before { content: ""; position: absolute; left: -24px; top: 6px; width: 15px; height: 15px; border-radius: 50%; background: var(--card); border: 4px solid var(--orange); }
.timeline .date { font-weight: 700; color: var(--orange-dark); }

/* ---------- news ---------- */
.news-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: 0; }
.news-item .head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.news-item .date { color: var(--muted); font-size: 0.9rem; }
.news-item h3 { margin: 0 0 4px; }
.news-item p { margin: 0 0 6px; }
.news-item.pinned { background: var(--card-soft); margin: 0 -24px; padding: 16px 24px; border-radius: 10px; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy); color: #d6def5; margin-top: 48px; padding: 32px 0 24px; font-size: 0.95rem; }
.site-footer a { color: #fff; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.site-footer h4 { color: #fff; margin-bottom: 0.4em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer .copy { margin-top: 24px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.15); color: #a9b4d8; font-size: 0.85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.theme-toggle { background: none; border: 1px solid rgba(255, 255, 255, 0.4); color: #fff; border-radius: 999px; padding: 4px 12px; cursor: pointer; font-family: inherit; }
@media (max-width: 760px) { .site-footer .cols { grid-template-columns: 1fr; } }

/* ---------- login / private ---------- */
.login-box { max-width: 420px; margin: 40px auto; }
.login-box label { display: block; font-weight: 700; margin: 12px 0 4px; }
.login-box input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); font: inherit; background: var(--card); color: var(--text); }
.login-box .err { color: #d7263d; font-weight: 700; margin-top: 10px; min-height: 1.4em; }
.login-box .btn { margin-top: 16px; width: 100%; justify-content: center; }
/* 560 px for the model at the full page width (1140 - 2×16 padding - 18 gap = 1090 = 560 + 530), proportional below */
.priv-layout { display: grid; grid-template-columns: 560fr 530fr; gap: 18px; align-items: start; }
@media (max-width: 960px) { .priv-layout { grid-template-columns: 1fr; } }
.viewer { position: relative; background: linear-gradient(180deg, #9fd0f2 0%, #e2f1fb 70%, #cfe3d0 100%); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 1 / 1.05; min-height: 380px; touch-action: none; }
.viewer canvas { display: block; width: 100% !important; height: 100% !important; cursor: grab; }
.viewer canvas:active { cursor: grabbing; }
.viewer .hint { position: absolute; left: 12px; bottom: 10px; font-size: 0.8rem; color: #1b2330; background: rgba(255, 255, 255, 0.75); padding: 4px 10px; border-radius: 999px; }
.viewer .vtitle { position: absolute; left: 12px; top: 10px; font-family: var(--font-head); font-weight: 700; color: var(--navy); background: rgba(255, 255, 255, 0.8); padding: 4px 12px; border-radius: 999px; }
.floors { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.floors button { min-width: 42px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; font: inherit; font-weight: 700; }
.floors button:hover { border-color: var(--orange); }
.floors button.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.floors button.tech { font-size: 0.85rem; }
.plan { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 10px; }
.plan svg { width: 100%; height: auto; display: block; }
.plan .apt { cursor: pointer; transition: filter 0.15s; }
.plan .apt:hover path, .plan .apt:hover polygon, .plan .apt:hover rect { filter: brightness(1.08); stroke-width: 4; }
.plan .apt.sel path, .plan .apt.sel polygon, .plan .apt.sel rect { stroke: var(--navy); stroke-width: 5; }
.plan text { font-family: var(--font-body); pointer-events: none; }
.plan .legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.85rem; color: var(--muted); margin-top: 6px; }
.plan .legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--sw); }
.aptcard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-top: 18px; }
.aptcard h2 { margin-bottom: 0.2em; }
.aptcard .owners li { margin-bottom: 8px; }
.aptcard .owners .who { font-weight: 700; }
.aptcard .empty { color: var(--muted); font-style: italic; }
.aptcard .contacts { list-style: none; padding: 0; margin: 0 0 6px; }
.aptcard .contacts li { margin-bottom: 4px; }
.search { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; }
.search input { flex: 1; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); font: inherit; background: var(--card); color: var(--text); }
.search-results { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.search-results li { margin: 0; }
.search-results button { border: 1px solid var(--line); background: var(--card-soft); border-radius: 999px; padding: 3px 10px; cursor: pointer; font: inherit; font-size: 0.9rem; }

@media print {
    .site-header, .site-footer, .hero .actions, .toc { display: none !important; }
    body { background: #fff; color: #000; }
    .panel, .card { box-shadow: none; border: 1px solid #ccc; }
}
