/* Модальное окно */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay--active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

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

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid #eee;
}

.modal__title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.modal__close {
    background: none;
    border: none;
    font-size: 36px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.modal__close:hover {
    background-color: #f5f5f5;
    color: #333;
}

/* Вкладки */
.modal__tabs {
    display: flex;
    padding: 0 32px;
    border-bottom: 2px solid #eee;
}

.modal__tab {
    flex: 1;
    background: none;
    border: none;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    margin-bottom: -2px;
}

.modal__tab:hover {
    color: #333;
}

.modal__tab--active {
    color: #4361ee;
    border-bottom-color: #4361ee;
}

/* Содержимое вкладок */
.modal__tab-content {
    display: none;
    padding: 24px 32px 32px;
}

.modal__tab-content--active {
    display: block;
}

/* Форма */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="email"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-group input::placeholder {
    color: #999;
    font-size: 14px;
}

.form-group--checkbox label {
    display: flex;
    align-items: flex-start;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
}

.form-group--checkbox input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4361ee;
}

.form-group--checkbox a {
    color: #4361ee;
    text-decoration: none;
}

.form-group--checkbox a:hover {
    text-decoration: underline;
}

/* Кнопки */
.btn--full {
    width: 100%;
    margin-top: 12px;
}

/* Сообщение об успехе */
.modal__success {
    text-align: center;
    padding: 48px 32px;
}

.modal__success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background-color: #4ade80;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
}

.modal__success h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 16px;
}

.modal__success p {
    color: #666;
    margin-bottom: 32px;
    font-size: 16px;
    line-height: 1.5;
}

/* Адаптивность */
@media (max-width: 640px) {
    .modal {
        width: 95%;
        margin: 16px;
    }

    .modal__header {
        padding: 20px 24px;
    }

    .modal__title {
        font-size: 20px;
    }

    .modal__tabs {
        padding: 0 24px;
    }

    .modal__tab {
        font-size: 14px;
        padding: 12px 16px;
    }

    .modal__tab-content {
        padding: 20px 24px 24px;
    }

    .modal__close {
        width: 36px;
        height: 36px;
        font-size: 28px;
    }
}

/* Сообщения об ошибках */
.error-message {
    color: #dc2626;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.form-group.error input,
.form-group.error select {
    border-color: #dc2626;
    background-color: #fef2f2;
}

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

/* Состояние загрузки */
.btn--loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn--loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Селектор количества генераций */
.quantity-selector {
    display: flex;
    gap: 8px;
    align-items: center;
}

.quantity-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
}

.quantity-btn:hover {
    border-color: #4361ee;
    color: #4361ee;
}

.quantity-btn--active {
    border-color: #4361ee;
    background: #4361ee;
    color: white;
}

.quantity-input {
    width: 100px;
    padding: 10px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.quantity-input:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.quantity-input::placeholder {
    color: #999;
    font-size: 14px;
}