:root {
    --ink: #172126;
    --muted: #5e6b73;
    --paper: #f5f7f8;
    --panel: #ffffff;
    --line: #d6e0e4;
    --dark: #123442;
    --blue: #297e97;
    --blue-dark: #1c6378;
    --teal: #188c8a;
    --orange: #f08d18;
    --orange-dark: #c86f09;
    --danger: #b42318;
    --success: #167a45;
    --shadow: 0 16px 38px rgba(18, 52, 66, .14);
}

* {
    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:hover {
    color: var(--blue-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(240, 141, 24, .45);
    outline-offset: 3px;
}

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

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

.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);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 78px;
    padding: 10px 5vw;
    border-bottom: 1px solid rgba(214, 224, 228, .9);
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(14px);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

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

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

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

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

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

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-toggle,
.accessibility-toggle {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-weight: 900;
}

.nav-toggle {
    display: none;
}

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

.accessibility-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 5vw;
    z-index: 70;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: min(440px, calc(100vw - 32px));
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.accessibility-panel[hidden] {
    display: none;
}

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

.status-hero {
    position: relative;
    background-image: linear-gradient(rgba(11, 39, 50, .86), rgba(11, 39, 50, .8)), url("../status/custom-header-bg.jpg");
    background-position: center;
    background-size: cover;
}

.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, .86);
    font-size: 20px;
}

.eyebrow,
.section-kicker {
    margin: 0 0 12px;
    color: var(--orange);
    font-weight: 900;
    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: 900;
    text-align: center;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

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

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

.button.primary:hover {
    background: var(--orange-dark);
    color: #fff;
}

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

.button.light {
    border-color: rgba(255, 255, 255, .36);
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

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

.button.full {
    width: 100%;
}

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

.hero-status-card {
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 8px;
    background: rgba(255, 255, 255, .9);
    color: var(--ink);
    box-shadow: var(--shadow);
}

.hero-brand-mark {
    width: 230px;
    margin-bottom: 18px;
}

.hero-status-card dl,
.contact-details dl {
    display: grid;
    gap: 14px;
    margin: 0;
}

.hero-status-card dt,
.contact-details dt {
    font-weight: 900;
}

.hero-status-card dd,
.contact-details dd {
    margin: 0;
    color: var(--muted);
}

.notice-band {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 14px 5vw;
    background: #fff4e2;
    color: #5b3a08;
    border-bottom: 1px solid #f3d7a8;
}

.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-image: linear-gradient(rgba(18, 52, 66, .9), rgba(18, 52, 66, .82)), url("../status/custom-header-bg.jpg");
    background-position: center;
    background-size: cover;
}

.section-heading {
    max-width: 780px;
    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,
.payment-primary h2,
.article-page h2,
.admin-panel h2 {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.12;
    letter-spacing: 0;
}

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

.split-band,
.news-band {
    background: #fff;
}

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

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

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

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

.feature-grid article,
.tariff-card,
.news-card,
.service-list article,
.document-card,
.tv-placeholder,
.form-panel,
.qr-panel,
.payment-primary,
.admin-panel,
.admin-stats article,
.auth-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 6px 20px rgba(18, 52, 66, .07);
}

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

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

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

.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;
}

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

.tariff-card.featured {
    border-color: rgba(240, 141, 24, .55);
}

.plan-ribbon {
    position: absolute;
    top: 14px;
    right: 14px;
    margin: 0;
    padding: 5px 9px;
    border-radius: 6px;
    background: var(--orange);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}

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

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

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

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

.check-list {
    display: grid;
    gap: 7px;
    padding-left: 20px;
    color: var(--muted);
}

.order-band {
    background: #eaf4f6;
}

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

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

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

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

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

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

label span {
    font-size: 14px;
}

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

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(41, 126, 151, .18);
    border-color: var(--blue);
}

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

.agreement-check,
.inline-check,
.check-cell {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 800;
}

.agreement-check input,
.inline-check input,
.check-cell input {
    width: auto;
    min-height: auto;
    margin-top: 5px;
}

.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-date {
    margin: 0 0 8px;
    color: var(--orange-dark);
    font-weight: 900;
}

.callout,
.empty-state {
    border: 1px dashed #b9c9cf;
    border-radius: 8px;
    padding: 20px;
    color: var(--muted);
    background: #fff;
}

.callout {
    margin-top: 24px;
}

.tv-placeholder,
.qr-panel,
.payment-primary {
    padding: 22px;
}

.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;
}

.qr-panel {
    text-align: center;
}

.qr-panel img {
    width: min(220px, 70%);
}

.details-list {
    display: grid;
    gap: 14px;
}

details {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

summary {
    cursor: pointer;
    padding: 16px 18px;
    color: var(--ink);
    font-weight: 900;
}

.payment-steps {
    display: grid;
    gap: 16px;
    padding: 0 18px 18px;
}

.payment-steps img {
    border: 1px solid var(--line);
    border-radius: 8px;
}

.responsive-table {
    overflow-x: auto;
}

.responsive-table table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    background: #fff;
}

.responsive-table th,
.responsive-table td {
    padding: 12px 14px;
    border: 1px solid var(--line);
    text-align: left;
}

.responsive-table th {
    background: #e8f3f6;
}

.messenger-row {
    display: flex;
    gap: 12px;
    margin-top: 22px;
}

.messenger-row img {
    width: 42px;
    height: 42px;
}

.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);
}

.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: 900;
}

.flash.success {
    color: var(--success);
    border-color: #9bd1b7;
    background: #effaf4;
}

.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 {
    display: grid;
    grid-template-columns: 1fr 1fr minmax(180px, auto) auto;
    gap: 28px;
    padding: 34px 5vw;
    background: #0f2b36;
    color: #eaf4f6;
}

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

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

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

.footer-badges {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.footer-badges img {
    max-width: 92px;
    max-height: 42px;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    padding: 4px;
}

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

.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: #dbe8ec;
    font-weight: 900;
}

.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,
.admin-panel {
    padding: 22px;
}

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

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

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

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

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

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

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

.admin-table small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.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;
}

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

.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;
}

body.a11y-large-text {
    font-size: 18px;
}

body.a11y-contrast {
    --ink: #000;
    --muted: #111;
    --paper: #fff;
    --panel: #fff;
    --line: #000;
    --dark: #000;
    --blue: #004b62;
    --blue-dark: #002f3d;
    --orange: #9b4f00;
    --orange-dark: #6f3700;
}

body.a11y-contrast .site-header,
body.a11y-contrast .form-panel,
body.a11y-contrast .tariff-card,
body.a11y-contrast .news-card,
body.a11y-contrast .document-card,
body.a11y-contrast details {
    border-color: #000;
}

body.a11y-links a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

body.a11y-reduced-motion * {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

@media (max-width: 1120px) {
    .hero,
    .split-band,
    .service-layout,
    .tv-layout,
    .contact-layout,
    .payment-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));
    }

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

@media (max-width: 840px) {
    .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,
    .main-nav .language-select {
        width: 100%;
    }

    .accessibility-panel {
        right: 16px;
    }

    .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,
    .document-grid,
    .form-grid,
    .admin-form-grid,
    .admin-stats {
        grid-template-columns: 1fr;
    }

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

    .cookie-actions,
    .hero-actions,
    .inline-actions {
        justify-content: stretch;
    }

    .cookie-actions .button,
    .hero-actions .button,
    .inline-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;
    }
}
