/* =========================================
   ДИЗАЙН-СИСТЕМА RVS (как на лендинге)
   ========================================= */
:root {
    --bg: #FBFCF4;
    --primary: #5D99C6;
    --accent: #FF8C00;
    --text: #4A3F35;
    --text-secondary: #6B5B4F;
    --border: #E5DDD5;
    --card-bg: #FFFFFF;
    --shadow: rgba(74, 63, 53, 0.08);
    --shadow-hover: rgba(74, 63, 53, 0.15);
    --radius: 20px;
    --radius-sm: 12px;
    --transition: 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Manrope', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* =========================================
   LAYOUT АДМИНКИ
   ========================================= */
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 280px;
    background: var(--text);
    color: var(--bg);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100%;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain; /* предотвращает "скакание" */
}

.admin-sidebar h3 {
    color: var(--accent);
    margin-bottom: 32px;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.admin-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: visible;  /* убираем внутреннюю прокрутку */
    margin-bottom: 8px;
    padding-right: 0;     /* убираем лишние отступы */
}

.admin-sidebar .sidebar-footer {
    flex-shrink: 0;
    padding-top: 16px;
    border-top: 1px solid rgba(251, 252, 244, 0.15);
}

.admin-sidebar a {
    padding: 14px 16px;
    color: var(--bg);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: background var(--transition), color var(--transition); /* убираем transform */
    display: flex;
    align-items: center;
    gap: 10px;
    word-break: break-word;
    white-space: normal;
    max-width: 100%;
    flex-shrink: 0;      /* предотвращаем сжатие */
}

.admin-sidebar a:hover {
    background: rgba(255, 140, 0, 0.15);
    color: var(--accent);
    /* убираем transform: translateX(4px); чтобы не было скакания */
}

.admin-sidebar a.active {
    background: var(--accent);
    color: white;
    font-weight: 600;
}

.admin-content {
    padding: 40px;
    flex: 1;
    background: var(--bg);
    min-height: 100vh;
}

/* =========================================
   КОМПОНЕНТЫ АДМИНКИ
   ========================================= */
.admin-card {
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px var(--shadow);
    margin-bottom: 24px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.admin-card:hover {
    box-shadow: 0 8px 24px var(--shadow-hover);
}

h1, h2, h3 {
    color: var(--text);
    font-weight: 700;
}

h1 { font-size: 32px; margin-bottom: 24px; }
h3 { font-size: 20px; margin-bottom: 16px; }

/* =========================================
   ФОРМЫ
   ========================================= */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    background: var(--bg);
    color: var(--text);
    transition: all var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(93, 153, 198, 0.15);
    background: var(--card-bg);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* =========================================
   КНОПКИ
   ========================================= */
.btn-admin {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    font-family: 'Manrope', sans-serif;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-save {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(93, 153, 198, 0.3);
}
.btn-save:hover {
    background: #4a8ab5;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(93, 153, 198, 0.4);
}

.btn-delete {
    background: #E57373;
    color: white;
}
.btn-delete:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

.btn-add {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
}
.btn-add:hover {
    background: #e67e00;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 140, 0, 0.4);
}

/* =========================================
   ТАБЛИЦЫ
   ========================================= */
.table-admin {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow);
}

.table-admin th, .table-admin td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table-admin th {
    background: rgba(93, 153, 198, 0.08);
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-admin tr:last-child td {
    border-bottom: none;
}

.table-admin tr:hover td {
    background: rgba(93, 153, 198, 0.04);
}

/* =========================================
   АДАПТИВНОСТЬ
   ========================================= */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 20px;
    }
    .admin-sidebar nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .admin-content {
        padding: 20px;
    }
}

/* Кнопки действий в таблицах — всегда в ряд */
.action-buttons { display: flex; gap: 8px; }
.action-buttons .btn-admin { flex-shrink: 0; }

/* ===== ПУБЛИЧНЫЙ ЛЕНДИНГ ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.site-header { position: sticky; top: 0; background: rgba(251,252,244,0.95); backdrop-filter: blur(10px); z-index: 100; padding: 16px 0; border-bottom: 1px solid var(--border); }
.header-content { display: flex; justify-content: space-between; align-items: center; position: relative; }
.logo { order: 1; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 24px; color: var(--primary); text-decoration: none; }
.logo-icon { width: 50px; height: 50px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.nav-toggle { display: none; }
.mobile-menu-btn { order: 3; display: block; background: none; border: none; font-size: 28px; cursor: pointer; color: var(--text); }
.site-nav { order: 2; display: none; }
.site-nav a { color: var(--text); text-decoration: none; margin-left: 24px; font-weight: 600; transition: color var(--transition); }
.site-nav a:hover { color: var(--accent); }

.hero { padding: 60px 0; text-align: center; }
.hero-content { max-width: 700px; margin: 0 auto; }
.hero h1 { font-size: 36px; font-weight: 700; line-height: 1.2; margin-bottom: 20px; color: var(--text); }
.hero h1 span { color: var(--accent); }
.hero-subtitle { font-size: 18px; color: var(--text-secondary); margin-bottom: 32px; line-height: 1.6; }
.hero-buttons { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 16px 32px; border-radius: var(--radius-sm); font-weight: 600; font-size: 16px; font-family: 'Manrope', sans-serif; text-decoration: none; transition: all var(--transition); cursor: pointer; border: none; }
.btn-primary { background: var(--accent); color: white; box-shadow: 0 4px 12px rgba(255,140,0,0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,140,0,0.4); }
.btn-secondary { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(93,153,198,0.3); }
.btn-secondary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(93,153,198,0.4); }
.hero-note { font-size: 14px; color: var(--text-secondary); }
.hero-image { margin-top: 40px; margin-left: auto; margin-right: auto; display: flex; justify-content: center; width: 100%; }
.hero-image img { width: 100%; height: auto; object-fit: contain; border-radius: var(--radius); box-shadow: 0 20px 40px var(--shadow); }

section { padding: 60px 0; scroll-margin-top: 80px; }
.section-title { font-size: 32px; font-weight: 700; text-align: center; margin-bottom: 16px; color: var(--text); }
.section-subtitle { font-size: 18px; text-align: center; color: var(--text-secondary); margin-bottom: 40px; max-width: 600px; margin-left: auto; margin-right: auto; }

.problem-grid, .advantages-grid { display: grid; gap: 20px; }
.problem-card, .advantage-card { background: var(--card-bg); padding: 28px; border-radius: var(--radius); box-shadow: 0 4px 12px var(--shadow); transition: transform var(--transition); }
.problem-card:hover, .advantage-card:hover { transform: translateY(-4px); }
.problem-icon, .advantage-icon { font-size: 40px; margin-bottom: 16px; }
.problem-card h3, .advantage-card h3 { font-size: 20px; margin-bottom: 12px; color: var(--text); }
.problem-card p, .advantage-card p { color: var(--text-secondary); line-height: 1.6; }

.how-it-works { background: linear-gradient(135deg, rgba(93,153,198,0.1) 0%, rgba(255,140,0,0.1) 100%); }
.steps { display: grid; gap: 24px; }
.step { background: var(--card-bg); padding: 32px; border-radius: var(--radius); box-shadow: 0 4px 12px var(--shadow); position: relative; }
.step-number { position: absolute; top: -20px; left: 32px; width: 40px; height: 40px; background: var(--accent); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }
.step h3 { font-size: 20px; margin-bottom: 12px; margin-top: 8px; }
.step p { color: var(--text-secondary); }
.steps-note { text-align: center; margin-top: 32px; font-weight: 600; color: var(--primary); }

.vets-grid { display: grid; gap: 24px; }
.vet-card { background: var(--card-bg); border-radius: var(--radius); overflow: hidden; box-shadow: 0 4px 12px var(--shadow); transition: transform var(--transition); }
.vet-card:hover { transform: translateY(-4px); }
.vet-photo { width: 100%; height: 240px; object-fit: cover; background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%); display: flex; align-items: center; justify-content: center; color: white; font-size: 14px; text-align: center; padding: 20px; }
.vet-info { padding: 24px; }
.vet-info h3 { font-size: 20px; margin-bottom: 8px; }
.vet-specialty { color: var(--primary); font-weight: 600; margin-bottom: 12px; }
.vet-stats { display: flex; gap: 16px; margin-bottom: 12px; font-size: 14px; color: var(--text-secondary); }
.vet-rating { color: var(--accent); font-weight: 600; }
.vet-description { color: var(--text-secondary); font-style: italic; }

.pricing { background: linear-gradient(135deg, rgba(255,140,0,0.05) 0%, rgba(93,153,198,0.05) 100%); }
.pricing-grid { display: grid; gap: 24px; }
.pricing-card { background: var(--card-bg); padding: 32px; border-radius: var(--radius); box-shadow: 0 4px 12px var(--shadow); transition: transform var(--transition); position: relative; }
.pricing-card:hover { transform: translateY(-4px); }
.pricing-card.popular { border: 3px solid var(--accent); }
.popular-badge { position: absolute; top: -12px; right: 24px; background: var(--accent); color: white; padding: 6px 16px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pricing-card h3 { font-size: 22px; margin-bottom: 8px; }
.pricing-icon { font-size: 32px; margin-bottom: 16px; }
.price { font-size: 36px; font-weight: 700; color: var(--accent); margin-bottom: 20px; }
.price-features { list-style: none; margin-bottom: 24px; }
.price-features li { padding: 8px 0; color: var(--text-secondary); position: relative; padding-left: 24px; }
.price-features li::before { content: '✓'; position: absolute; left: 0; color: var(--primary); font-weight: 700; }
.pricing-note { text-align: center; margin-top: 32px; font-size: 14px; color: var(--text-secondary); }

.reviews-slider { display: grid; gap: 24px; }
.review-card { background: var(--card-bg); padding: 28px; border-radius: var(--radius); box-shadow: 0 4px 12px var(--shadow); }
.review-text { font-size: 16px; line-height: 1.7; margin-bottom: 16px; color: var(--text); }
.review-author { font-weight: 600; color: var(--primary); }
.review-rating { color: var(--accent); margin-top: 8px; }

.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item { background: var(--card-bg); border-radius: var(--radius-sm); margin-bottom: 16px; box-shadow: 0 2px 8px var(--shadow); overflow: hidden; }
.faq-question { padding: 20px 24px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 600; transition: background var(--transition); list-style: none; }
.faq-question::-webkit-details-marker { display: none; }
.faq-question:hover { background: rgba(93,153,198,0.05); }
.faq-icon { font-size: 24px; color: var(--accent); transition: transform var(--transition); }
.faq-item[open] .faq-icon { transform: rotate(45deg); }
.faq-answer-content { padding: 0 24px 20px; color: var(--text-secondary); line-height: 1.7; }

/* =========================================
   СЕКЦИЯ СКАЧИВАНИЯ (демо-приложение)
   ========================================= */
.download {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
}

.download .section-title,
.download .section-subtitle {
    color: white;
}

.download-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    align-items: stretch;
}

.download-card {
    flex: 0 0 280px;
    width: 320px;
    height: 320px;
    background: rgba(255, 255, 255, 0.95);
    padding: 24px 20px;
    border-radius: var(--radius);
    text-align: center;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 12px var(--shadow);
    position: relative;
}

.download-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-hover);
}

/* Иконка поверх карточки */
.download-card .card-icon {
    font-size: 36px;
    margin-bottom: 4px;
    display: block;
}

.download-card h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: -10px;      /* подтягиваем QR-код вверх */
    margin-top: 4px;           /* небольшой отступ от иконки */
    color: var(--text);
}

.download-card img {
    width: 100px;
    height: 100px;
    margin: 4px auto;
    display: block;
    border-radius: 8px;
}

.download-card .btn {
    margin-top: auto;
    width: 100%;
    padding: 10px 16px;
    font-size: 16px;
    font-weight: 600;
}

.download-card .download-note {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.4;
}

.download-instruction {
    margin-top: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px var(--shadow);
    color: var(--text);
}

.download-instruction h3 {
    text-align: center;
    margin-bottom: 16px;
}

.download-instruction p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}

.download-instruction ol,
.download-instruction ul {
    padding-left: 24px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.download-instruction ol {
    list-style-type: decimal;
}

.download-instruction ul {
    list-style-type: disc;
}

.download-instruction li {
    margin-bottom: 6px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.download-instruction li ul {
    margin-top: 6px;
    padding-left: 20px;
}

.qr-placeholder {
    width: 150px;
    height: 150px;
    background: var(--border);
    margin: 20px auto;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* =========================================
   ФУТЕР
   ========================================= */
.landing-footer {
    background: var(--text);
    color: var(--bg);
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    gap: 32px;
    margin-bottom: 32px;
}

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--accent);
}

.footer-section p,
.footer-section a {
    color: var(--bg);
    text-decoration: none;
    line-height: 1.8;
    opacity: 0.9;
}

.footer-section a:hover {
    opacity: 1;
    color: var(--accent);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-bottom {
    border-top: 1px solid rgba(251, 252, 244, 0.2);
    padding-top: 20px;
    text-align: center;
    font-size: 14px;
    opacity: 0.7;
}

/* =========================================
   АДАПТИВНОСТЬ
   ========================================= */
@media (min-width: 768px) {
    .site-nav {
        display: block;
    }
    .mobile-menu-btn {
        display: none;
    }
    .hero h1 {
        font-size: 48px;
    }
    .hero-buttons {
        flex-direction: row;
        justify-content: center;
    }
    .problem-grid,
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .steps {
        grid-template-columns: repeat(3, 1fr);
    }
    .vets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pricing-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .reviews-slider {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
    .section-title {
        font-size: 40px;
    }
}

@media (min-width: 1024px) {
    .problem-grid,
    .advantages-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .vets-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .reviews-slider {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .nav-toggle:checked ~ .site-nav {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(251, 252, 244, 0.98);
        border-bottom: 1px solid var(--border);
        padding: 16px 20px;
    }
    .site-nav a {
        display: block;
        margin: 0 0 12px 0;
    }
}

h1:focus {
    outline: none;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition);
}

.back-link:hover {
    color: var(--accent);
}
