:root {
    --orange: #ff7a1a;
    --orange-dark: #e05e00;
    --orange-light: #ffb066;
    --orange-soft: #fff4e8;
    --dark: #1a1a1f;
    --gray: #6b6b76;
    --light: #f7f7fb;
    --white: #ffffff;
    --radius: 16px;
    --shadow: 0 10px 40px rgba(255, 122, 26, 0.12);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.08);
    --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--dark);
    background: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* Header */
.header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: var(--transition);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px;
}
.logo { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--dark); }
.logo-mark {
    width: 44px; height: 44px; border-radius: 12px;
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    color: #fff; font-weight: 800; font-size: 22px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow);
}
.logo-title { font-weight: 700; font-size: 16px; }
.logo-sub { font-size: 11px; color: var(--gray); text-transform: uppercase; letter-spacing: 0.5px; }

.nav { display: flex; align-items: center; gap: 8px; }
.nav a {
    padding: 10px 16px; border-radius: 10px;
    text-decoration: none; color: var(--dark); font-weight: 500; font-size: 15px;
    transition: var(--transition);
    position: relative;
}
.nav a:hover { background: var(--orange-soft); color: var(--orange-dark); }
.admin-link { color: var(--orange-dark) !important; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border-radius: 12px;
    font-weight: 600; font-size: 15px;
    text-decoration: none; cursor: pointer; border: none;
    transition: var(--transition);
    font-family: inherit;
}
.btn-primary {
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    color: #fff;
    box-shadow: var(--shadow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 15px 40px rgba(255,122,26,0.35); }
.btn-outline {
    background: transparent; color: var(--orange-dark);
    border: 2px solid var(--orange);
}
.btn-outline:hover { background: var(--orange); color: #fff; }

.burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; }
.burger span { width: 24px; height: 2px; background: var(--dark); border-radius: 2px; transition: var(--transition); }

/* Hero */
.hero {
    position: relative; padding: 100px 0 140px;
    background: linear-gradient(135deg, #fff9f3 0%, #ffe9d4 100%);
    overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; top: -100px; right: -100px;
    width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,122,26,0.25), transparent 70%);
    animation: float 8s ease-in-out infinite;
}
.hero::after {
    content: ''; position: absolute; bottom: -150px; left: -100px;
    width: 400px; height: 400px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,122,26,0.15), transparent 70%);
    animation: float 10s ease-in-out infinite reverse;
}
@keyframes float {
    0%, 100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(30px,-30px) scale(1.05); }
}
.hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items: center; }
.hero h1 {
    font-size: clamp(36px, 5vw, 60px); line-height: 1.1;
    font-weight: 800; margin-bottom: 24px;
    animation: fadeUp 0.8s ease both;
}
.hero h1 span {
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { font-size: 18px; color: var(--gray); margin-bottom: 36px; animation: fadeUp 0.8s 0.15s ease both; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; animation: fadeUp 0.8s 0.3s ease both; }

.hero-card {
    background: #fff; border-radius: 24px; padding: 32px;
    box-shadow: var(--shadow-lg);
    animation: fadeUp 0.8s 0.45s ease both;
    border: 1px solid rgba(255,122,26,0.1);
}
.hero-card h3 { margin-bottom: 16px; }
.hero-card-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.hero-card-row:last-child { border-bottom: none; }
.hero-card-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--orange-soft); color: var(--orange-dark);
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.section { padding: 90px 0; }
.section-title { font-size: clamp(28px, 4vw, 42px); font-weight: 800; margin-bottom: 16px; }
.section-sub { color: var(--gray); font-size: 17px; max-width: 600px; margin-bottom: 48px; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header .section-sub { margin-left: auto; margin-right: auto; }

/* Feature cards */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.card {
    background: #fff; border-radius: var(--radius); padding: 32px;
    border: 1px solid #eee;
    transition: var(--transition);
    position: relative; overflow: hidden;
}
.card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--orange), var(--orange-light));
    transform: scaleX(0); transform-origin: left;
    transition: var(--transition);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card:hover::before { transform: scaleX(1); }
.card-icon {
    width: 56px; height: 56px; border-radius: 14px;
    background: var(--orange-soft); color: var(--orange-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 800; margin-bottom: 20px;
    transition: var(--transition);
}
.card:hover .card-icon { background: linear-gradient(135deg, var(--orange), var(--orange-dark)); color: #fff; transform: rotate(-6deg) scale(1.05); }
.card h3 { margin-bottom: 12px; font-size: 20px; }
.card p { color: var(--gray); font-size: 15px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat {
    text-align: center; padding: 32px 16px;
    background: linear-gradient(135deg, #fff, var(--orange-soft));
    border-radius: var(--radius);
}
.stat-num { font-size: 44px; font-weight: 800; color: var(--orange-dark); }
.stat-label { color: var(--gray); font-size: 14px; }

/* Forms */
.form-container { max-width: 480px; margin: 80px auto; padding: 40px; }
.form-container.wide { max-width: 720px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 14px; }
.form-control {
    width: 100%; padding: 14px 18px; border-radius: 12px;
    border: 2px solid #eee; font-size: 15px; font-family: inherit;
    background: #fff; transition: var(--transition); color: var(--dark);
}
.form-control:focus {
    outline: none; border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(255,122,26,0.12);
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 120px; }

.alert { padding: 14px 18px; border-radius: 12px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: #e6f9ee; color: #1a7a48; border-left: 4px solid #1a7a48; }
.alert-error { background: #fdeaea; color: #b32727; border-left: 4px solid #b32727; }

/* Cabinet */
.tabs { display: flex; gap: 8px; margin-bottom: 32px; flex-wrap: wrap; }
.tab {
    padding: 12px 22px; border-radius: 12px; background: #f2f2f5;
    cursor: pointer; font-weight: 500; border: none; font-family: inherit; font-size: 15px;
    transition: var(--transition);
}
.tab.active { background: var(--orange); color: #fff; box-shadow: var(--shadow); }
.tab-content { display: none; animation: fadeUp 0.4s ease; }
.tab-content.active { display: block; }

.request-item {
    background: #fff; border-radius: var(--radius); padding: 20px 24px;
    margin-bottom: 16px; border: 1px solid #eee;
    transition: var(--transition);
}
.request-item:hover { box-shadow: var(--shadow); }
.request-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-new { background: #fff3e0; color: var(--orange-dark); }
.badge-in_progress { background: #e3f2fd; color: #1565c0; }
.badge-done { background: #e6f9ee; color: #1a7a48; }
.badge-type { background: #f2f2f5; color: var(--gray); }

/* Admin */
.admin-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: var(--dark); color: #fff; padding: 32px 20px; }
.sidebar a { display: block; padding: 12px 16px; border-radius: 10px; color: #ccc; text-decoration: none; margin-bottom: 4px; transition: var(--transition); }
.sidebar a:hover, .sidebar a.active { background: var(--orange); color: #fff; }
.sidebar h2 { margin-bottom: 24px; font-size: 18px; color: #fff; }
.admin-main { padding: 40px; background: var(--light); }

.table { width: 100%; background: #fff; border-radius: var(--radius); overflow: hidden; border-collapse: collapse; }
.table th, .table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid #f0f0f0; }
.table th { background: #fafafa; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray); }
.table tr:hover td { background: #fff9f3; }

/* Footer */
.footer { background: var(--dark); color: #bbb; padding: 60px 0 20px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer h4 { color: #fff; margin-bottom: 16px; }
.footer a { display: block; color: #bbb; text-decoration: none; padding: 4px 0; transition: var(--transition); }
.footer a:hover { color: var(--orange); }
.footer .logo-mark { margin-bottom: 16px; }
.footer-bottom { text-align: center; padding-top: 30px; margin-top: 40px; border-top: 1px solid #333; font-size: 13px; }

/* Responsive */
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; }
    .grid-3, .grid-4, .stats { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .admin-layout { grid-template-columns: 1fr; }
    .sidebar { display: flex; gap: 8px; overflow-x: auto; padding: 16px; }
    .sidebar h2 { display: none; }
}
@media (max-width: 640px) {
    .nav { display: none; }
    .nav.open { display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: #fff; padding: 16px; box-shadow: var(--shadow-lg); }
    .burger { display: flex; }
    .grid-3, .grid-4, .grid-2, .stats { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero { padding: 60px 0 80px; }
    .section { padding: 60px 0; }
}
/* ============================================================
   СЛАЙДЕР НА ГЛАВНОЙ
   ============================================================ */
.hero-slider {
    position: relative;
    height: 620px;
    overflow: hidden;
    background: #1a1a1f;
}
.slider-track {
    position: relative;
    width: 100%;
    height: 100%;
}
.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease, transform 1s ease;
    background-size: cover;
    background-position: center;
    transform: scale(1.05);
}
.slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
}
.slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.35) 60%, transparent 100%);
}
.slide-content {
    position: relative;
    z-index: 3;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
}
.slide-content h2 {
    font-size: clamp(32px, 4.5vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    max-width: 720px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.slide-content p {
    font-size: 18px;
    max-width: 620px;
    margin-bottom: 32px;
    opacity: 0.95;
    line-height: 1.6;
}
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}
.slider-arrow:hover {
    background: var(--orange);
    border-color: var(--orange);
    transform: translateY(-50%) scale(1.08);
}
.slider-arrow.prev { left: 24px; }
.slider-arrow.next { right: 24px; }
.slider-arrow svg { width: 24px; height: 24px; }
.slider-dots {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 10px;
}
.slider-dot {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: 0.3s;
    border: none;
    padding: 0;
}
.slider-dot.active { background: var(--orange); width: 60px; }
@media (max-width: 768px) {
    .hero-slider { height: 480px; }
    .slider-arrow { width: 44px; height: 44px; }
    .slider-arrow.prev { left: 12px; }
    .slider-arrow.next { right: 12px; }
}

/* ============================================================
   ПУБЛИЧНЫЕ ДОКУМЕНТЫ
   ============================================================ */
.doc-sections {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: start;
}
.doc-nav {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid #eee;
    position: sticky;
    top: 90px;
}
.doc-nav h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.doc-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: 0.25s;
    margin-bottom: 4px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 15px;
}
.doc-nav-item:hover { background: var(--orange-soft); color: var(--orange-dark); }
.doc-nav-item.active {
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    color: #fff;
    box-shadow: var(--shadow);
}
.doc-nav-item .count {
    margin-left: auto;
    background: rgba(0,0,0,0.08);
    border-radius: 20px;
    font-size: 12px;
    padding: 2px 10px;
    font-weight: 600;
}
.doc-nav-item.active .count {
    background: rgba(255,255,255,0.25);
}

.doc-section {
    display: none;
    animation: fadeUp 0.4s ease;
}
.doc-section.active { display: block; }
.doc-section h2 {
    font-size: 28px;
    margin-bottom: 8px;
}
.doc-section > p {
    color: var(--gray);
    margin-bottom: 24px;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid #eee;
    margin-bottom: 12px;
    transition: 0.3s;
}
.doc-item:hover {
    border-color: var(--orange);
    box-shadow: var(--shadow);
    transform: translateX(4px);
}
.doc-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--orange-soft);
    color: var(--orange-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.doc-info { flex: 1; }
.doc-info h4 { font-size: 16px; margin-bottom: 4px; }
.doc-info small { color: var(--gray); font-size: 13px; }
.doc-download {
    padding: 10px 20px;
    border-radius: 10px;
    background: var(--orange);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: 0.3s;
    white-space: nowrap;
}
.doc-download:hover {
    background: var(--orange-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255,122,26,0.35);
}
@media (max-width: 900px) {
    .doc-sections { grid-template-columns: 1fr; }
    .doc-nav { position: static; }
}

/* ============================================================
   ADMIN: загрузка файлов и слайдов
   ============================================================ */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 24px;
}
.admin-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid #eee;
    transition: 0.3s;
}
.admin-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}
.admin-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}
.admin-card-body { padding: 16px; }
.admin-card-body h4 { font-size: 15px; margin-bottom: 6px; }
.admin-card-body small { color: var(--gray); font-size: 12px; }
.admin-card-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.btn-danger { background: #fdeaea; color: #b32727; }
.btn-danger:hover { background: #b32727; color: #fff; }
.btn-toggle { background: #f0f0f5; color: #555; }
.btn-toggle.on { background: #e6f9ee; color: #1a7a48; }

/* Кнопки-стрелки ▲▼ в админке */
.table td a.btn-toggle {
    display: inline-block;
    line-height: 1;
    text-decoration: none;
    text-align: center;
    min-width: 22px;
}
.table td a.btn-toggle:hover {
    background: var(--orange);
    color: #fff;
}


/* NEW-REPLY BADGE FIX */
.request-item {
    padding-bottom: 48px !important;
    min-height: 100px;
}
.request-item > span[style*="Новый ответ"] {
    bottom: 12px !important;
    top: auto !important;
}


/* === MENU STRETCH FIX === */
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 32px;
    max-width: 100%;
}

.header-inner .logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.header-inner .logo-mark {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    font-size: 16px;
}
.header-inner .logo-title {
    font-size: 15px;
    white-space: nowrap;
}
.header-inner .logo-sub {
    font-size: 10px;
    white-space: nowrap;
}

.header-inner .nav {
    display: flex !important;
    align-items: center;
    gap: 4px;
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: nowrap !important;
    overflow: hidden;
    min-width: 0;
}

.header-inner .nav > a {
    padding: 8px 12px;
    font-size: 15px;
    white-space: nowrap;
    border-radius: 8px;
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: 0.25s;
    flex-shrink: 0;
}
.header-inner .nav > a:hover {
    background: var(--orange-soft);
    color: var(--orange-dark);
}

.header-inner .nav .btn {
    padding: 10px 16px !important;
    font-size: 14px;
    border-radius: 10px;
    flex-shrink: 0;
}

@media (max-width: 1400px) {
    .header-inner .nav > a { padding: 8px 9px; font-size: 14px; }
    .header-inner .nav .btn { padding: 8px 12px !important; font-size: 13px; }
    .header-inner .logo-title { font-size: 14px; }
}

@media (max-width: 1200px) {
    .header-inner .nav > a { padding: 7px 7px; font-size: 13px; }
    .header-inner .nav .btn { padding: 7px 10px !important; font-size: 12px; }
    .header-inner .logo-mark { width: 40px; height: 40px; font-size: 14px; }
    .header-inner .logo-title { font-size: 13px; }
    .header-inner .logo-sub { font-size: 9px; }
}

@media (max-width: 1000px) {
    .header-inner .nav > a { padding: 6px 5px; font-size: 12px; }
    .header-inner .nav .btn { padding: 6px 8px !important; font-size: 11px; }
}

@media (max-width: 900px) {
    .header-inner .nav {
        display: none;
    }
    .header-inner .nav.open {
        display: flex !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        flex-wrap: wrap !important;
        background: #fff;
        padding: 20px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.1);
        gap: 8px;
        overflow: visible;
    }
    .header-inner .nav > a {
        padding: 12px 16px;
        font-size: 15px;
        width: 100%;
        text-align: left;
    }
    .header-inner .nav .btn {
        padding: 12px 16px !important;
        font-size: 15px;
        width: 100%;
        justify-content: center;
    }
    .header-inner .burger {
        display: flex !important;
    }
}
@media (min-width: 1600px) {
    .header-inner { padding: 14px 48px; }
    .header-inner .nav > a { padding: 9px 16px; font-size: 16px; }
}
