:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header - ОБНОВЛЕНО */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a252f 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.logo-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 50%;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.school-name {
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
    color: white;
}

.school-subtitle {
    font-size: 0.8rem;
    color: var(--light-color);
    opacity: 0.9;
    margin-top: 2px;
}

/* Навигация - ОБНОВЛЕНО */
nav {
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.nav-menu li {
    margin: 0;
}

.nav-menu li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.8rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    display: block;
    white-space: nowrap;
    font-size: 0.95rem;
    position: relative;
    border: 1px solid transparent;
}

.nav-menu li a:hover {
    background: rgba(255,255,255,0.1);
    color: var(--light-color);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.nav-menu li a.active {
    background: rgb(195 195 195 / 30%);;
    color: white;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.nav-menu li a.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background: white;
    border-radius: 2px;
}

/* Кнопка меню для мобильных - ОБНОВЛЕНО */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: white;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.nav-toggle:hover span {
    background: var(--secondary-color);
}

/* Hero секция */
.hero {
    background: 
        linear-gradient(rgba(44, 62, 80, 0.3), rgba(44, 62, 80, 0.3)),
        url('/static/images/hero-bg.jpg') center/cover no-repeat;
    color: white;
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 20px;
    margin-top: -20px;
    position: relative;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Логотип в hero */
.hero-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.hero-logo img {
    width: 200%;
    object-fit: contain;
}

/* Кнопки - КОНТРАСТНЫЕ И ВИДИМЫЕ */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white !important;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
    cursor: pointer;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background-color: #1a252f;
    border-color: #1a252f;
    color: white !important;
    text-decoration: none;
}

.btn:active {
    transform: translateY(0);
}

.btn-accent {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-accent:hover {
    background-color: #a93226;
    border-color: #a93226;
}

/* Кнопки в hero блоке */
.hero .btn {
    background-color: white;
    color: var(--primary-color) !important;
    border: 2px solid white;
}

.hero .btn:hover {
    background-color: transparent;
    color: white !important;
    border: 2px solid white;
}

/* Кнопки на главной странице в карточках */
.feature-card .btn {
    background-color: var(--primary-color);
    color: white !important;
    border: 2px solid var(--primary-color);
}

.feature-card .btn:hover {
    background-color: #1a252f;
    border-color: #1a252f;
    color: white !important;
}

/* Кнопки для скачивания документов */
.document-card .btn {
    background-color: var(--primary-color);
    color: white !important;
    border: 2px solid var(--primary-color);
}

.document-card .btn:hover {
    background-color: #1a252f;
    border-color: #1a252f;
    color: white !important;
}

/* Кнопка админки */
.btn-admin {
    background: var(--warning-color) !important;
    color: white !important;
    padding: 0.5rem 1rem !important;
    border-radius: 4px !important;
    text-decoration: none;
    border: 2px solid var(--warning-color);
    cursor: pointer;
}

.btn-admin:hover {
    background: #e67e22 !important;
    border-color: #e67e22;
    color: white !important;
}

/* Кнопки в модальном окне - ИСПРАВЛЕНО */
.modal-footer .btn {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.modal-footer .btn:hover {
    background-color: #1a252f !important;
    border-color: #1a252f !important;
    color: white !important;
}

.modal-footer .btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}

.modal-footer .btn-secondary:hover {
    background-color: #5a6268 !important;
    border-color: #5a6268 !important;
    color: white !important;
}

/* Контурные кнопки */
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color) !important;
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white !important;
}

/* Основной контент */
main {
    flex: 1;
    padding: 2rem 0;
}

.section {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.section.active {
    display: block;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 1rem;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--secondary-color);
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    border: 1px solid #e9ecef;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Forms */
.form-container {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #e9ecef;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

input, textarea, select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
    border: 1px solid #ced4da;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* Cards - ИСПРАВЛЕННЫЕ СТИЛИ ДЛЯ СЕТКИ */
.documents-grid {
    display: grid;
    gap: 25px;
    margin: 30px 0;
}

/* По умолчанию - 3 колонки */
.documents-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

/* Для 1-2 карточек - центрируем и делаем уже */
.documents-grid.single-row {
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
}

/* Для 3+ карточек - стандартная сетка */
.documents-grid.multi-row {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.document-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    border-left: 4px solid var(--secondary-color);
    display: flex;
    flex-direction: column;
    height: auto;
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* Стили для PDF iframe в карточках */
.card-preview-pdf-iframe {
    height: 400px; /* Высота для PDF */
    position: relative;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

.card-preview-pdf-iframe iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.card-preview-container {
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* Для одной карточки - делаем PDF уже */
.documents-grid.single-row .card-preview-pdf-iframe {
    max-width: 600px; /* Уже для одной карточки */
    margin: 0 auto;
}

/* Для изображений - автоматическая высота */
.card-preview-image {
    height: auto;
    min-height: 200px;
    max-height: 300px;
    position: relative;
}

.card-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Чтобы изображение полностью помещалось */
    transition: transform 0.3s ease;
}

.card-preview-image:hover img {
    transform: scale(1.05);
}

.file-preview {
    width: 100%;
    height: auto;
    min-height: 200px;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 15px;
}

.no-image {
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-bottom: 15px;
    color: #6c757d;
    font-size: 200%;
    position: relative;
    cursor: pointer;
}

.no-image:hover .preview-overlay {
    opacity: 1;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
}

.preview-overlay span {
    font-size: 0.7rem;
    text-align: center;
    padding: 0.5rem;
}

/* Заголовок и описание - без ограничений */
.document-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2em;
    line-height: 1.3;
}

.document-card p {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.5;
    flex: 1;
}

/* Стили для превью других типов файлов */
.card-preview-pdf,
.card-preview-text,
.card-preview-document,
.card-preview-other,
.card-preview-error {
    height: 200px; /* Стандартная высота для не-PDF превью */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    text-align: center;
    position: relative;
}

.preview-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.preview-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.preview-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.preview-subtitle {
    font-size: 0.75rem;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    opacity: 0.9;
}

.preview-hint {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.8);
    margin-top: 2px;
    font-style: italic;
}

/* Цвета для разных типов файлов */
.card-preview-pdf {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.card-preview-pdf .preview-title,
.card-preview-pdf .preview-subtitle {
    color: white;
}

.card-preview-text {
    background: linear-gradient(135deg, #51cf66, #40c057);
    color: white;
}

.card-preview-text .preview-title,
.card-preview-text .preview-subtitle {
    color: white;
}

.card-preview-document {
    background: linear-gradient(135deg, #339af0, #228be6);
    color: white;
}

.card-preview-document .preview-title,
.card-preview-document .preview-subtitle {
    color: white;
}

.card-preview-other {
    background: linear-gradient(135deg, #adb5bd, #868e96);
    color: white;
}

.card-preview-other .preview-title,
.card-preview-other .preview-subtitle {
    color: white;
}

.card-preview-error {
    background: #f8f9fa;
    color: #6c757d;
}

.loading-preview {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #6c757d;
}

.loading-spinner-small {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--secondary-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-bottom: 0.5rem;
}

/* Улучшаем кнопки действий */
.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    justify-content: center;
    flex-shrink: 0;
    padding-top: 15px;
}

.btn-preview {
    background-color: var(--secondary-color);
    color: white !important;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
    flex: 1;
    cursor: pointer;
    text-align: center;
}

.btn-preview:hover {
    background-color: #2980b9;
    color: white !important;
}

.btn-download {
    background-color: var(--primary-color);
    color: white !important;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
    flex: 1;
    text-align: center;
}

.btn-download:hover {
    background-color: #1a252f;
    color: white !important;
}

/* Конструктор с сайдбаром */
.constructor-container {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    align-items: flex-start;
}

.constructor-sidebar {
    flex: 0 0 350px;
    position: relative;
}

.sticky-sidebar {
    position: sticky;
    top: 100px;
    max-height: none;
    overflow-y: visible;
}

/* Аккордеон */
.accordion {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.accordion-item {
    border-bottom: 1px solid #dee2e6;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    margin: 0;
}

.accordion-button {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
    background-color: #f8f9fa;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.accordion-button:hover {
    background-color: #e9ecef;
    color: var(--primary-color);
}

.accordion-button:not(.collapsed) {
    background-color: var(--secondary-color);
    color: white;
    box-shadow: none;
}

.accordion-button::after {
    content: "▼";
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.accordion-button:not(.collapsed)::after {
    transform: rotate(180deg);
}

.accordion-body {
    padding: 1.25rem;
    background: white;
    max-height: none;
    overflow: visible;
}

.formatting-image {
    margin: 1rem 0;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.formatting-image img {
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 100%;
    height: auto;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 2rem;
    color: var(--secondary-color);
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
    display: none;
    border: 1px solid #c3e6cb;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 20px;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Стили для модального окна - ИСПРАВЛЕНО И УМЕНЬШЕНО */
.modal-dialog {
    max-width: 500px !important; /* Уменьшено с 600px */
    margin: 1.75rem auto;
}

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    font-size: 0.9rem; /* Уменьшен текст */
}

.modal-header {
    padding: 1rem 1.25rem; /* Уменьшены отступы */
    border-bottom: 1px solid #dee2e6;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a252f 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-title {
    font-size: 1.1rem; /* Уменьшен заголовок */
    font-weight: 600;
}

.modal-body {
    padding: 1.25rem; /* Уменьшены отступы */
    max-height: 60vh; /* Ограничение высоты */
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.25rem; /* Уменьшены отступы */
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Кнопки в модальном окне - ИСПРАВЛЕН ЦВЕТ */
.modal-footer .btn {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.9rem !important;
    min-width: 80px;
}

.modal-footer .btn:hover {
    background-color: #1a252f !important;
    border-color: #1a252f !important;
    color: white !important;
}

.modal-footer .btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

.modal-footer .btn-secondary:hover {
    background-color: #5a6268 !important;
    border-color: #5a6268 !important;
}

.list-group-item {
    border-left: none;
    border-right: none;
    padding: 0.5rem 0.5rem;
    font-size: 0.9rem; /* Уменьшен текст */
}

#generateDocumentBtn {
    background-color: var(--primary-color) !important;
    color: white !important;
    border: none;
    padding: 0.8rem 1.5rem; /* Уменьшены отступы */
    font-size: 1rem; /* Уменьшен шрифт */
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1.5rem; /* Уменьшен отступ */
}

#generateDocumentBtn:hover {
    background-color: #1a252f !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

#generateDocumentBtn:active {
    transform: translateY(0);
}

/* Адаптивность - ОБНОВЛЕНО ДЛЯ НАВБАРА */
@media (max-width: 1024px) {
    .constructor-container {
        flex-direction: column;
    }
    
    .constructor-sidebar {
        flex: none;
        width: 100%;
        margin-bottom: 2rem;
    }
    
    .sticky-sidebar {
        position: static;
        max-height: none;
    }
    
    .documents-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .documents-grid.single-row {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
    
    .card-preview-pdf-iframe {
        height: 350px;
    }
    
    .nav-menu li a {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
    
    .school-name {
        font-size: 1rem;
    }
    
    .school-subtitle {
        font-size: 0.75rem;
    }
    
    /* Адаптивность для модального окна */
    .modal-dialog {
        max-width: 95% !important;
        margin: 1rem auto;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background: linear-gradient(135deg, var(--primary-color) 0%, #1a252f 100%);
        flex-direction: column;
        width: 280px;
        border-radius: 8px;
        box-shadow: 0 8px 25px rgba(0,0,0,0.2);
        z-index: 1000;
        padding: 1rem 0;
        border: 1px solid rgba(255,255,255,0.1);
        gap: 0;
    }
    
    .nav-menu.show {
        display: flex;
    }
    
    .nav-menu li {
        margin: 0;
        width: 100%;
    }
    
    .nav-menu li a {
        display: block;
        padding: 0.9rem 1.5rem;
        border-radius: 0;
        text-align: left;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        font-size: 0.95rem;
    }
    
    .nav-menu li:last-child a {
        border-bottom: none;
    }
    
    .nav-menu li a.active::after {
        display: none;
    }
    
    .logo-text {
        display: none;
    }
    
    .logo-icon {
        width: 45px;
        height: 45px;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .documents-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .documents-grid.single-row {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
    
    .form-container {
        padding: 1rem;
    }
    
    .btn {
        padding: 10px 25px;
        font-size: 14px;
    }
    
    .hero {
        margin-bottom: 40px;
        padding: 3rem 0;
    }
    
    .card-preview-pdf-iframe {
        height: 300px;
    }
    
    .document-card {
        padding: 20px;
    }
    
    .preview-icon {
        font-size: 2rem;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .documents-grid.single-row .card-preview-pdf-iframe {
        max-width: 100%;
    }
    
    /* Адаптивность для модального окна */
    .modal-body {
        padding: 1rem;
        max-height: 50vh;
    }
    
    .modal-header,
    .modal-footer {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .feature-card {
        padding: 1rem;
    }
    
    .nav-menu {
        width: 250px;
    }
    
    .document-card {
        padding: 15px;
    }
    
    .documents-grid {
        gap: 15px;
    }
    
    .document-card h3 {
        font-size: 1.1em;
    }
    
    .card-preview-pdf-iframe {
        height: 250px;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
    }
    
    .logo-icon img {
        width: 28px;
        height: 28px;
    }
    
    /* Адаптивность для модального окна */
    .modal-dialog {
        margin: 0.5rem auto;
    }
    
    .modal-content {
        border-radius: 8px;
    }
    
    .modal-footer .btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.8rem !important;
    }
}

/* Анимация для кнопки меню - ДОБАВЛЕНО */
.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Остальные стили (подсказки, модальные окна и т.д.) */
.field-hint-icon {
    display: inline-block;
    margin-left: 5px;
    cursor: help;
    position: relative;
    font-size: 14px;
}

.field-hint-icon:hover::after {
    content: attr(data-hint);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    white-space: normal;
    width: 300px;
    max-width: 90vw;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    text-align: left;
    font-weight: normal;
}

.field-hint-icon:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% - 5px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--primary-color);
    z-index: 1001;
}

/* Альтернативный вариант подсказок (слева) */
.field-hint-icon.left-hint:hover::after {
    left: 0;
    transform: none;
    bottom: 100%;
    margin-bottom: 10px;
}

.field-hint-icon.left-hint:hover::before {
    left: 10px;
    transform: none;
    bottom: calc(100% - 5px);
}

/* Для мобильных устройств */
@media (max-width: 768px) {
    .field-hint-icon:hover::after {
        width: 280px;
        left: 0;
        transform: none;
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .field-hint-icon:hover::before {
        left: 10px;
        transform: none;
    }
}

/* Анимация появления подсказки */
.field-hint-icon:hover::after {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Улучшение формы с подсказками */
.form-group label {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

/* Дополнительные стили для лучшего отображения */
.form-group {
    position: relative;
}

/* Чтобы подсказки не перекрывали другие элементы */
.form-container {
    position: relative;
    z-index: 1;
}

/* Стили для аккордеона с подсказками */
.accordion-body strong {
    color: var(--primary-color);
}

.accordion-body code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    font-family: 'Courier New', monospace;
    color: var(--accent-color);
}

.accordion-body ol, 
.accordion-body ul {
    margin: 15px 0;
    padding-left: 20px;
}

.accordion-body li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.formatting-image {
    margin: 15px 0;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.formatting-image img {
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 100%;
    height: auto;
}

