/* Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease forwards;
}

.modal-overlay.closing {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Modal container */
.modal {
    background: #fff;
    border-radius: 20px;
    max-width: 90%; /* Уменьшение ширины для мобильных устройств */
    width: 100%;
    box-shadow: 0 20px 64px rgba(0, 0, 0, 0.2);
    position: relative;
    padding: 24px; /* Уменьшение отступов для мобильных устройств */
    display: flex;
    flex-direction: column;
    animation: slideInUp 0.3s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.modal.show {
    animation: slideInUp 0.3s ease forwards;
}

.modal.closing {
    animation: slideOutDown 0.3s ease forwards;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(40px);
    }
}

/* Modal header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px; /* Уменьшение отступа для мобильных устройств */
}

.modal-title {
    font-size: 1.5rem; /* Уменьшение размера шрифта для мобильных устройств */
    font-weight: 700;
    color: #222;
}

.modal-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 24px; /* Уменьшение размера кнопки закрытия для мобильных устройств */
    line-height: 1;
    padding: 4px;
    transition: color 0.2s ease;
}

.modal-close-btn:hover,
.modal-close-btn:focus {
    color: #222;
    outline: none;
}

/* Modal form */
form {
    display: flex;
    flex-direction: column;
    gap: 16px; /* Уменьшение промежутка между элементами формы */
}

label {
    font-weight: 600;
    font-size: 0.9rem; /* Уменьшение размера шрифта для мобильных устройств */
    color: #444;
    margin-bottom: 4px; /* Уменьшение отступа для мобильных устройств */
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
textarea {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem; /* Уменьшение размера шрифта для мобильных устройств */
    padding: 10px; /* Уменьшение отступов для мобильных устройств */
    border-radius: 14px;
    border: 1.5px solid #dfdcd6; /* Уменьшение толщины границы */
    background-color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.2s ease;
    resize: vertical;
    min-height: 40px; /* Уменьшение минимальной высоты для мобильных устройств */
}

input:focus,
textarea:focus {
    border-color: #c8b675;
    box-shadow: 0 0 0 3px rgba(200, 182, 117, 0.25);
    outline: none;
}

textarea {
    min-height: 80px; /* Уменьшение минимальной высоты для мобильных устройств */
}

/* Modal buttons container */
.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px; /* Уменьшение промежутка между кнопками */
    margin-top: 12px; /* Уменьшение отступа для мобильных устройств */
}

.btn-submit {
    background-color: #c8b675;
    color: #222;
    border: none;
    padding: 10px 20px; /* Уменьшение отступов для мобильных устройств */
    border-radius: 24px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(200, 182, 117, 0.5);
    transition: background-color 0.3s ease, transform 0.2s ease;
    min-width: 120px; /* Уменьшение минимальной ширины для мобильных устройств */
}

.btn-submit:hover,
.btn-submit:focus {
    background-color: #a59245;
    transform: scale(1.05);
    outline: none;
}

.btn-cancel {
    background-color: transparent;
    color: #666;
    border: 2px solid #dfdcd6;
    padding: 10px 20px; /* Уменьшение отступов для мобильных устройств */
    border-radius: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    min-width: 120px; /* Уменьшение минимальной ширины для мобильных устройств */
}

.btn-cancel:hover,
.btn-cancel:focus {
    background-color: #dfdcd6;
    color: #222;
    outline: none;
}
