:root {
    --ink: #10201d;
    --muted: #5c6b66;
    --paper: #f6f8f5;
    --panel: #ffffff;
    --line: #dbe5df;
    --dark: #071013;
    --green: #16a36a;
    --green-dark: #0f7a51;
    --cyan: #0e9fc0;
    --amber: #d98716;
    --danger: #b42318;
    --shadow: 0 16px 40px rgba(12, 28, 23, .12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Arial, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(14, 159, 192, .45);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: 12px;
    z-index: 100;
    transform: translateY(-140%);
    padding: 10px 14px;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font-weight: 900;
}

.skip-link:focus {
    transform: translateY(0);
}

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

button,
input,
select,
textarea {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 76px;
    padding: 12px 5vw;
    border-bottom: 1px solid rgba(219, 229, 223, .82);
    background: rgba(246, 248, 245, .94);
    backdrop-filter: blur(14px);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    min-width: 150px;
}

.brand-logo {
    width: 176px;
    display: block;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 6px;
    color: #253b35;
    font-weight: 700;
    white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
    background: #e8f4ee;
    color: var(--green-dark);
}

.main-nav .nav-cabinet {
    background: var(--dark);
    color: #fff;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    background: var(--ink);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr);
    gap: 44px;
    align-items: center;
    min-height: 620px;
    padding: 72px 5vw 86px;
    background: var(--dark);
    color: #fff;
}

.hero h1,
.page-hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: 56px;
    line-height: 1.03;
    letter-spacing: 0;
}

.hero-lead,
.page-hero p {
    max-width: 720px;
    color: rgba(255, 255, 255, .82);
    font-size: 20px;
}

.eyebrow,
.section-kicker {
    margin: 0 0 12px;
    color: var(--green);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.hero-actions,
.inline-actions,
.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 800;
    text-align: center;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button.primary {
    background: var(--green);
    color: #fff;
}

.button:disabled,
input:disabled,
select:disabled {
    cursor: not-allowed;
    opacity: .58;
}

.button.primary:hover {
    background: var(--green-dark);
}

.button.ghost {
    border-color: var(--line);
    background: #fff;
    color: var(--ink);
}

.button.small {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 14px;
}

.button.full {
    width: 100%;
}

.fiber-visual {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}

.fiber-node {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 6px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-weight: 800;
}

.fiber-node.accent {
    border-color: rgba(22, 163, 106, .8);
    background: rgba(22, 163, 106, .2);
}

.fiber-path {
    width: 4px;
    height: 42px;
    margin: 0 auto;
    border-radius: 4px;
    background: var(--cyan);
}

.fiber-note {
    border-left: 4px solid var(--amber);
    padding: 12px 14px;
    border-radius: 6px;
    background: rgba(217, 135, 22, .14);
    color: #ffdeaa;
    font-weight: 700;
}

.section,
.page-hero {
    padding: 72px 5vw;
}

.section.narrow {
    max-width: 920px;
    margin: 0 auto;
}

.page-hero {
    background: var(--dark);
    color: #fff;
}

.page-hero.compact {
    min-height: 330px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page-hero.tv {
    min-height: 390px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #101516;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 28px;
}

.section-heading.row {
    display: flex;
    max-width: none;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
}

.section-heading h2,
.split-band h2,
.service-layout h2,
.tv-layout h2,
.contact-layout h2,
.admin-panel h2 {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.12;
    letter-spacing: 0;
}

.split-band {
    display: grid;
    grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
    gap: 42px;
    align-items: start;
    background: #fff;
}

.feature-grid,
.tariff-grid,
.news-grid,
.service-list {
    display: grid;
    gap: 18px;
}

.feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-grid article,
.tariff-card,
.news-card,
.service-list article,
.tv-placeholder,
.form-panel,
.admin-panel,
.admin-stats article,
.auth-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 6px 20px rgba(16, 32, 29, .06);
}

.feature-grid article,
.service-list article,
.news-card {
    padding: 22px;
}

.feature-grid h3,
.news-card h3,
.service-list h3,
.tariff-name {
    margin: 0 0 8px;
    font-size: 20px;
    line-height: 1.2;
}

.feature-grid p,
.news-card p,
.service-list p,
.section-heading p,
.split-band p,
.contact-details dd,
.article-body {
    color: var(--muted);
}

.tariff-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settlement-selector {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 760px;
    margin: 0 0 26px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.settlement-selector label {
    flex: 1 1 260px;
}

.settlement-selector.admin-filter {
    max-width: none;
}

.tariff-card {
    min-height: 370px;
    padding: 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 22px;
}

.tariff-speed {
    margin: 18px 0;
    color: var(--ink);
    font-weight: 800;
}

.tariff-speed span {
    font-size: 56px;
    line-height: 1;
}

.tariff-price {
    margin-bottom: 16px;
    color: var(--green-dark);
    font-weight: 800;
}

.tariff-price span {
    font-size: 38px;
}

.order-band {
    background: #edf5f0;
}

.form-panel {
    max-width: 1040px;
    padding: 24px;
}

.selected-settlement {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 6px;
    background: #e8f4ee;
    color: var(--green-dark);
}

.compact-form {
    max-width: 680px;
}

.form-grid,
.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-weight: 800;
}

label span {
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cad8d1;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    padding: 10px 12px;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(14, 159, 192, .18);
    border-color: var(--cyan);
}

.language-select {
    width: auto;
    min-height: 40px;
    padding: 8px 10px;
}

.form-panel > label,
.form-actions,
.form-panel .g-recaptcha {
    margin-top: 16px;
}

.form-note {
    margin: 0;
    color: var(--muted);
}

.form-note.error,
.flash.error {
    color: var(--danger);
}

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

.news-band {
    background: #fff;
}

.news-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.news-date {
    margin: 0 0 8px;
    color: var(--amber);
    font-weight: 800;
}

.news-card h3 a:hover {
    color: var(--green-dark);
}

.service-layout,
.tv-layout,
.contact-layout {
    display: grid;
    grid-template-columns: minmax(260px, .78fr) minmax(0, 1.22fr);
    gap: 42px;
    align-items: start;
}

.service-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tv-placeholder {
    padding: 12px;
}

.tv-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
}

.tv-row:last-child {
    border-bottom: 0;
}

.contact-details dl {
    display: grid;
    gap: 14px;
    margin: 20px 0;
}

.contact-details dt {
    font-weight: 800;
}

.contact-details dd {
    margin: 0;
}

.article-page h1 {
    margin-top: 0;
    font-size: 42px;
    line-height: 1.12;
}

.article-body {
    font-size: 18px;
}

.article-body h2 {
    margin: 28px 0 8px;
    color: var(--ink);
}

.empty-state {
    border: 1px dashed #bdcbc5;
    border-radius: 8px;
    padding: 22px;
    color: var(--muted);
    background: #fff;
}

.flash {
    width: min(100% - 32px, 1080px);
    margin: 16px auto 0;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    font-weight: 800;
}

.flash.success {
    color: var(--green-dark);
    border-color: #a9d7c1;
    background: #effaf4;
}

.site-footer {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 28px;
    padding: 34px 5vw;
    background: #0c1715;
    color: #e9f2ed;
}

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(100% - 32px, 980px);
    margin: 0 auto;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-banner p {
    margin: 4px 0 0;
    color: var(--muted);
}

.cookie-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.site-footer p,
.site-footer span {
    display: block;
    margin: 4px 0;
    color: #b7c8c1;
}

.footer-links {
    display: grid;
    gap: 8px;
}

.footer-links a:hover {
    color: #fff;
}

.admin-body {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    background: #eef3ef;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
    background: var(--dark);
    color: #fff;
}

.admin-logo {
    font-size: 24px;
    font-weight: 900;
}

.admin-sidebar nav {
    display: grid;
    gap: 8px;
}

.admin-sidebar a {
    padding: 10px 12px;
    border-radius: 6px;
    color: #dbe8e2;
    font-weight: 800;
}

.admin-sidebar a.active,
.admin-sidebar a:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.admin-sidebar form {
    margin-top: auto;
}

.admin-main {
    padding: 32px;
}

.admin-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.admin-heading h1 {
    margin: 0;
    font-size: 36px;
    line-height: 1.12;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.admin-stats article {
    padding: 20px;
}

.admin-stats span {
    display: block;
    font-size: 38px;
    font-weight: 900;
    color: var(--green-dark);
}

.admin-stats p {
    margin: 4px 0 0;
    color: var(--muted);
}

.admin-panel {
    padding: 22px;
    margin-bottom: 22px;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: #45615a;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.admin-table input,
.admin-table select,
.admin-table textarea {
    min-width: 110px;
}

.tariff-edit-table textarea {
    min-width: 240px;
}

.table-actions,
.status-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-actions form {
    margin: 0;
}

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

.admin-form-grid .wide {
    grid-column: 1 / -1;
}

.inline-check,
.check-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.inline-check input,
.check-cell input {
    width: auto;
    min-height: auto;
}

.admin-auth {
    min-height: calc(100vh - 76px);
    display: grid;
    place-items: center;
    padding: 40px 16px;
    background: #eef3ef;
}

.auth-card {
    width: min(100%, 440px);
    padding: 28px;
}

.auth-card h1 {
    margin: 0 0 10px;
    font-size: 30px;
}

.auth-card p {
    color: var(--muted);
}

.auth-card label {
    margin: 14px 0;
}

@media (max-width: 1100px) {
    .hero,
    .split-band,
    .service-layout,
    .tv-layout,
    .contact-layout {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
    }

    .feature-grid,
    .news-grid,
    .tariff-grid,
    .admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .site-header {
        min-height: 68px;
        padding: 10px 16px;
    }

    .brand-logo {
        width: 146px;
    }

    .nav-toggle {
        display: inline-block;
    }

    .main-nav {
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        display: none;
        padding: 12px 16px 18px;
        border-bottom: 1px solid var(--line);
        background: #fff;
        box-shadow: var(--shadow);
    }

    .main-nav.open {
        display: grid;
        justify-content: stretch;
    }

    .main-nav a {
        width: 100%;
    }

    .hero,
    .section,
    .page-hero {
        padding-left: 18px;
        padding-right: 18px;
    }

    .hero h1,
    .page-hero h1 {
        font-size: 38px;
    }

    .hero-lead,
    .page-hero p {
        font-size: 18px;
    }

    .feature-grid,
    .news-grid,
    .tariff-grid,
    .service-list,
    .form-grid,
    .admin-form-grid,
    .admin-stats {
        grid-template-columns: 1fr;
    }

    .settlement-selector,
    .cookie-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .cookie-actions {
        justify-content: stretch;
    }

    .cookie-actions .button {
        flex: 1 1 auto;
    }

    .section-heading.row,
    .admin-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-footer {
        grid-template-columns: 1fr;
    }

    .admin-body {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        height: auto;
    }

    .admin-main {
        padding: 18px;
    }
}
