/* ============================================================
 * JC Callback — стили попапа, встроенной формы и прелоадера
 * ============================================================ */

/* ---------- Модальное окно ---------- */

#wjcallback-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 15px;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: transparent;
    transition: background-color .25s ease-out;
}

#wjcallback-modal.show {
    background-color: rgba(0, 0, 0, 0.5);
}

.wjcallback-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: auto;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity .25s ease-out, transform .25s ease-out;
}

#wjcallback-modal.show .wjcallback-modal-dialog {
    opacity: 1;
    transform: translateY(0);
}

.wjcallback-modal-close {
    position: absolute;
    top: -14px;
    right: -14px;
    z-index: 10;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: #fff;
    color: #333;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.wjcallback-modal-close:hover {
    background: #f0f0f0;
}

.wjcallback-modal-content {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* ---------- Общий контейнер формы (где заданы отступы) ---------- */

.wjcallbackform {
    box-sizing: border-box;
    padding: 25px; /* Отступы для всей карточки */
}

/* Сбрасываем лишнее в модалке */
#wjcallback-modal .wjcallbackform {
    display: block;
    position: static;
    width: 100%;
    min-width: 0;
    margin: 0;
    background: transparent;
    opacity: 1;
    text-align: left;
}

.wjcallbackform.wjcallbackform-embedded {
    display: block;
    width: 100%;
    margin: 0;
    background: #f9f9f9; /* Легкий фон для встроенной формы */
    border: 1px solid #eee;
    border-radius: 6px;
}

/* ---------- Заголовок и вступление ---------- */

.wjcallback-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0; /* Линия разделителя */
}

.wjcallback-header h3 {
    margin: 0;
    font-size: 1.5em;
    line-height: 1.2;
    padding-right: 30px; /* Чтобы текст не залезал под крестик */
    color: #333;
}

.wjcallback-intro {
    margin-bottom: 20px;
    color: #555;
    line-height: 1.5;
}

/* ---------- Форма ---------- */

.wjcallback-form {
    margin: 0;
    padding: 0; /* Убрали padding отсюда, так как он теперь на .wjcallbackform */
}

.wjcallback-field {
    margin-bottom: 15px;
}

.wjcallback-field > label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #444;
}

.wjcallback-field > label.required::after {
    content: " *";
    color: #c00;
}

.wjcallback-form input[type="text"],
.wjcallback-form input[type="tel"],
.wjcallback-form input[type="email"],
.wjcallback-form input[type="file"],
.wjcallback-form select,
.wjcallback-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font: inherit;
    color: inherit;
}

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

.wjcallback-form input:focus,
.wjcallback-form textarea:focus,
.wjcallback-form select:focus {
    outline: none;
    border-color: #0088cc;
    box-shadow: 0 0 0 2px rgba(0, 136, 204, 0.15);
}

/* ---------- Действия ---------- */

.wjcallback-actions {
    margin-top: 20px;
    text-align: right;
}

.wjcallback-submit {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    background: #d9534f; /* Цвет как на вашем скрине */
    color: #fff;
    font-size: 16px;
    font: inherit;
    cursor: pointer;
    transition: background-color .2s;
}

.wjcallback-submit:hover {
    background: #c9302c;
}

.wjcallback-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ---------- Сообщения ---------- */

.wjcallback-messages {
    margin-bottom: 15px;
}

.wjcallback-messages.wjcallback-alert-error,
.wjcallback-messages.wjcallback-alert-success {
    padding: 12px;
    border-radius: 4px;
}

.wjcallback-alert-error {
    background: #fde2e2;
    border: 1px solid #f5c2c2;
    color: #a00;
}

.wjcallback-alert-success {
    background: #d9f2d9;
    border: 1px solid #b3e0b3;
    color: #060;
}

.wjcallback-thankyou {
    padding: 20px;
    text-align: center;
    font-size: 1.1em;
}

/* ---------- TOS ---------- */

.wjcallback-tos-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: .95em;
    line-height: 1.35;
    cursor: pointer;
}

.wjcallback-tos-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

.wjcallback-tos-text {
    font-size: .95em;
    line-height: 1.35;
    color: #555;
}

.wjcallback-tos-text a {
    color: #0088cc;
    text-decoration: underline;
}

/* ---------- Honeypot ---------- */

.wjcallback-honeypot {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- Блокировка скролла body ---------- */

.wjcallback-body-scrolloff {
    overflow: hidden;
}

/* ---------- Прелоадер ---------- */

#wjcallback-loader {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

#wjcallback-loader::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top-color: #0088cc;
    border-radius: 50%;
    animation: jcspin 1s linear infinite;
}

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

/* ---------- Адаптив ---------- */

@media (max-width: 480px) {
    #wjcallback-modal {
        padding: 10px;
    }

    .wjcallback-modal-close {
        top: 5px;
        right: 5px;
    }

    .wjcallbackform {
        padding: 15px;
    }
}