/* ============================================
   МОДАЛЬНОЕ ОКНО "ВЫЗВАТЬ ВРАЧА"
   ============================================ */

/* ---- Оверлей ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ---- Контейнер модального окна ---- */
.modal-container {
    background: #ffffff;
    border-radius: 20px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

/* ---- Кнопка закрытия ---- */
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: #F5F7FA;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5A6E7F;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: #E8EDF5;
    transform: rotate(90deg);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

/* ---- Контент ---- */
.modal-content {
    padding: 40px 35px 35px;
}

/* ---- Заголовок ---- */
.modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-icon {
    width: 64px;
    height: 64px;
    background: #E7EFFD;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.modal-icon svg {
    width: 32px;
    height: 32px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0B121B;
    margin: 0 0 8px;
    font-family: 'Manrope', sans-serif;
}

.modal-subtitle {
    font-size: 0.95rem;
    color: #5A6E7F;
    margin: 0;
    line-height: 1.5;
}

/* ---- Форма ---- */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #33384F;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 1.5px solid #E3EBF4;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #33384F;
    background: #F8F9FA;
    transition: all 0.3s ease;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #265EC4;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(38, 94, 196, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #B0C4D9;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%235A6E7F'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* ---- Чекбокс ---- */
.form-checkbox {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #5A6E7F;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #B0C4D9;
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    margin-top: 1px;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: #265EC4;
    border-color: #265EC4;
    position: relative;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input[type="checkbox"]:focus + .checkbox-custom {
    box-shadow: 0 0 0 3px rgba(38, 94, 196, 0.2);
}

.checkbox-text a {
    color: #265EC4;
    text-decoration: underline;
}

.checkbox-text a:hover {
    color: #14399D;
}

/* ---- Кнопка отправки ---- */
.modal-submit-btn {
    padding: 16px 32px;
    background: #265EC4;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}

.modal-submit-btn:hover {
    background: #14399D;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(38, 94, 196, 0.3);
}

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

.modal-submit-btn svg {
    transition: transform 0.3s ease;
}

.modal-submit-btn:hover svg {
    transform: translateX(6px);
}

.modal-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ---- Футер формы ---- */
.modal-footer-text {
    font-size: 0.75rem;
    color: #8B9CAF;
    text-align: center;
    margin: 0;
}

.modal-footer-text a {
    color: #265EC4;
    text-decoration: none;
}

.modal-footer-text a:hover {
    text-decoration: underline;
}

/* ---- Сообщение об успехе ---- */
.modal-success {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    margin-bottom: 16px;
}

.success-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0B121B;
    margin: 0 0 8px;
    font-family: 'Manrope', sans-serif;
}

.success-text {
    font-size: 0.95rem;
    color: #5A6E7F;
    margin: 0 0 24px;
    line-height: 1.5;
}

.success-close-btn {
    padding: 12px 40px;
    background: #265EC4;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.success-close-btn:hover {
    background: #14399D;
}

/* ---- Сообщения об ошибках ---- */
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #E74C3C;
    background: #FFF5F5;
}

.form-group .error-message {
    font-size: 0.8rem;
    color: #E74C3C;
    display: none;
}

.form-group .error-message.show {
    display: block;
}

/* ---- Адаптив ---- */
@media (max-width: 768px) {
    .modal-content {
        padding: 30px 20px 25px;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
    
    .modal-subtitle {
        font-size: 0.85rem;
    }
    
    .modal-container {
        max-width: 100%;
        margin: 10px;
        border-radius: 16px;
    }
    
    .modal-submit-btn {
        padding: 14px 24px;
        font-size: 0.95rem;
    }
    
    .modal-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 24px 16px 20px;
    }
    
    .modal-icon {
        width: 48px;
        height: 48px;
    }
    
    .modal-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    
    .modal-submit-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* ---- Блокировка скролла ---- */
body.modal-open {
    overflow: hidden;
}