/* Основные стили */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Times New Roman", Times, serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    font-size: 14pt;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #333;
    padding-bottom: 20px;
}

.header h1 {
    font-size: 18pt;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.header p {
    font-size: 12pt;
    margin-bottom: 5px;
}

.instructions {
    font-style: italic;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f9f9f9;
    border-left: 3px solid #666;
}

.question-group {
    margin-bottom: 30px;
    page-break-inside: avoid;
}

.question {
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 14pt;
}

.subquestion {
    margin-left: 20px;
    margin-bottom: 10px;
}

.options {
    margin-left: 20px;
}

.option {
    margin-bottom: 5px;
    display: flex;
    align-items: flex-start;
    position: relative;
}

.option input[type="radio"],
.option input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 3px;
    transform: scale(1.2);
    cursor: pointer;
}

.option label {
    flex: 1;
    cursor: pointer;
}

.other-input {
    margin-left: 10px;
    margin-top: 5px;
    padding: 5px;
    width: 300px;
    border: 1px solid #ccc;
    font-size: 12pt;
    display: none; /* Скрываем по умолчанию */
}

.other-input.visible {
    display: inline-block; /* Показываем при активации */
}

.text-input {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ccc;
    font-size: 12pt;
}

.text-input-small {
    width: 200px;
    padding: 5px;
    margin-left: 10px;
    border: 1px solid #ccc;
    font-size: 12pt;
}

.year-input {
    width: 100px;
    padding: 5px;
    border: 1px solid #ccc;
    font-size: 12pt;
    text-align: center;
}

.required {
    color: red;
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.form-section:last-child {
    border-bottom: none;
}

.submit-btn {
    display: block;
    width: 200px;
    margin: 40px auto;
    padding: 15px;
    background-color: #0066cc;
    color: white;
    border: none;
    font-size: 14pt;
    cursor: pointer;
    text-align: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.submit-btn:hover {
    background-color: #0055aa;
}

.submit-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.messages {
    margin-bottom: 20px;
}

.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.staff-section {
    background-color: #f0f8ff;
    padding: 15px;
    margin-bottom: 30px;
    border: 1px dashed #0066cc;
    border-radius: 5px;
}

.staff-section h3 {
    color: #0066cc;
    margin-bottom: 10px;
}

.staff-field {
    margin-bottom: 10px;
}

.staff-field label {
    display: inline-block;
    width: 250px;
    font-weight: bold;
}

/* Стили для таблицы вопроса 5 */
.q5-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 12pt;
}

.q5-table th {
    text-align: left;
    padding: 8px;
    border-bottom: 2px solid #ccc;
    background-color: #f8f9fa;
}

.q5-table td {
    padding: 8px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.q5-table tr:hover {
    background-color: #f5f5f5;
}

/* Индикатор прогресса */
.progress-container {
    margin: 20px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.progress-bar {
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background-color: #28a745;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 5px;
}

/* Анимация загрузки */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0066cc;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Стили для печати */
@media print {
    .staff-section,
    .submit-btn,
    .messages,
    .progress-container {
        display: none;
    }

    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        padding: 0;
    }

    .form-section {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .other-input {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
    }

    .text-input-small {
        width: 100%;
        margin-left: 0;
        margin-top: 5px;
    }

    .q5-table {
        font-size: 10pt;
    }

    .q5-table th,
    .q5-table td {
        padding: 4px;
    }
}

/* Стили для полей с ошибками */
.error {
    border-color: #dc3545 !important;
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.error-message.visible {
    display: block;
}

/* Стили для заголовка с кнопкой Dashboard */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #4a5568;
    position: relative;
}

.header-content {
    flex: 1;
}

.dashboard-btn-header {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    white-space: nowrap;
    margin-left: 20px;
}

.dashboard-btn-header:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    color: white;
    text-decoration: none;
}

.dashboard-btn-header:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.dashboard-btn-header::before {
    content: "📊";
    margin-right: 8px;
    font-size: 16px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .dashboard-btn-header {
        margin-left: 0;
        align-self: flex-start;
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Вариант 2: Inline-block стили */
.options-inline {
    margin-top: 10px;
    /* display: inline; */
}

.option-inline {
    display: inline;
    margin-right: 30px;
}

.option-inline label{
    font-weight: 400;
}

.option-inline:last-child {
    margin-right: 0;
}