/* ================= GLOBAL & TYPOGRAPHY ================= */
:root {
    /* Официальные цвета Bund Online */
    --bund-black: #111111; /* Более глубокий черный для строгости */
    --bund-dark-blue: #003366; /* Официальный синий */
    --bund-red: #D60000;
    --bund-gold: #FFCC00;
    /* Фон изменен на более "бумажный", официальный, чистый */
    --bund-bg-paper: #fcfcfc; 
    --bund-border: #c0c0c0; /* Более строгий серый для границ */
    --bund-text: #222222;
    --bund-text-secondary: #555555;
    --bund-link: #004080;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arimo', Arial, sans-serif;
    background-color: var(--bund-bg-paper);
    /* Добавляем тонкую верхнюю линию, как на официальных бланках */
    border-top: 4px solid var(--bund-dark-blue);
    color: var(--bund-text);
    line-height: 1.6;
    font-size: 16px;
    /* Тонкая текстура "официальной бумаги" через микро-шум (опционально, но добавляет строгости) */
    background-image: linear-gradient(var(--bund-bg-paper), var(--bund-bg-paper));
    background-size: cover;
}

.container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%; /* Важно для мобилок */
}

a { text-decoration: none; color: var(--bund-link); }
a:hover { text-decoration: underline; }

/* Уменьшаем скругления везде для строгости */
.btn-bund, .btn-bund-small, .quiz-panel-bund, .secure-notification-panel, .amt-action-box, .amt-warning-box, .official-input-bund, .card-content-bund {
    border-radius: 2px !important; 
}

/* ================= BUND HEADER STRUKTUR ================= */
.bund-header-wrapper {
    background: #fff;
    border-bottom: 1px solid var(--bund-border);
}

/* Верхняя сервисная полоса */
.service-top-bar {
    background-color: #F4F4F4; /* Чуть светлее и строже */
    border-bottom: 1px solid #E0E0E0;
    font-size: 0.8rem;
    padding: 10px 0;
    color: var(--bund-text-secondary);
    text-transform: uppercase; /* Более официально */
    letter-spacing: 0.5px;
}

.service-bar-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap; /* Позволяет перенос на мобильных */
    gap: 10px;
}

.meta-nav span { margin-left: 15px; cursor: pointer; }

/* Основной хедер с орлом */
.main-bund-header {
    padding: 30px 0;
    background: #ffffff;
}

.header-grid {
    display: flex;
    align-items: center;
}

.bund-branding {
    display: flex;
    align-items: center;
    gap: 25px;
}

.bund-eagle {
    fill: var(--bund-black);
    min-width: 60px; /* Чтобы не сжимался на мобилках */
}

.bund-titles {
    display: flex;
    flex-direction: column;
}

.bund-subline {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    color: var(--bund-text-secondary);
    text-transform: uppercase;
}

.bund-headline {
    font-family: 'Arimo', sans-serif;
    font-weight: 700;
    font-size: 1.8rem; /* Чуть крупнее */
    color: var(--bund-black);
    line-height: 1.2;
    margin-top: 5px;
}

/* Полоса флага */
.bund-flag-stripe {
    height: 8px; /* Чуть толще для солидности */
    background: linear-gradient(to right, #000000 33.3%, #DD0000 33.3%, #DD0000 66.6%, #FFCE00 66.6%);
}

/* Хлебные крошки */
.breadcrumb-bar {
    background: #fff;
    border-bottom: 1px solid var(--bund-border);
    padding: 12px 0;
    font-size: 0.9rem;
    color: var(--bund-text-secondary);
    margin-bottom: 40px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); /* Легкая тень для отделения */
}

/* ================= MAIN LAYOUT ================= */
.main-layout {
    min-height: 60vh;
    margin-bottom: 80px;
}

/* ================= ЭКРАН 1: УВЕДОМЛЕНИЕ (AMT-STIL) ================= */
.secure-notification-panel {
    background: #fff;
    border: 2px solid var(--bund-border); /* Более толстая рамка */
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); /* Строгая тень */
}

.notification-header-bund {
    background: var(--bund-dark-blue); /* Синий заголовок - более официально */
    padding: 15px 25px;
    font-weight: 700;
    color: #fff; /* Белый текст на синем */
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: 'Roboto', sans-serif;
}

.amt-icon {
    font-family: 'Times New Roman', serif;
    font-size: 1.8rem;
    font-weight: 400;
    opacity: 0.8;
}

.notification-body-bund {
    padding: 40px;
    background-image: linear-gradient(#ffffff 2px, transparent 2px), linear-gradient(90deg, #ffffff 2px, transparent 2px), linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px);
    background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
    background-position: -2px -2px, -2px -2px, -1px -1px, -1px -1px;
    /* Тонкая "миллиметровка" на фоне для бюрократического эффекта */
}

.amt-title {
    font-family: 'Arimo', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--bund-black);
    margin-bottom: 25px;
    border-bottom: 3px solid var(--bund-dark-blue); /* Синее подчеркивание */
    padding-bottom: 15px;
}

.file-info {
    background: #F8F9FA; /* Очень светлый серый */
    padding: 20px;
    border-left: 5px solid var(--bund-dark-blue); /* Строгий синий акцент */
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    margin-bottom: 30px;
    color: var(--bund-black);
    border: 1px solid var(--bund-border);
    border-left-width: 5px;
}

.amt-text {
    margin-bottom: 20px;
    text-align: justify;
    font-size: 1.05rem;
}

/* Action Box в стиле гос. портала */
.amt-action-box {
    background: #E8F0F8; /* Светло-синий фон */
    border: 1px solid #B0C4DE;
    padding: 30px;
    margin: 40px 0;
    text-align: center;
}

.btn-bund {
    background: var(--bund-dark-blue);
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-bund:hover { background: #002244; box-shadow: 0 4px 8px rgba(0,0,0,0.2); }

.amt-footer-text {
    font-size: 0.9rem;
    color: var(--bund-text-secondary);
    border-top: 2px solid #eee;
    padding-top: 25px;
    margin-top: 50px;
}

/* ================= ЭКРАН 2: КВИЗ (SPLIT VIEW) ================= */
.main-content-split {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.content-left-bund { flex: 0.8; }
.content-right-bund { flex: 1.2; }

.amt-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--bund-dark-blue);
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.amt-h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--bund-black);
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.amt-text-small { font-size: 1rem; color: #333; margin-bottom: 25px; }

.amt-warning-box {
    border: 3px solid var(--bund-red);
    background: #FFF0F0;
    padding: 20px;
    font-size: 1rem;
    margin-bottom: 30px;
    color: #8B0000;
}

.amt-list { list-style: square; padding-left: 25px; color: var(--bund-black); }
.amt-list li { margin-bottom: 15px; font-weight: 500; }

/* Квиз в стиле бланка (Formular) */
.quiz-panel-bund {
    background: #fff;
    border: 2px solid var(--bund-border);
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    position: relative;
}
/* Добавляем эффект "подшивки" сверху */
.quiz-panel-bund::before {
    content: '';
    position: absolute;
    top: -10px; left: 20px; right: 20px;
    height: 10px;
    background: #e0e0e0;
    border: 1px solid #ccc;
    border-bottom: none;
    z-index: -1;
}

.formular-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 3px solid var(--bund-black);
    padding-bottom: 20px;
}

.formular-nummer {
    font-family: 'Courier Prime', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: var(--bund-black);
    background: #F0F0F0;
    padding: 8px 12px;
    border: 2px solid var(--bund-black);
    letter-spacing: 1px;
}

.css-barcode {
    height: 40px;
    width: 150px;
    background: repeating-linear-gradient(to right, #000 0, #000 2px, transparent 2px, transparent 4px, #000 4px, #000 6px, transparent 6px, transparent 9px);
}

.quiz-header-bund { margin-bottom: 35px; }

.step-indicator-bund {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--bund-dark-blue);
    display: block;
    margin-bottom: 10px;
}

.progress-track-bund {
    height: 10px;
    background: #E0E0E0;
    border: 1px solid #ccc;
}

.progress-fill-bund {
    height: 100%;
    background: var(--bund-dark-blue);
    transition: width 0.3s ease-in-out;
}

.quiz-step { display: none; }
.quiz-step.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from {opacity:0; transform: translateY(5px);} to {opacity:1; transform: translateY(0);} }

.form-h2 {
    font-size: 1.4rem;
    font-weight: 700;
    border-bottom: 2px solid #ccc;
    padding-bottom: 15px;
    margin-bottom: 25px;
    color: var(--bund-black);
    background: #F9F9F9;
    padding: 15px;
    border-left: 4px solid var(--bund-dark-blue);
}

/* Радио-кнопки в стиле бланка */
.radio-grid-bund { display: flex; flex-direction: column; gap: -2px; }

.card-content-bund {
    display: flex;
    align-items: center; /* Центрирует точку и текст по вертикали */
    padding: 16px 20px;
    border: 2px solid var(--bund-border);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-height: 64px; /* Чтобы карточки не прыгали по высоте */
}

/* Создаем основу круга (вместо бага-квадрата) */
.card-content-bund::before {
    content: '';
    display: block;
    flex-shrink: 0; /* Запрещаем сжиматься при длинном тексте */
    width: 22px;
    height: 22px;
    border: 2px solid #999;
    border-radius: 50%; /* Строго круг */
    margin-right: 16px;
    background: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.radio-card-bund:hover .card-content-bund {
    border-color: var(--bund-dark-blue);
    background-color: #fcfcfc;
}
.radio-card-bund input:checked + .card-content-bund {
    border-color: var(--bund-dark-blue);
    background-color: #E8F0F8;
    z-index: 1;
}
.radio-card-bund input:checked + .card-content-bund::before {
    border-color: var(--bund-dark-blue);
    background-color: var(--bund-dark-blue);
    /* Создаем белую точку внутри через inset тень - это надежнее всего */
    box-shadow: inset 0 0 0 4px #fff; 
}

.radio-card-bund input { display: none; }
.card-content-bund strong {
    color: var(--bund-black);
    margin-left: 4px;
}

/* Поля ввода - строгие */
.form-row-bund {
    display: flex;
    gap: 20px;
    margin-bottom: 20px; /* Отступ между рядами */
}
.form-col {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.input-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px; /* Расстояние от заголовка до поля */
    color: var(--bund-black);
    line-height: 1.2;
}

.official-input-bund {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--bund-border);
    font-size: 1rem;
    margin-bottom: 5px; /* Защита от налезания на следующий элемент */
}

.official-input-bund:focus {
    outline: none;
    border-color: var(--bund-dark-blue);
    background: #fff;
}

.micro-trust-text {
    display: block;
    font-size: 0.85rem;
    color: #444;
    margin-top: -15px;
    margin-bottom: 25px;
    font-style: italic;
    border-left: 3px solid #ccc;
    padding-left: 10px;
}

.legal-consent-bund {
    background: #F4F4F4;
    border: 2px solid var(--bund-border);
    padding: 20px;
    font-size: 0.9rem;
    margin-bottom: 30px;
    color: #333;
}

.checkbox-label-bund { display: flex; gap: 15px; cursor: pointer; align-items: flex-start; }
.checkbox-label-bund input { margin-top: 4px; transform: scale(1.2); }
.checkbox-label-bund a { text-decoration: underline; font-weight: bold; }

.btn-bund-submit {
    width: 100%;
    padding: 18px;
    background: var(--bund-red); /* Красная кнопка для финального действия - триггер */
    color: #fff;
    border: none;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.btn-bund-submit:hover { background: #B00000; }
.btn-bund-submit:disabled { background: #999; cursor: not-allowed; }

/* Терминал - более "серверный" вид */
.terminal-box {
    background: #1a1a1a; /* Темно-серый, не черный */
    color: #4afc4a; /* Старый мониторный зеленый */
    font-family: 'Courier Prime', monospace;
    padding: 20px;
    text-align: left;
    margin-top: 25px;
    border: 3px solid #333;
    min-height: 180px;
    font-size: 0.9rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

/* Экран успеха */
.file-info-result {
    background: #F4FBF7;
    border: 3px solid var(--bund-dark-blue);
    padding: 30px;
    margin: 30px 0;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.file-info-result p { font-size: 1.1rem; font-weight: bold; color: var(--bund-dark-blue); }

.file-info-result strong {
    font-size: 3rem;
    color: #000;
    display: block;
    margin: 15px 0;
    font-family: 'Roboto', sans-serif;
}

.az-sub {
    font-size: 1rem !important;
    color: #555 !important;
    font-family: 'Courier Prime', monospace;
    background: #fff;
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid #ccc;
}

.success-icon-bund {
    font-size: 4rem;
    color: var(--bund-dark-blue);
    text-align: center;
    margin-bottom: 20px;
}

/* ================= FOOTER ================= */
.bund-footer {
    background: #222;
    color: #fff;
    padding: 50px 0 30px;
    font-size: 0.95rem;
    border-top: 4px solid var(--bund-dark-blue);
}

.footer-grid {
    display: flex;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col strong { margin-bottom: 10px; text-transform: uppercase; font-size: 0.9rem; color: var(--bund-gold); letter-spacing: 1px; }
.bund-footer a { color: #ccc; text-decoration: none; transition: color 0.2s; }
.bund-footer a:hover { color: #fff; text-decoration: underline; }

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 25px;
    text-align: center;
    font-size: 0.85rem;
    color: #999;
}

/* ================= COOKIE & MODAL ================= */
.cookie-banner-bund {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: #F4F4F4; border-top: 3px solid var(--bund-dark-blue);
    padding: 20px 0; z-index: 9999; box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
}
.cookie-content-bund { display: flex; justify-content: space-between; align-items: center; gap: 30px; }
.cookie-text { font-size: 0.9rem; color: #333; flex: 1; }
.cookie-text a { text-decoration: underline; font-weight: bold; }
.btn-bund-small {
    background: var(--bund-dark-blue); color: #fff; border: none;
    padding: 12px 20px; font-weight: 700; cursor: pointer;white-space: nowrap;
}

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
}
.modal-box {
    background: #fff; width: 90%; max-width: 500px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 4px solid var(--bund-red);
}
.modal-body { padding: 40px 30px; text-align: center; }
.modal-body h3 { color: var(--bund-red); font-size: 1.8rem; margin-bottom: 15px; font-weight: 700;}
.warning-icon { font-size: 3rem; display: block; margin-bottom: 10px; }
.btn-secondary { background: #ccc; color: #333; margin-top: 15px; }

/* ==========================================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ (RESPONSIVE DESIGN)
   ========================================================================== */

/* Планшеты и узкие десктопы */
@media (max-width: 992px) {
    .main-content-split {
        gap: 30px;
    }
    .bund-headline { font-size: 1.5rem; }
}

/* Мобильные устройства (Смартфоны) */
@media (max-width: 768px) {
    /* Глобальные отступы */
    .container { padding: 0 15px; }
    .main-layout { margin-bottom: 40px; }

    /* Хедер */
    .service-bar-content { flex-direction: column; gap: 5px; text-align: center; }
    .meta-nav { justify-content: center; display: flex; gap: 10px; }
    
    .main-bund-header { padding: 20px 0; }
    .header-grid { flex-direction: column; text-align: center; }
    .bund-branding { flex-direction: column; gap: 15px; }
    .bund-eagle { width: 50px; height: auto; }
    .bund-headline { font-size: 1.4rem; }
    .bund-subline { font-size: 0.9rem; }

    /* Хлебные крошки */
    .breadcrumb-bar { font-size: 0.8rem; white-space: nowrap; overflow-x: auto; }

    /* Экран 1: Уведомление */
    .notification-body-bund { padding: 25px 20px; }
    .amt-title { font-size: 1.6rem; }
    .amt-action-box { padding: 20px; margin: 25px 0; }
    .btn-bund { width: 100%; padding: 15px; font-size: 1rem; }

    /* Экран 2: Квиз (Главная раскладка) */
    .main-content-split {
        flex-direction: column; /* Колонки встают друг под друга */
        gap: 40px;
    }
    .content-left-bund, .content-right-bund { flex: auto; max-width: 100%; }

    /* Квиз панель */
    .quiz-panel-bund { padding: 25px 20px; }
    .formular-meta { flex-direction: column; gap: 15px; align-items: flex-start; }
    .form-h2 { font-size: 1.25rem; }

    /* Формы и поля ввода */
    .form-row-bund {
        flex-direction: column; /* Поля в ряд становятся в колонку */
        gap: 15px;
    }
    .form-col { width: 100%; flex: auto !important; }
    .official-input-bund { font-size: 1rem; padding: 12px; }
    
    .card-content-bund { padding: 15px; font-size: 1rem; }
    .btn-bund-submit { font-size: 1.1rem; padding: 15px; }

    /* Результат и Терминал */
    .file-info-result strong { font-size: 2.2rem; }
    .success-icon-bund { font-size: 3rem; }
    .terminal-box { font-size: 0.8rem; min-height: 150px; }

    /* Футер */
    .bund-footer { padding: 30px 0; }
    .footer-grid { flex-direction: column; gap: 30px; text-align: center; }
    .footer-bottom { font-size: 0.75rem; }

    /* Cookie & Modals */
    .cookie-content-bund { flex-direction: column; gap: 15px; text-align: center; }
    .btn-bund-small { width: 100%; }
    .modal-box { width: 95%; }
    .modal-body { padding: 30px 20px; }
}

/* Очень маленькие экраны (iPhone SE и т.д.) */
@media (max-width: 380px) {
    .bund-headline { font-size: 1.2rem; }
    .amt-title { font-size: 1.4rem; }
    .file-info-result strong { font-size: 1.8rem; }
}
@media (max-width: 768px) {
    .card-content-bund {
        padding: 14px 16px;
        font-size: 0.95rem;
    }
}
@media (max-width: 600px) {
    .form-row-bund {
        flex-direction: column;
        gap: 0;
    }
}