:root {
    --ink: #1b2838;
    --muted: #5d6d80;
    --line: #e4ebf3;
    --paper: #f4f7fb;
    --card: #ffffff;
    --blue: #1d6fe8;
    --blue-dark: #1558c0;
    --blue-soft: #e8f1ff;
    --green: #0f9f6e;
    --shadow: 0 16px 40px rgba(27, 40, 56, .08);
}

html { scroll-behavior: smooth; }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.55;
    padding-top: 76px;
}

body.is-site {
    background:
        radial-gradient(820px 380px at 110% -8%, #d9e9ff 0%, transparent 62%),
        radial-gradient(640px 320px at -12% 0%, #e5f6ef 0%, transparent 58%),
        var(--paper);
}

a { color: var(--blue); }
a:hover { color: var(--blue-dark); }

h1, h2, h3, h4, h5 {
    color: var(--ink);
    letter-spacing: -.02em;
    font-weight: 750;
}

.wrap { min-height: calc(100vh - 140px); }

.is-site .container-fluid { max-width: 1140px; }
.is-cabinet .container-fluid { max-width: 1380px; }

#main-nav {
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(27, 40, 56, .04);
    backdrop-filter: blur(12px);
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--ink) !important;
    font-size: 1.25rem;
    letter-spacing: -.03em;
}

.site-logo { width: 34px; height: 34px; display: block; flex: none; }
.site-logo-lg { width: 84px; height: 84px; }
.hero-copy { display: flex; gap: 18px; align-items: flex-start; }

.navbar .nav-link {
    color: #314156;
    font-weight: 650;
    border-radius: 10px;
    padding: .45rem .8rem;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    background: var(--blue-soft);
    color: var(--blue);
}

.navbar-toggler { border-color: var(--line); }

.landing { padding-bottom: 24px; }

.hero {
    display: grid;
    grid-template-columns: 1.3fr .7fr;
    gap: 28px;
    align-items: center;
    padding: 18px 0 10px;
}

.eyebrow {
    display: inline-block;
    margin: 0 0 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #d7e6fb;
    color: var(--blue);
    font-weight: 700;
    font-size: .82rem;
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.12;
    margin: 0 0 14px;
}

.hero .lead {
    font-size: 1.12rem;
    color: var(--muted);
    max-width: 38rem;
    margin-bottom: 22px;
}

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

.hero-stats {
    display: grid;
    gap: 12px;
}

.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: var(--shadow);
}

.stat b {
    display: block;
    font-size: 1.7rem;
    line-height: 1.1;
    color: var(--ink);
}

.stat span { color: var(--muted); font-size: .92rem; }

.section-title {
    margin: 42px 0 16px;
    font-size: 1.7rem;
}

.benefits {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.benefit {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px 18px 16px;
}

.benefit .mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 800;
    margin-bottom: 10px;
}

.benefit .info { font-weight: 750; margin-bottom: 4px; }
.benefit .desc { color: var(--muted); font-size: .95rem; }

.tariffs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.tariff-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-shadow: 0 10px 28px rgba(27, 40, 56, .04);
}

.tariff-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.tariff-text { min-width: 0; }
.tariff-ico { width: 52px; height: 52px; flex: none; }
.tariff-ico svg { width: 52px; height: 52px; display: block; }
.tariff-card .kind {
    align-self: flex-start;
    background: #eef8f3;
    color: var(--green);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.tariff-card.ipv6 .kind { background: var(--blue-soft); color: var(--blue); }

.tariff-card h3 {
    font-size: 1.05rem;
    margin: 6px 0 4px;
    line-height: 1.25;
}

.tariff-card .tagline {
    color: var(--muted);
    margin: 0;
    line-height: 1.35;
}

.tariff-card .price {
    font-size: 1.45rem;
    font-weight: 800;
    margin-top: auto;
    margin-bottom: 12px;
}

.tariff-card .price small {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--muted);
}

.tariff-card .btn { width: 100%; }

.faq { display: grid; gap: 10px; }

.faq-item {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
}

.faq-item h3 { font-size: 1.02rem; margin: 0 0 6px; }
.faq-item p { margin: 0; color: #314156; }

.auth-wrap {
    display: flex;
    justify-content: center;
    padding: 28px 12px 48px;
}

.auth-card {
    width: min(440px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 28px 26px 22px;
}

.auth-card h1 { font-size: 1.7rem; margin-bottom: 18px; text-align: center; }
.auth-card .btn { width: 100%; margin-top: 6px; }
.auth-links { text-align: center; margin: 8px 0 14px; }

.cabinet {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.cabinet-nav {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 10px;
    position: sticky;
    top: 90px;
}

.cabinet-nav .nav-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 650;
    border-radius: 12px;
    margin-bottom: 4px;
}

.cabinet-nav .nav-link:hover { background: var(--blue-soft); color: var(--blue); }
.cabinet-nav .nav-link.active { background: var(--blue); color: #fff; }
.cabinet-nav .badge {
    background: #eef3f9;
    color: var(--ink);
    font-weight: 750;
}
.cabinet-nav .nav-link.active .badge { background: rgba(255,255,255,.2); color: #fff; }

.cabinet-main h3 { margin-top: 4px; }

.panel, .grid-view, .tab-content, .auth-card {
    color: var(--ink);
}

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    margin-bottom: 16px;
    overflow: visible;
}

.panel-heading, .panel-title {
    padding: 12px 16px;
    font-weight: 750;
    background: #f8fbff;
    border-bottom: 1px solid var(--line);
}

.panel-body { padding: 16px; }
.panel-footer { padding: 12px 16px; border-top: 1px solid var(--line); background: #fff; }
.panel-info .panel-heading, .panel-warning .panel-heading { background: #f8fbff; }

.grid-view {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
}

.table {
    --bs-table-bg: #fff;
    --bs-table-striped-bg: #f6f9fc;
    --bs-table-color: var(--ink);
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    border-bottom-color: var(--line);
    vertical-align: middle;
}

.table-condensed > :not(caption) > * > * { padding: .45rem .55rem; }

.btn {
    border-radius: 12px;
    font-weight: 700;
    padding: .55rem 1rem;
}

.btn-primary {
    background: var(--blue);
    border-color: var(--blue);
    box-shadow: 0 8px 16px rgba(29, 111, 232, .16);
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
}

.btn-default {
    background: #fff;
    border: 1px solid #d5deea;
    color: var(--ink);
}

.btn-default:hover, .btn-default:focus {
    background: #f5f8fc;
    border-color: #c5d2e2;
    color: var(--ink);
}

.btn-info { background: #e8f1ff; border-color: #c9ddfb; color: #1558c0; }
.btn-info:hover { background: #d7e6ff; color: #1558c0; }
.btn-success { background: var(--green); border-color: var(--green); }
.btn-danger { border-radius: 12px; }
.btn-lg { padding: .75rem 1.3rem; border-radius: 14px; }

.btn-check:checked + .btn {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.form-control, .form-select, select.form-control, textarea.form-control {
    border: 1px solid #d5deea;
    border-radius: 12px;
    min-height: 46px;
    background: #fff;
    color: var(--ink);
    box-shadow: none;
}

textarea.form-control { min-height: 120px; }

.form-control:focus, .form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(29, 111, 232, .14);
}

.form-group, .mb-3 { margin-bottom: 14px; }
.control-label, .form-label { font-weight: 700; margin-bottom: .35rem; color: var(--ink); }

.invalid-feedback:not(:empty), .help-block:not(:empty) {
    display: block;
    color: #b42318;
}

.input-group-addon, .input-group-text {
    background: #f4f7fb;
    border: 1px solid #d5deea;
    color: var(--muted);
    border-radius: 12px 0 0 12px;
    display: flex;
    align-items: center;
    padding: 0 .8rem;
}

.input-group-btn { display: flex; }
.input-group .form-control { border-radius: 0 12px 12px 0; }

.modal-content {
    border: 0;
    border-radius: 20px;
    box-shadow: 0 28px 70px rgba(27, 40, 56, .22);
}

.modal-dialog { max-width: 460px; margin: 1.25rem auto; }

.tariff-picks { display: grid; gap: 8px; }
.tariff-pick {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    font-weight: 650;
}
.tariff-pick input { margin: 0; accent-color: var(--blue); }
.tariff-pick:has(input:checked) {
    border-color: var(--blue);
    background: var(--blue-soft);
}

.modal .btn-group {
    display: flex;
    flex-wrap: wrap;
    height: auto;
    width: 100%;
    gap: 8px;
}
.modal .btn-group > .btn,
.modal .btn-check + .btn {
    flex: 1 1 140px;
    white-space: normal;
    border-radius: 12px !important;
}
.modal .btn img { max-height: 26px; width: auto; }

.pay-total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 14px;
    padding: 12px;
    border-radius: 14px;
    background: #f4f8fd;
}
.pay-total strong { font-size: 1.15rem; margin: 0 4px; }
.pay-total span { color: var(--muted); }

.modal-header { border-bottom: 1px solid var(--line); padding: 16px 18px; }
.modal-title { font-weight: 800; }
.modal-body { padding: 18px; }
.modal-footer { border-top: 1px solid var(--line); }

.alert {
    border: 0;
    border-radius: 14px;
}

.nav-tabs { border-bottom: 1px solid var(--line); gap: 6px; }
.nav-tabs .nav-link {
    border: 0;
    border-radius: 12px 12px 0 0;
    color: var(--muted);
    font-weight: 700;
}
.nav-tabs .nav-link.active {
    background: #fff;
    color: var(--blue);
    border: 1px solid var(--line);
    border-bottom-color: #fff;
}
.badge {
    background: #d7e4f8;
    color: #14345c;
}
.nav-tabs .badge,
.nav-pills .badge {
    margin-left: .45rem;
    vertical-align: middle;
}
.nav-link.active .badge {
    background: var(--blue);
    color: #fff;
}
.tab-content {
    background: #fff;
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 16px 16px;
    padding: 16px;
}

.dropdown-menu {
    z-index: 1080;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(27, 40, 56, .16);
    padding: 6px;
    min-width: 240px;
}
.dropdown-menu > li > a, .dropdown-item {
    display: block;
    padding: .45rem .7rem;
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
}
.dropdown-menu > li > a:hover { background: var(--blue-soft); }

.ops-history { max-width: 820px; }
.ops-history .table { margin-bottom: 0; }
.ops-id { width: 4.5rem; color: var(--muted); }
.ops-date { white-space: nowrap; width: 11rem; }
.ops-comment { max-width: 280px; overflow-wrap: anywhere; }
.ops-money { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; width: 8rem; }
.op-in { color: #0b7a45; font-weight: 750; }
.op-out { color: #c2414a; font-weight: 750; }
.grid-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.pagesize-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    color: var(--muted);
    font-weight: 650;
    white-space: nowrap;
}
.pagesize-wrap select.pagesize {
    width: 96px;
    max-width: 96px;
    min-height: 36px;
    padding-top: .3rem;
    padding-bottom: .3rem;
}
.pagination { display: flex; gap: 6px; list-style: none; padding: 12px 0 0; flex-wrap: wrap; margin: 0; }
.pagination > li > a, .pagination > li > span, .page-link {
    display: block;
    padding: .4rem .75rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
}
.pagination > .active > a, .pagination > .active > span, .page-item.active .page-link {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.footer {
    margin-top: 36px;
    padding: 22px 0 28px;
    background: #fff;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.footer .container-fluid {
    max-width: 1140px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.footer img { height: 31px; width: auto; margin-right: 8px; background: #fff; border-radius: 4px; }

.doc {
    max-width: 860px;
    margin: 24px auto 40px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 28px 28px 12px;
}

.site-top {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 22px;
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid var(--line);
}

.site-top .brand { font-weight: 800; color: var(--ink); text-decoration: none; font-size: 1.2rem; }
.site-top nav { display: flex; gap: 8px; flex-wrap: wrap; }
.site-top nav a {
    color: #314156;
    text-decoration: none;
    font-weight: 700;
    padding: .35rem .7rem;
    border-radius: 10px;
}
.site-top nav a:hover { background: var(--blue-soft); color: var(--blue); }

.glyphicon { font-style: normal; display: inline-block; min-width: 1em; text-align: center; }
.glyphicon-fire:before { content: "⚡"; }
.glyphicon-shopping-cart:before { content: "▣"; }
.glyphicon-retweet:before { content: "↻"; }
.glyphicon-usd:before { content: "₽"; }
.glyphicon-cog:before { content: "⚙"; }
.glyphicon-user:before { content: "☺"; }
.glyphicon-refresh:before { content: "↻"; }
a.js-check-page { color: var(--blue); text-decoration: none; cursor: pointer; }
a.js-check-page.is-checking .glyphicon-refresh { display: inline-block; animation: proxy-spin .8s linear infinite; }
@keyframes proxy-spin { to { transform: rotate(360deg); } }
.glyphicon-ok:before { content: "✓"; }
.glyphicon-ban-circle:before { content: "✕"; }
.glyphicon-eye-open {
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.15em;
    background-color: var(--blue);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 5C6.5 5 2.1 8.4 1 12c1.1 3.6 5.5 7 11 7s9.9-3.4 11-7c-1.1-3.6-5.5-7-11-7zm0 11.2A4.2 4.2 0 1 1 12 7.8a4.2 4.2 0 0 1 0 8.4zm0-2.2a2 2 0 1 0 0-4 2 2 0 0 0 0 4z'/></svg>") center / contain no-repeat;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 5C6.5 5 2.1 8.4 1 12c1.1 3.6 5.5 7 11 7s9.9-3.4 11-7c-1.1-3.6-5.5-7-11-7zm0 11.2A4.2 4.2 0 1 1 12 7.8a4.2 4.2 0 0 1 0 8.4zm0-2.2a2 2 0 1 0 0-4 2 2 0 0 0 0 4z'/></svg>") center / contain no-repeat;
}
.glyphicon-eye-open:before { content: ""; }
.glyphicon-lock:before { content: "🔒"; }
.glyphicon-envelope:before { content: "✉"; }
.glyphicon-globe:before { content: "◌"; }
.glyphicon-plus:before { content: "+"; }
.glyphicon-time:before { content: "◷"; }
.glyphicon-remove:before { content: "✕"; }

.pull-right { float: right !important; }
.pull-left { float: left !important; }
.clearfix::after { content: ""; display: block; clear: both; }
.hidden { display: none !important; }
.caret { display: none; }
.navbar-right { margin-left: auto; }
.btn-group-justified { display: flex; width: 100%; }
.btn-group-justified > .btn,
.btn-group-justified > label { flex: 1 1 auto; }
img[src=""] { display: none; }

.ref-banners { display: grid; gap: 22px; margin-top: 8px; }
.ref-banners figure { margin: 0; }
.ref-banners img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.ref-banners figcaption { margin-top: 8px; color: var(--muted); font-size: .92rem; }
.ref-banners code {
    display: block;
    margin-top: 4px;
    color: #314156;
    word-break: break-all;
    white-space: normal;
}

@media (max-width: 980px) {
    .hero, .benefits, .tariffs, .cabinet { grid-template-columns: 1fr; }
    .cabinet-nav { position: static; }
    .hero h1 { font-size: 2rem; }
}

@media (max-width: 640px) {
    body { padding-top: 68px; }
    .hero-copy { flex-direction: column; }
    .site-logo-lg { width: 64px; height: 64px; }
    .site-top { height: auto; min-height: 64px; padding: 10px 14px; flex-wrap: wrap; }
    .doc { padding: 18px 14px 8px; }
    .footer .container-fluid { padding-left: 14px; padding-right: 14px; }
}
