#gdm-contact-launcher[hidden],
#gdm-contact-dialog[hidden] {
    display: none !important;
}

/* Полупрозрачный конверт */
#gdm-contact-launcher {
    position: fixed;
    right: clamp(16px, 3vw, 42px);
    bottom: clamp(18px, 4vh, 42px);
    z-index: 12000;

    width: 56px;
    height: 56px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;

    background: rgba(4, 65, 101, 0.58);
    box-shadow: 0 5px 22px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    color: #fff;
    cursor: pointer;

    opacity: 0;
    transform: translateY(12px) scale(0.92);
    pointer-events: none;

    transition:
        opacity 350ms ease,
        transform 350ms ease,
        background 200ms ease;
}

#gdm-contact-launcher.is-visible {
    opacity: 0.72;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#gdm-contact-launcher:hover,
#gdm-contact-launcher:focus-visible {
    opacity: 1;
    background: rgba(4, 65, 101, 0.92);
}

#gdm-contact-launcher svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Затемнение страницы */
#gdm-contact-dialog {
    position: fixed;
    inset: 0;
    z-index: 13000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 18px;
    box-sizing: border-box;

    background: rgba(0, 0, 0, 0.38);

    opacity: 0;
    pointer-events: none;

    transition: opacity 220ms ease;
}

#gdm-contact-dialog.is-open {
    opacity: 1;
    pointer-events: auto;
}

.gdm-contact-panel {
    position: relative;

    width: min(430px, 100%);
    max-height: calc(100vh - 36px);
    overflow-y: auto;

    box-sizing: border-box;
    padding: 28px;

    border-radius: 12px;
    background: rgba(247, 247, 247, 0.98);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);

    transform: translateY(12px) scale(0.98);
    transition: transform 220ms ease;
}

#gdm-contact-dialog.is-open .gdm-contact-panel {
    transform: translateY(0) scale(1);
}

.gdm-contact-panel h2 {
    margin: 0 38px 22px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.gdm-contact-close {
    position: absolute;
    top: 12px;
    right: 14px;

    width: 36px;
    height: 36px;

    border: 0;
    background: transparent;
    color: #555;

    font-size: 30px;
    line-height: 32px;
    cursor: pointer;
}

.gdm-contact-field {
    display: block;
    margin-bottom: 17px;
}

.gdm-contact-field span {
    display: block;
    margin-bottom: 7px;

    color: #444;
    font-size: 14px;
    font-weight: 600;
}

.gdm-contact-field input,
.gdm-contact-field textarea {
    display: block;
    width: 100%;

    box-sizing: border-box;
    padding: 11px 12px;

    border: 1px solid #aaa;
    border-radius: 6px;
    background: #fff;
    color: #222;

    font: inherit;
    font-size: 16px;
}

.gdm-contact-field textarea {
    min-height: 150px;
    resize: vertical;
}

.gdm-contact-field input:focus,
.gdm-contact-field textarea:focus {
    border-color: #044165;
    outline: 2px solid rgba(4, 65, 101, 0.18);
}

.gdm-contact-submit {
    min-width: 110px;
    padding: 11px 22px;

    border: 0;
    border-radius: 6px;

    background: #044165;
    color: #fff;

    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.gdm-contact-submit:disabled {
    opacity: 0.55;
    cursor: wait;
}

#gdm-contact-status {
    min-height: 22px;
    margin: 15px 0 0;

    text-align: left;
    font-size: 14px;
    line-height: 1.4;
}

#gdm-contact-status.is-success {
    color: #176b32;
}

#gdm-contact-status.is-error {
    color: #a51d1d;
}

/* Невидимое поле против автоматических форм */
.gdm-contact-trap {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

body.gdm-contact-open {
    overflow: hidden;
}

@media (max-width: 480px) {
    .gdm-contact-panel {
        padding: 24px 20px;
    }

    #gdm-contact-launcher {
        width: 52px;
        height: 52px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #gdm-contact-launcher,
    #gdm-contact-dialog,
    .gdm-contact-panel {
        transition: none;
    }
}
