/* 
 * Стили для анкет ОСББ
 * Файл: form/survey-styles.css
 */

/* Подключение шрифтов */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Основные переменные */
:root {
    --primary-color: #025b79;
    --primary-light: #0a7ba3;
    --secondary-color: #f8f9fa;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-gray: #e0e0e0;
    --dark-gray: #333;
    --white: #ffffff;
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Сброс стилей */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--white);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    color: var(--dark-gray);
}

/* Контейнер анкеты */
.survey-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 12px;
    border: 1px solid #e1e5e9;
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
}

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

/* Заголовок анкеты */
.survey-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 40px 30px;
    text-align: center;
    position: relative;
}

.survey-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
}

.survey-header p {
    font-size: 16px;
    opacity: 0.95;
    font-weight: 400;
}

/* Основная форма */
.survey-form {
    padding: 40px;
}

/* Ссылка возврата */
.back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 25px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    background: #f0f8ff;
    transition: var(--transition);
    border: 1px solid rgba(2, 91, 121, 0.2);
}

.back-link:hover {
    background: #e6f3ff;
    border-color: rgba(2, 91, 121, 0.3);
    transform: translateX(-3px);
}

.back-link::before {
    content: '←';
    margin-right: 8px;
    font-size: 18px;
}

/* Прогресс бар */
.progress-container {
    margin-bottom: 30px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--dark-gray);
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid #e0e0e0;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 10px;
    transition: width 0.4s ease;
    width: 0%;
    position: relative;
}

/* Блоки вопросов */
.question-block {
    margin-bottom: 40px;
    padding: 30px;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid #e1e5e9;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.question-block:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.question-block h3 {
    color: var(--primary-color);
    font-size: 20px;
    margin-bottom: 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.question-block h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary-color);
    margin-right: 12px;
    border-radius: 2px;
}

/* Отдельные вопросы */
.question {
    margin-bottom: 25px;
    padding: 20px;
    background: #fafbfc;
    border-radius: var(--border-radius);
    border: 1px solid #e8ecf0;
    transition: var(--transition);
}

.question:hover {
    border-color: rgba(2, 91, 121, 0.2);
    background: #f5f8fb;
}

.question-number {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
    display: inline-block;
    background: #e6f3ff;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(2, 91, 121, 0.2);
}

.question-text {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
    color: var(--dark-gray);
    font-weight: 500;
}

/* Опции ответов */
.options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--white);
    border: 2px solid #e1e5e9;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    min-width: 130px;
    user-select: none;
    position: relative;
}

.option:hover {
    border-color: var(--primary-color);
    background: #f0f8ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(2, 91, 121, 0.1);
}

.option.selected {
    border-color: var(--primary-color);
    background: #e6f3ff;
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(2, 91, 121, 0.15);
}

.option.selected::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: var(--success-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.option input[type="radio"] {
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.option label {
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

/* Сообщения */
.message {
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 25px;
    text-align: center;
    font-weight: 500;
    animation: slideDown 0.4s ease-out;
    border: 1px solid;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message {
    background: #f8fff9;
    color: #2d5a2d;
    border-color: #c8e6c9;
}

.error-message {
    background: #fff8f8;
    color: #721c24;
    border-color: #f5c6cb;
}

.message h4 {
    margin-bottom: 10px;
    font-size: 18px;
}

.message p {
    margin-bottom: 5px;
}

/* Кнопка отправки */
.submit-btn {
    background: var(--primary-color);
    color: var(--white);
    border: 2px solid var(--primary-color);
    padding: 18px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 91, 121, 0.2);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #f5f5f5;
    color: #999;
    border-color: #ddd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Спиннер загрузки */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Утилитарные классы */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

/* Адаптивность */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .survey-container {
        margin: 0;
        border-radius: 8px;
    }
    
    .survey-header {
        padding: 30px 20px;
    }
    
    .survey-header h1 {
        font-size: 24px;
    }
    
    .survey-form {
        padding: 25px 20px;
    }
    
    .question-block {
        padding: 20px;
        margin-bottom: 25px;
    }
    
    .question {
        padding: 15px;
    }
    
    .options {
        flex-direction: column;
    }
    
    .option {
        width: 100%;
        justify-content: flex-start;
    }
    
    .submit-btn {
        padding: 15px 30px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .survey-header h1 {
        font-size: 20px;
    }
    
    .survey-header p {
        font-size: 14px;
    }
    
    .question-block h3 {
        font-size: 18px;
    }
    
    .question-text {
        font-size: 15px;
    }
    
    .option {
        padding: 10px 15px;
        min-width: auto;
    }
    
    .option label {
        font-size: 13px;
    }
}

/* Анимации для улучшения UX */
.question-block,
.question,
.option {
    animation: fadeInUp 0.4s ease-out;
    animation-fill-mode: both;
}

.question-block:nth-child(1) { animation-delay: 0.1s; }
.question-block:nth-child(2) { animation-delay: 0.2s; }
.question-block:nth-child(3) { animation-delay: 0.3s; }
.question-block:nth-child(4) { animation-delay: 0.4s; }
.question-block:nth-child(5) { animation-delay: 0.5s; }