/* ============================================
   ASK QUESTION MODAL — "Задать вопрос"
   ============================================ */

.ask-question-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.ask-question-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.ask-question-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 672px;
    background: var(--color-white);
    padding: 60px 40px 65px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.ask-question-modal.active .ask-question-modal__dialog {
    transform: translateY(0);
}

.ask-question-modal__close {
    position: absolute;
    top: -45px;
    right: -45px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.ask-question-modal__title {
    font-family: var(--font-heading);
    font-size: 42px;
    line-height: 0.9;
    letter-spacing: -0.02em;
    color: var(--color-text);
    margin-bottom: 25px;
}

/* ============================================
   FORM
   ============================================ */

.ask-question-form {
    display: grid;
    gap: 8px;
}

.ask-question-form__label {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.3;
    color: var(--color-text);
    margin-bottom: 8px;
}

.ask-question-form__field {
    width: 100%;
    height: 44px;
    border: 1px solid var(--color-border);
    border-radius: 0;
    padding: 13px 20px;
    font-size: 14px;
    line-height: 16.1px;
    font-family: var(--font-body);
    color: var(--color-text);
    background: #fff;
    appearance: none;
}

.ask-question-form__textarea {
    height: 120px;
    resize: vertical;
    padding-top: 10px;
    padding-bottom: 10px;
}

.ask-question-form__textarea::placeholder {
    position: absolute;
    bottom: 10px;
    left: 20px;
    color: #999;
}

.ask-question-form__field::placeholder {
    color: rgba(32, 32, 32, 0.5);
}

/* --- Captcha row --- */

.ask-question-form__captcha-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ask-question-form__captcha-input {
    /* inherits from .ask-question-form__field */
}

.ask-question-form__captcha-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 44px;
    border: 1px solid var(--color-border);
    background: #fff;
}

/* .ask-question-form__captcha-box {
    display: inline-flex;
    align-items: center;
    padding: 0 15px;
    font-size: 24px;
    line-height: 1;
    font-family: "Bradley Hand", cursive;
    font-weight: 700;
    color: rgba(32, 32, 32, 0.4);
    user-select: none;
    flex: 1;
} */

.ask-question-form__captcha-refresh {
    border: 0;
    border-left: 1px solid var(--color-border);
    background: var(--color-text);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    width: 38px;
    margin-right: 2px;
    flex-shrink: 0;
}

/* Иконка обновления — та же маска что в section-review-form.css */
.ask-question-form__captcha-refresh::after {
    content: "";
    display: block;
    width: 22px;
    height: 21px;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22' fill='none'%3E%3Cpath d='M10.791 0.25C13.588 0.25 16.269 1.383 18.246 3.4C20.222 5.416 21.331 8.151 21.331 11c0 .09.07.154.146.154h1.537l-.317.404-1.815 2.314-.197.25-.197-.25-1.815-2.314-.318-.404h1.538c.037 0 .074-.015.102-.043a.155.155 0 00.044-.111c0-2.506-.975-4.908-2.711-6.679C16.594 2.551 14.241 1.558 10.791 1.558c-2.451 0-4.804.994-6.538 2.763C2.518 6.092 1.542 8.494 1.542 11s.976 4.908 2.711 6.679c1.735 1.77 4.087 2.763 6.538 2.763.361 0 .646.298.646.654 0 .356-.285.653-.646.653-2.797 0-5.479-1.133-7.456-3.15C1.359 16.584.25 13.85.25 11s1.109-5.584 3.085-7.6C5.312 1.383 7.994.25 10.791.25z' fill='%23000' stroke='%23000' stroke-width='.5'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22' fill='none'%3E%3Cpath d='M10.791 0.25C13.588 0.25 16.269 1.383 18.246 3.4C20.222 5.416 21.331 8.151 21.331 11c0 .09.07.154.146.154h1.537l-.317.404-1.815 2.314-.197.25-.197-.25-1.815-2.314-.318-.404h1.538c.037 0 .074-.015.102-.043a.155.155 0 00.044-.111c0-2.506-.975-4.908-2.711-6.679C16.594 2.551 14.241 1.558 10.791 1.558c-2.451 0-4.804.994-6.538 2.763C2.518 6.092 1.542 8.494 1.542 11s.976 4.908 2.711 6.679c1.735 1.77 4.087 2.763 6.538 2.763.361 0 .646.298.646.654 0 .356-.285.653-.646.653-2.797 0-5.479-1.133-7.456-3.15C1.359 16.584.25 13.85.25 11s1.109-5.584 3.085-7.6C5.312 1.383 7.994.25 10.791.25z' fill='%23000' stroke='%23000' stroke-width='.5'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

/* --- Consent --- */

.ask-question-form__consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    line-height: 16.34px;
    color: rgba(32, 32, 32, 0.6);
    margin-top: 10px;
}

.ask-question-form__consent input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 2px 0 0;
    flex: 0 0 auto;
    accent-color: #202020;
}

.ask-question-form__consent a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- Submit --- */

.ask-question-form__submit {
    justify-content: center;
    font-size: 16px;
    line-height: 20.8px;
    padding: 9px 22px;
    margin-top: 10px;
}

/* --- Messages --- */

.ask-question-form__message {
    font-size: 13px;
    line-height: 1.4;
    padding: 8px 0 0;
}

.ask-question-form__message--success {
    color: #1a7a3c;
}

.ask-question-form__message--error {
    color: #c0392b;
}

.ask-question-form__message--loading {
    color: rgba(32, 32, 32, 0.5);
}

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */

@media (max-width: 576px) {
    .ask-question-modal {
        padding: 15px;
        align-items: center;
    }

    .ask-question-modal__dialog {
        max-width: 100%;
        padding: 25px 15px 25px;
    }

    .ask-question-modal__close {
        top: -40px;
        right: 0;
    }

    .ask-question-modal__title {
        font-size: 28px;
        line-height: 1.1;
        margin-bottom: 10px;
    }

    .ask-question-form {
        gap: 5px;
    }

    .ask-question-form__label {
        font-size: 12px;
        line-height: 1.2;
        width: auto;
        margin-bottom: 10px;
    }

    .ask-question-form__field {
        height: 40px;
        padding: 10px 14px;
        font-size: 13px;
    }

    .ask-question-form__textarea {
        height: 100px;
    }

    .ask-question-form__textarea::placeholder {
        left: 14px;
    }

    /* На мобильном: сначала блок капчи, потом поле ввода */
    .ask-question-form__captcha-row {
        grid-template-columns: 1fr;
        gap: 5px;
        /* меняем порядок элементов */
    }

    .ask-question-form__captcha-wrap {
        order: -1; /* капча-картинка идёт первой */
        height: 40px;
    }

    .ask-question-form__captcha-box {
        height: inherit;
        padding: 1px;
    }

    .ask-question-form__captcha-refresh {
        height: 34px;
        width: 34px;
    }

    .ask-question-form__captcha-refresh::after {
        width: 18px;
        height: 17px;
    }

    .ask-question-form__consent {
        font-size: 11px;
        line-height: 14.5px;
    }

    .ask-question-form__submit {
        width: 100%;
        justify-content: center;
    }
}