/* ==========================================================================
   Попап (<dialog>) і форма Contact Form 7
   ========================================================================== */

html.has-modal {
    overflow: hidden;
}

.modal {
    width: min(520px, calc(100% - 32px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 20px;
    background: var(--color-dark);
    color: var(--color-light);
    box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
}

.modal::backdrop {
    background: rgba(10, 13, 14, .72);
}

.modal[open] {
    animation: modal-in .25s ease;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.modal__inner {
    position: relative;
    padding: 40px 32px 32px;
}

.modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background-color .2s ease;
}

.modal__close:hover {
    background: rgba(255, 255, 255, .08);
}

.modal__title {
    margin: 0 0 8px;
    padding-inline-end: 40px;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
}

/* Текст конкретної послуги (з кнопки картки) */
.modal__lead {
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid rgba(127, 242, 184, .28);
    border-radius: 14px;
    background: rgba(127, 242, 184, .1);
    color: var(--color-light);
    font-size: 16px;
    line-height: 1.5;
}

.modal__lead[hidden] {
    display: none;
}

.modal__text {
    margin: 0 0 20px;
    color: rgba(255, 255, 255, .72);
    font-size: 16px;
    line-height: 1.5;
}

.modal__contacts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-bottom: 24px;
}

.modal__phone {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.modal__socials {
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.modal a {
    transition: opacity .2s ease;
}

.modal a:hover {
    opacity: .75;
}

/* --- Форма -------------------------------------------------------------- */
.gz-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
}

.gz-form p {
    margin: 0;
}

.gz-form br {
    display: none;
}

.gz-form .wpcf7-form-control-wrap {
    display: block;
}

.gz-form__input {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 12px;
    background: #242A2D;
    color: var(--color-light);
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.gz-form__input::placeholder {
    color: rgba(255, 255, 255, .5);
}

.gz-form__input:focus {
    border-color: var(--color-accent);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(127, 242, 184, .25);
}

.gz-form__consent {
    color: rgba(255, 255, 255, .72);
    font-size: 14px;
    line-height: 1.4;
}

.gz-form__consent .wpcf7-list-item {
    margin: 0;
}

.gz-form__consent label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.gz-form__consent input[type="checkbox"] {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: #7FF2B8;
}

.gz-form__consent a {
    color: var(--color-light);
    text-decoration: underline;
}

.gz-form__submit {
    display: block;
    width: 100%;
    padding: 16px 22px;
    border: 0;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.gz-form .wpcf7-spinner {
    display: block;
    margin: 4px auto 0;
}

.gz-form .wpcf7-not-valid-tip {
    margin-top: 6px;
    color: #ff9a9a;
    font-size: 13px;
}

.gz-form .wpcf7-response-output {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
}

.gz-form.sent .wpcf7-response-output {
    border-color: var(--color-accent);
}

.gz-form.invalid .wpcf7-response-output,
.gz-form.failed .wpcf7-response-output,
.gz-form.aborted .wpcf7-response-output {
    border-color: #ff9a9a;
}

@media (max-width: 480px) {
    .modal__inner {
        padding: 36px 20px 24px;
    }

    .modal__title {
        font-size: 24px;
    }

    .modal__lead {
        padding: 12px 14px;
        font-size: 15px;
    }
}
