:root {
    --primary-dark: #0D47A1;
    --primary: #1565C0;
    --primary-light: #42A5F5;
    --accent: #00ACC1;
    --accent-light: #26C6DA;
    --bg-light: #F5F7FA;
    --text-dark: #263238;
    --text-muted: #607D8B;
    --white: #FFFFFF;
    --border: #E0E0E0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background: var(--white);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--accent);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: var(--primary-dark);
    color: var(--white);
    padding: 8px 0;
    font-size: 14px;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-top a {
    color: var(--white);
}

.header-main {
    padding: 22px 0;
}

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 80px;
    width: auto;
}

.logo-text {
    font-size: 30px;
    font-weight: 700;
    color: var(--primary-dark);
}

.header-contact {
    text-align: right;
}

.header-contact .contact-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.header-contact .divider {
    width: 1px;
    height: 22px;
    background: var(--border);
    flex-shrink: 0;
}

.header-contact .address {
    font-size: 15px;
    color: var(--text-muted);
    text-align: left;
}

.header-contact .email {
    font-size: 15px;
    color: var(--text-muted);
    white-space: nowrap;
}

.header-contact .email a {
    color: var(--text-muted);
}

.header-contact .email a:hover {
    color: var(--accent);
}

.header-contact .phone {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
    white-space: nowrap;
}

.header-contact .email {
    font-size: 14px;
    color: var(--text-muted);
}

/* Navigation */
.nav {
    background: var(--primary);
}

.nav .container {
    display: flex;
    align-items: center;
}

.nav ul {
    list-style: none;
    display: flex;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 40px;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 9px 10px;
    flex-direction: column;
    justify-content: space-between;
}

.nav-toggle .bar {
    display: block;
    height: 3px;
    width: 100%;
    border-radius: 2px;
    background: var(--white);
    transition: transform 0.25s, opacity 0.25s;
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.nav ul li {
    position: relative;
}

.nav ul li a {
    display: block;
    padding: 15px 20px;
    color: var(--white);
    font-weight: 500;
    transition: background 0.3s;
}

.nav ul li a:hover,
.nav ul li a.active {
    background: var(--primary-dark);
    color: var(--white);
}

/* Hero */
.hero {
    position: relative;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--accent) 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../images/hero-datacenter.jpg');
    background-size: cover;
    background-position: center 45%;
    opacity: 1;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(13, 71, 161, 0.90) 0%,
            rgba(21, 101, 192, 0.82) 48%,
            rgba(0, 172, 193, 0.70) 100%);
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.hero p {
    font-size: 20px;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto 30px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--accent-light);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--primary-dark);
}

/* Sections */
.section {
    padding: 60px 0;
}

.section-light {
    background: var(--bg-light);
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 32px;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.section-title p {
    color: var(--text-muted);
    font-size: 16px;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--white);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(13, 71, 161, 0.15);
}

.service-card .icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--white);
    transition: transform 0.25s;
}

.service-card:hover .icon {
    transform: translateY(-3px);
}

.service-card .icon svg {
    width: 30px;
    height: 30px;
    display: block;
}

.article-card .article-image svg {
    width: 52px;
    height: 52px;
    display: block;
    opacity: 0.9;
}

.service-card h3 {
    color: var(--primary-dark);
    margin-bottom: 12px;
    font-size: 20px;
}

.service-card p {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.service-card a {
    color: var(--accent);
    font-weight: 600;
}

/* Articles */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.article-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.article-card:hover {
    transform: translateY(-3px);
}

.article-card .article-image {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 48px;
    overflow: hidden;
}

.article-card .article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-card .article-image svg {
    width: 52px;
    height: 52px;
    display: block;
    opacity: 0.9;
}

.article-card .article-body {
    padding: 20px;
}

.article-card .article-date {
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 8px;
}

.article-card h2 {
    font-size: 18px;
    margin-bottom: 10px;
}

.article-card h2 a {
    color: var(--text-dark);
}

.article-card h2 a:hover {
    color: var(--primary);
}

.article-card p {
    color: var(--text-muted);
    font-size: 16px;
}

/* Features */
.features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px;
}

.feature {
    flex: 0 1 calc(25% - 21px);
    max-width: calc(25% - 21px);
    text-align: center;
    padding: 30px 26px;
}

.feature-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 18px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
    box-shadow: 0 6px 18px rgba(13, 71, 161, 0.22);
    transition: transform 0.25s;
}

.feature:hover .feature-icon {
    transform: translateY(-4px);
}

.icon-svg {
    width: 30px;
    height: 30px;
    display: block;
}

.feature h3 {
    color: var(--primary-dark);
    font-size: 19px;
    line-height: 1.35;
    margin-bottom: 12px;
    /* резервируем место под две строки, чтобы описания всех карточек начинались на одной высоте */
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature p {
    color: var(--text-muted);
    font-size: 16px;
}

.audit-cta {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--accent) 100%);
    border-radius: 16px;
    padding: 48px 40px;
    text-align: center;
    color: var(--white);
    box-shadow: 0 16px 44px rgba(13, 71, 161, 0.22);
}

.audit-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 20px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.16);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.audit-icon .icon-svg {
    width: 34px;
    height: 34px;
}

.audit-cta h2 {
    font-size: 30px;
    color: var(--white);
    margin-bottom: 12px;
}

.audit-cta p {
    max-width: 640px;
    margin: 0 auto 26px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
}

.audit-cta .btn-primary {
    background: var(--white);
    color: var(--primary-dark);
}

.audit-cta .btn-primary:hover {
    background: var(--accent-light);
    color: var(--white);
}

/* Footer */
.footer {
    background: var(--primary-dark);
    color: var(--white);
    padding: 50px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer h4 {
    margin-bottom: 15px;
    font-size: 18px;
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 8px;
}

.footer ul li a {
    color: rgba(255,255,255,0.8);
}

.footer ul li a:hover {
    color: var(--accent-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 20px;
    text-align: center;
    font-size: 14px;
    color: rgba(255,255,255,0.7);
}

.photo-credit {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.55;
}

.footer-legal li {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
}

.footer-policy {
    display: inline-block;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: underline;
}

.footer-policy:hover {
    color: var(--accent-light);
}

/* Page content */
.page-content {
    padding: 40px 0;
}

.page-content h1 {
    color: var(--primary-dark);
    margin-bottom: 20px;
}

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

.page-body {
    font-size: 16px;
    line-height: 1.8;
}

.page-body p {
    margin-bottom: 18px;
}

.page-body ul {
    margin: 0 0 22px;
    padding-left: 0;
    list-style: none;
}

.page-body ul li {
    position: relative;
    padding-left: 34px;
    margin-bottom: 12px;
}

.page-body ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 11px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.page-body ul li::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 16px;
    width: 6px;
    height: 3px;
    border-left: 2px solid var(--white);
    border-bottom: 2px solid var(--white);
    transform: rotate(-45deg);
}

.page-body ul li strong {
    color: var(--primary-dark);
}

.page-body ol {
    margin: 0 0 22px;
    padding-left: 26px;
}

.page-body ol li {
    margin-bottom: 10px;
}

.page-body a {
    border-bottom: 1px solid rgba(0, 172, 193, 0.4);
}

.page-body h2 {
    color: var(--primary-dark);
    font-size: 26px;
    margin: 30px 0 14px;
}

.page-body h3 {
    color: var(--primary-dark);
    font-size: 20px;
    margin: 24px 0 12px;
}

.page-body blockquote {
    margin: 24px 0;
    padding: 16px 22px;
    border-left: 4px solid var(--accent);
    background: var(--bg-light);
    border-radius: 0 6px 6px 0;
    color: var(--text-muted);
}

/* Article page */
/* Выключка по ширине: ровные края у основного текста.
   Центрированным блокам (подзаголовки секций, футер) она не нужна —
   там строки короткие и выглядела бы «дырявой». */
.page-body,
.article-content,
.service-card p,
.feature p,
.aside-block p,
.modal-sub {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.article-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.article-page h1 {
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.article-page .article-meta {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 14px;
}

.article-page .article-content {
    line-height: 1.8;
}

/* Article hero */
.article-hero {
    margin: 0 0 28px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: 0 12px 32px rgba(13, 71, 161, 0.16);
}

.article-hero img {
    width: 100%;
    height: auto;
    display: block;
}

.article-figure {
    margin: 30px 0;
}

.article-figure img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
    display: block;
}

.article-figure figcaption {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.article-content .lead {
    line-height: 1.75;
    color: var(--text-dark);
    margin-bottom: 26px;
}

.article-content p {
    margin-bottom: 16px;
}

.article-content h2 {
    color: var(--primary-dark);
    font-size: 24px;
    margin: 34px 0 14px;
}

.article-content h3 {
    color: var(--primary-dark);
    font-size: 19px;
    margin: 26px 0 10px;
}

.article-content ul {
    margin: 0 0 20px;
    padding-left: 22px;
}

.article-content li {
    margin-bottom: 8px;
    text-align: justify;
    hyphens: auto;
}

/* Login */
.login-form {
    max-width: 400px;
    margin: 60px auto;
    padding: 40px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.login-form h2 {
    text-align: center;
    color: var(--primary-dark);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 16px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Admin */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: var(--primary-dark);
    color: var(--white);
    padding: 20px 0;
    flex-shrink: 0;
}

.admin-sidebar .admin-logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 20px;
}

.admin-sidebar .admin-logo h2 {
    font-size: 20px;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar ul li a {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    transition: all 0.3s;
}

.admin-sidebar ul li a:hover,
.admin-sidebar ul li a.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}

.admin-main {
    flex: 1;
    background: var(--bg-light);
    padding: 30px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-header h1 {
    color: var(--primary-dark);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.stat-card .stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .stat-label {
    color: var(--text-muted);
    margin-top: 5px;
}

.admin-table {
    width: 100%;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

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

.admin-table th {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
}

.admin-table tr:hover {
    background: var(--bg-light);
}

.admin-table .actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 5px 12px;
    font-size: 13px;
    border-radius: 3px;
    border: none;
    cursor: pointer;
}

.btn-edit {
    background: var(--primary-light);
    color: var(--white);
}

.btn-delete {
    background: #e53935;
    color: var(--white);
}

.btn-add {
    background: var(--accent);
    color: var(--white);
    margin-bottom: 20px;
}

/* Alerts */
.alert {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

.alert-error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

/* Responsive */
/* Page hero */
.page-hero {
    position: relative;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--accent) 100%);
    color: var(--white);
    padding: 45px 0;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../images/hero-datacenter.jpg');
    background-size: cover;
    background-position: center 45%;
}

.page-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(13, 71, 161, 0.93) 0%,
            rgba(21, 101, 192, 0.88) 55%,
            rgba(0, 172, 193, 0.78) 100%);
}

.page-hero .container {
    position: relative;
    z-index: 1;
}

.page-hero h1 {
    font-size: 34px;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.page-hero p {
    opacity: 0.95;
    max-width: 760px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.breadcrumbs {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 16px;
}

.breadcrumbs a {
    color: var(--white);
    text-decoration: underline;
}

.breadcrumbs span {
    opacity: 0.8;
}

.services-grid .service-card h2 {
    font-size: 20px;
    color: var(--primary-dark);
}

.services-grid .service-card h2 a {
    color: var(--primary-dark);
}

.services-grid .service-card h2 a:hover {
    color: var(--accent);
}

/* Service detail */
.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 40px;
    align-items: start;
}

.detail-main {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 34px;
}

.detail-aside {
    position: sticky;
    top: 110px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.aside-block {
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 22px;
}

.aside-block h4 {
    color: var(--primary-dark);
    font-size: 17px;
    margin-bottom: 10px;
}

.aside-block p {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 12px;
}

.aside-phone {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 6px;
}

.aside-phone:hover {
    color: var(--accent);
}

.aside-mail {
    display: block;
    font-size: 14px;
}

.aside-list {
    list-style: none;
}

.aside-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--bg-light);
}

.aside-list li:last-child {
    border-bottom: none;
}

.aside-list li a {
    font-size: 16px;
}

@media (max-width: 900px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-aside {
        position: static;
    }
}

@media (max-width: 1100px) {
    .feature {
        flex: 0 1 calc(33.333% - 19px);
        max-width: calc(33.333% - 19px);
    }
}

@media (max-width: 760px) {
    .feature {
        flex: 0 1 calc(50% - 14px);
        max-width: calc(50% - 14px);
        padding: 24px 18px;
    }
}

@media (max-width: 540px) {
    .feature {
        flex: 0 1 100%;
        max-width: 100%;
    }
}

/* Callback modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(13, 71, 161, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay[hidden] {
    display: none;
}

.modal {
    position: relative;
    background: var(--white);
    border-radius: 12px;
    padding: 34px 32px 28px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
    animation: modal-in 0.22s ease-out;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 6px;
}

.modal-sub {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-service {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 18px;
}

.modal-service[hidden] {
    display: none;
}

.aside-block .btn-block {
    margin-bottom: 14px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--primary-dark);
}

.modal .form-group {
    margin-bottom: 15px;
}

.modal .form-group label {
    font-size: 14px;
    font-weight: 600;
}

.modal .btn-block {
    width: 100%;
    margin-top: 6px;
}

.modal-note {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.modal-status {
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 14px;
    margin-bottom: 14px;
}

.modal-status.ok {
    background: #E8F5E9;
    color: #2E7D32;
}

.modal-status.err {
    background: #FFEBEE;
    color: #C62828;
}

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

body.modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .modal {
        padding: 28px 20px 22px;
    }

    .modal-title {
        font-size: 21px;
    }
}

@media (max-width: 768px) {
    .header-top {
        display: none;
    }

    .header-main {
        padding: 10px 0;
    }

    .header-main .container {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .logo {
        gap: 8px;
        flex-shrink: 0;
    }

    .logo img {
        height: 54px;
    }

    .logo-text {
        font-size: 21px;
    }

    .header-contact {
        text-align: right;
        margin-left: auto;
        min-width: 0;
    }

    .header-contact .contact-row {
        flex-direction: column;
        align-items: flex-end;
        gap: 1px;
    }

    .header-contact .divider {
        display: none;
    }

    .header-contact .phone {
        font-size: 17px;
    }

    .header-contact .address,
    .header-contact .email {
        font-size: 12px;
        line-height: 1.35;
        text-align: right;
    }

    .nav .container {
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 8px 20px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    .nav ul.active {
        display: flex;
    }

    .nav ul li a {
        padding: 13px 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .hero h1 {
        font-size: 28px;
    }

    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
    }
}

/* Медиатека */
.upload-form {
    background: var(--white);
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 22px;
}

.upload-form.dragging {
    border-color: var(--accent);
    background: #f2fbfd;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 18px;
}

.media-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.media-thumb {
    background: var(--bg-light);
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.media-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    color: var(--text-muted);
}

.media-meta code {
    font-size: 11px;
    word-break: break-all;
}

.media-alt-form input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
}

.media-empty {
    grid-column: 1 / -1;
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

/* Диалог выбора изображения */
.modal-wide {
    max-width: 760px;
}

.media-filter {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    margin-bottom: 16px;
    font-size: 14px;
}

.media-grid-dialog {
    max-height: 52vh;
    overflow-y: auto;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.media-item-pick {
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 8px;
    padding: 10px;
    transition: border-color 0.2s, transform 0.2s;
}

.media-item-pick:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.media-item-pick img {
    width: 100%;
    height: 96px;
    object-fit: contain;
    background: var(--bg-light);
    border-radius: 5px;
}

.media-item-pick code {
    display: block;
    margin-top: 7px;
    font-size: 11px;
    color: var(--text-muted);
    word-break: break-all;
}

/* Выбор обложки в статье */
.image-picker-row {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.image-preview {
    width: 190px;
    height: 110px;
    object-fit: contain;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
}

.image-preview:not([src]) {
    display: none;
}

.image-picker-row small {
    display: block;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Панель редактора статьи */
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.editor-hint {
    font-size: 12px;
    color: var(--text-muted);
}
