/* =============================================
   МОДАЛЬНОЕ ОКНО РЕГИСТРАЦИИ + КНОПКИ ХЕДЕРА
   Файл: assets/css/modal-reg.css
   ============================================= */

/* --- Кнопки в хедере --- */
.btn-login-conainer {
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-login-conainer .btn-login {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
    white-space: nowrap;
    font-family: 'Montserrat', sans-serif;
}
.btn-login-conainer .btn-login:hover {
    border-color: #ff7800;
    color: #ff7800;
}
.btn-login-conainer .btn-reg {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #ff7800;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    font-family: 'Montserrat', sans-serif;
}
.btn-login-conainer .btn-reg:hover {
    background: #e06d00;
}

/* --- Оверлей --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 40px 15px;
}
.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 620px;
    margin: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
}
.modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
}
.modal-header .close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0 5px;
    transition: color 0.2s;
}
.modal-header .close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 25px 30px 30px;
    max-height: 72vh;
    overflow-y: auto;
}

/* --- Поля формы --- */
.form-registration .form-group {
    margin-bottom: 14px;
    position: relative;
}

.form-registration .type-text,
.form-registration .type-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
    outline: none;
    background: #fff;
}
.form-registration .type-text:focus,
.form-registration .type-textarea:focus {
    border-color: #ff7800;
    background: #e8f3ff;
}
.form-registration .type-text:focus::placeholder,
.form-registration .type-textarea:focus::placeholder {
    color: #ff7800;
}
.form-registration .type-text:required {
    border-left: 3px solid #e74c3c;
}
.form-registration .type-text:required:valid {
    border-left: 3px solid #27ae60;
}
.form-registration .type-text-rep:required:valid {
    border-left: 3px solid #27ae60 !important;
}
.form-registration .type-text:not(:placeholder-shown) {
    background: #e8f3ff;
}
.form-registration .type-textarea {
    min-height: 80px;
    resize: vertical;
}

/* --- Кастомный селект --- */
.form-registration .custom-select {
    position: relative;
}
.form-registration .custom-select .dropdown-arrow {
    position: absolute;
    right: 12px;
    top: 14px;
    font-size: 10px;
    color: #999;
    cursor: pointer;
}
.form-registration .custom-select ul {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 6px 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.form-registration .custom-select ul li {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
    border-bottom: 1px solid #f5f5f5;
}
.form-registration .custom-select ul li:last-child {
    border-bottom: none;
}
.form-registration .custom-select ul li:hover {
    background: #fff5eb;
    color: #ff7800;
}

/* --- Скрытие полей докладчика --- */
.form-registration .is-hidden {
    display: none !important;
}

/* =============================================
   ТОГЛ-ПЕРЕКЛЮЧАТЕЛЬ ДЛЯ СЕКЦИЙ (Нет ← → Да)
   ============================================= */
.section-toggle-row {
    margin-bottom: 10px !important;
}

.section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    padding: 10px 14px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: background 0.2s, border-color 0.2s;
}
.section-toggle:hover {
    background: #f0f0f0;
    border-color: #ddd;
}

.section-toggle__label {
    font-size: 13px;
    line-height: 1.4;
    color: #333;
    flex: 1;
}

/* --- Сам переключатель --- */
.toggle-switch {
    position: relative;
    flex-shrink: 0;
    width: 74px;
    height: 30px;
}
.toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 74px;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    position: relative;
    transition: background 0.3s;
    padding: 0 8px;
    box-sizing: border-box;
    cursor: pointer;
}

.toggle-text-no,
.toggle-text-yes {
    font-size: 11px;
    font-weight: 600;
    z-index: 1;
    transition: color 0.3s;
    user-select: none;
    pointer-events: none;
}
.toggle-text-no {
    color: #fff;
}
.toggle-text-yes {
    color: #999;
}

.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: left 0.3s;
}

/* Checked state */
.toggle-switch input:checked + .toggle-track {
    background: #ff7800;
}
.toggle-switch input:checked + .toggle-track .toggle-thumb {
    left: 47px;
}
.toggle-switch input:checked + .toggle-track .toggle-text-no {
    color: rgba(255,255,255,0.5);
}
.toggle-switch input:checked + .toggle-track .toggle-text-yes {
    color: #fff;
}

/* Подсветка строки при включённой секции */
.section-toggle-row:has(input[type="checkbox"]:checked) .section-toggle {
    background: #fff5eb;
    border-color: #ff7800;
}
.section-toggle-row:has(input[type="checkbox"]:checked) .section-toggle__label {
    color: #1a1a2e;
    font-weight: 500;
}

/* --- Чекбокс согласия --- */
.form-registration .form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}
.form-registration .form-checkbox input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #ff7800;
}
.form-registration .checkbox-text {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

/* --- Ссылки --- */
.form-registration .form-group-links {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.form-registration .form-group-links a {
    font-size: 12px;
    color: #ff7800;
    text-decoration: none;
}
.form-registration .form-group-links a:hover {
    text-decoration: underline;
}

/* --- Кнопка отправки --- */
.btn-submit-reg {
    display: block;
    width: 100%;
    padding: 14px;
    background: #ff7800;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
}
.btn-submit-reg:hover:not(:disabled) {
    background: #e06d00;
}
.btn-submit-reg:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Сообщения --- */
.message-box {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.message-box h3 {
    margin: 0 0 8px;
    font-size: 18px;
}
.message-box p {
    margin: 0;
    font-size: 14px;
}
.message-box.success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}
.message-box.error {
    background: #fce4ec;
    border: 1px solid #ef9a9a;
    color: #c62828;
}

/* --- Адаптив --- */
@media (max-width: 640px) {
    .modal-overlay {
        padding: 10px 8px;
    }
    .modal-body {
        padding: 15px;
        max-height: 78vh;
    }
    .modal-header {
        padding: 15px;
    }
    .section-toggle {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .toggle-switch {
        align-self: flex-end;
    }
    .btn-login-conainer {
        flex-direction: column;
        gap: 6px;
    }
    .btn-login-conainer .btn-login,
    .btn-login-conainer .btn-reg {
        font-size: 12px;
        padding: 6px 12px;
    }
}