.ai-form-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.ai-form-modal:not(.hidden) {
    display: flex;
}

.ai-form-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
}

.ai-form-modal-dialog {
    position: relative;
    max-width: 960px;
    width: 100%;
    z-index: 10;
    transform: translateY(6px) scale(0.985);
    opacity: 0;
    transition: transform 0.18s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.18s ease-out;
}

.ai-form-modal-dialog.ai-form-modal-dialog--open {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.ai-form-card {
    background:
        radial-gradient(circle at top left, rgba(248, 61, 180, 0.22), transparent 60%),
        radial-gradient(circle at top right, rgba(4, 208, 196, 0.25), transparent 60%),
        radial-gradient(circle at bottom right, rgba(252, 127, 2, 0.18), transparent 60%),
        linear-gradient(135deg, #020617 0%, #111827 25%, #1f2937 55%, #1d2448 75%, #0f172a 100%);
    border-radius: 24px;
    padding: 32px 24px 32px;
    box-shadow:
        0 35px 90px rgba(15, 23, 42, 0.85),
        0 0 60px rgba(248, 61, 180, 0.35),
        0 0 80px rgba(4, 208, 196, 0.25);
    border: 1px solid rgba(59, 130, 246, 0.45);
    color: #e5e7eb;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.ai-form-close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(55, 65, 81, 0.8);
    background: rgba(15, 23, 42, 0.95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.ai-form-close:hover {
    border-color: rgba(248, 61, 180, 0.9);
    box-shadow: 0 0 0 1px rgba(248, 61, 180, 0.25);
}

.ai-form-close-icon {
    position: relative;
    width: 14px;
    height: 14px;
}

.ai-form-close-icon::before,
.ai-form-close-icon::after {
    content: "";
    position: absolute;
    inset: 50%;
    width: 100%;
    height: 2px;
    background: #e5e7eb;
    border-radius: 999px;
    transform-origin: center;
}

.ai-form-close-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.ai-form-close-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.ai-form-header {
    margin-bottom: 24px;
}

.ai-form-title {
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
    color: #f9fafb;
    margin: 0 0 8px 0;
}

.ai-form-subtitle {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #9ca3af;
}

.ai-form-question {
    padding: 16px 20px;
    border-radius: 16px;
    background:
        radial-gradient(circle at top left, rgba(248, 61, 180, 0.26), transparent 55%),
        radial-gradient(circle at top right, rgba(4, 208, 196, 0.22), transparent 55%),
        rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(129, 140, 248, 0.8);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-form-question-text {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #f9fafb;
}

.ai-form-radio-group {
    display: inline-flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ai-form-radio-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 9999px;
    border: 1px solid rgba(148, 163, 184, 0.75);
    background: rgba(15, 23, 42, 0.92);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-form-radio-option:hover {
    border-color: rgba(248, 61, 180, 0.9);
    box-shadow: 0 0 0 1px rgba(248, 61, 180, 0.25);
}

.ai-form-radio-input {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.ai-form-radio-label {
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
}

.ai-form-radio-option--active {
    border-color: rgba(248, 61, 180, 0.95);
    background: linear-gradient(135deg, rgba(248, 61, 180, 0.35), rgba(252, 127, 2, 0.3));
    box-shadow:
        0 0 0 1px rgba(248, 61, 180, 0.55),
        0 18px 45px rgba(15, 23, 42, 0.9);
}

.ai-form-variants {
    margin-top: 24px;
}

.ai-form-variant {
    padding: 20px 20px 16px;
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.75);
    background:
        radial-gradient(circle at top right, rgba(4, 208, 196, 0.25), transparent 60%),
        radial-gradient(circle at bottom left, rgba(252, 127, 2, 0.18), transparent 55%),
        rgba(15, 23, 42, 0.96);
}

.ai-form-variant--no {
    margin-top: 16px;
}

.ai-form-variant-text {
    margin: 0 0 16px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #d1d5db;
}

.ai-form-success-message {
    margin-top: 24px;
    padding: 20px 20px 18px;
    border-radius: 20px;
    border: 1px dashed rgba(148, 163, 184, 0.8);
    background:
        radial-gradient(circle at top right, rgba(4, 208, 196, 0.18), transparent 60%),
        rgba(15, 23, 42, 0.96);
}

.ai-form-success-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #e5e7eb;
}

.ai-form-success-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #cbd5f5;
}

.ai-form-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 9999px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition:
        box-shadow 0.24s cubic-bezier(0.22, 0.61, 0.36, 1),
        background 0.24s ease-out,
        color 0.24s ease-out;
    text-decoration: none;
    color: #ffffff;
}

.ai-form-button:hover,
.ai-form-button:focus,
.ai-form-button:focus-visible,
.ai-form-button:active,
.ai-form-button:visited {
    text-decoration: none;
    outline: none;
    color: #ffffff;
}

.ai-form-button--primary {
    background: linear-gradient(135deg, #fc7f02, #f83db4);
    color: #ffffff;
    box-shadow:
        0 18px 40px rgba(248, 61, 180, 0.45),
        0 0 40px rgba(252, 127, 2, 0.35);
}

.ai-form-button--primary:hover {
    box-shadow:
        0 20px 45px rgba(248, 61, 180, 0.55),
        0 0 45px rgba(252, 127, 2, 0.4);
    background: linear-gradient(135deg, #f83db4, #fc7f02);
}

.ai-form-button--secondary {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.8);
    color: #e5e7eb;
    margin-top: 24px;
}

.ai-form-button--secondary:hover {
    border-color: rgba(248, 61, 180, 0.9);
    box-shadow:
        0 0 0 1px rgba(248, 61, 180, 0.4),
        0 10px 30px rgba(15, 23, 42, 0.9);
    background: radial-gradient(circle at top right, rgba(4, 208, 196, 0.18), transparent 55%);
}

.ai-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
}

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

.ai-form-label {
    font-size: 13px;
    font-weight: 500;
    color: #e5e7eb;
}

.ai-form-input {
    border-radius: 12px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.95);
    color: #f9fafb;
    font-size: 14px;
    transition: all 0.2s ease;
    outline: none;
}

.ai-form-input::placeholder {
    color: #6b7280;
}

.ai-form-input:focus {
    border-color: rgba(59, 130, 246, 0.95);
    box-shadow:
        0 0 0 1px rgba(59, 130, 246, 0.55),
        0 0 30px rgba(4, 208, 196, 0.35);
}

/* Плейсхолдер телефона в AI-форме — чуть светлее и заметнее */
.ai-form-registration input[type="tel"]::placeholder {
    color: #e5e7eb;
    opacity: 0.55;
}

.ai-form-input--error {
    border-color: rgba(248, 113, 113, 1);
    box-shadow:
        0 0 0 1px rgba(248, 113, 113, 0.8),
        0 0 24px rgba(127, 29, 29, 0.7);
}

.ai-form-error {
    margin: 2px 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: #fecaca;
    min-height: 14px;
}

/* Телефонный инпут intl-tel-input внутри AI-формы */
.ai-form-registration .iti {
    width: 100%;
}

.ai-form-registration .iti input {
    background: transparent;
    color: #f9fafb;
}

.ai-form-registration .iti.iti--separate-dial-code input {
    padding-left: 62px; /* чуть больше отступа от кода страны для удобства ввода */
}

.ai-form-registration .iti__selected-flag {
    background: rgba(15, 23, 42, 0.95);
    border-right: 1px solid rgba(55, 65, 81, 0.9);
}

.ai-form-registration .iti__dial-code {
    color: #ffffff !important;
}

.ai-form-registration .iti__selected-dial-code {
    color: #ffffff !important;
    font-weight: 600;
    text-shadow: 0 0 4px rgba(15, 23, 42, 0.9);
}

.ai-form-registration .iti__arrow {
    border-top-color: #ffffff !important;
}

.ai-form-registration .iti__arrow--up {
    border-bottom-color: #ffffff !important;
}

/* Дополнительно усиливаем цвет стрелки внутри выбранного флага */
.ai-form-registration .iti__selected-flag .iti__arrow {
    border-top-color: #ffffff !important;
    border-bottom-color: #ffffff !important;
}

/* Делаем картинку chevron белой именно внутри AI-формы */
.ai-form-registration .iti__arrow {
    background-image: url('/images/widgets/form/chevron-down.png');
    filter: invert(1) brightness(2);
}

.ai-form-registration .iti__arrow.iti__arrow--up {
    background-image: url('/images/widgets/form/chevron-up.png');
    filter: invert(1) brightness(2);
}

.ai-form-registration .iti__country-list {
    background-color: #0b1220;
    border-color: rgba(55, 65, 81, 0.9);
}

.ai-form-registration .iti__country {
    color: #e5e7eb;
}

.ai-form-registration .iti__country.iti__highlight {
    background-color: rgba(37, 99, 235, 0.4);
}

.ai-form-registration .iti__divider {
    border-bottom-color: rgba(55, 65, 81, 0.9);
}

.ai-form-actions {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.ai-form-sending-info {
    font-size: 13px;
    color: #9ca3af;
    display: none;
}

/* Валидация и вывод ошибок для AI-формы */
.ai-form-registration .error-text {
    font-size: 13px;
    line-height: 150%;
    color: #fecaca;
    opacity: 0;
    height: 0;
    overflow: hidden;
    margin-top: 0;
    transition: all .2s ease-out;
}

.ai-form-registration .input-wrapper.error-wrapper .ai-form-input {
    border-color: #f97373;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.4);
}

.ai-form-registration .input-wrapper.error-wrapper .error-text {
    margin-top: 6px;
    opacity: 1;
    height: auto;
}

.ai-form-captcha-wrapper {
    justify-content: center;
}
#captcha-ai{
    margin-top: 24px;
}
.ai-form-registration .iti input{
    width: 100%;
    font-size: 16px;
}
@media (max-width: 768px) {
    .ai-form-card {
        padding: 24px 18px 24px;
        border-radius: 18px;
        max-height: calc(100vh - 32px);
    }

    .ai-form-title {
        font-size: 22px;
    }

    .ai-form-grid {
        grid-template-columns: 1fr;
    }

    .ai-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ai-form-button {
        width: 100%;
        justify-content: center;
    }
}


