/* ==========================================
   OneQuest Mental Health Retreat Popup
   ========================================== */

.oq-retreat-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.45s ease,
        visibility 0.45s ease;
}

.oq-retreat-popup.is-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.oq-retreat-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 24, 22, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.oq-retreat-popup__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 620px);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    background:#fff;
    border: 1px solid rgba(181, 156, 98, 0.42);
    box-shadow:
        0 35px 90px rgba(0, 0, 0, 0.25),
        0 8px 30px rgba(0, 0, 0, 0.12);
    opacity: 0;
    transform: translateY(24px) scale(0.985);
    transition:
        opacity 0.5s ease,
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.oq-retreat-popup.is-visible .oq-retreat-popup__dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.oq-retreat-popup__dialog::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(181, 156, 98, 0.22);
    pointer-events: none;
}

.oq-retreat-popup__content {
    position: relative;
    padding: 76px 72px 70px;
    text-align: center;
}

.oq-retreat-popup__eyebrow {
    margin: 0 0 22px;
    color: #D2B450;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.oq-retreat-popup__title {
    max-width: 500px;
    margin: 0 auto;
    color: #26312e;
    font-family: inherit;
    font-size: clamp(38px, 5vw, 58px);
    font-weight: 300;
    line-height: 1.08;
    letter-spacing: -0.025em;
}

.oq-retreat-popup__rule {
    width: 42px;
    height: 1px;
    margin: 25px auto;
    background: #dfe1e5;
}

.oq-retreat-popup__lead {
    margin: 0 0 18px;
    color: #212121;
    font-family: inherit;
    font-size: clamp(20px, 2.5vw, 25px);
    font-weight: 300;
    line-height: 1.45;
}

.oq-retreat-popup__description,
.oq-retreat-popup__support {
    max-width: 450px;
    margin-right: auto;
    margin-left: auto;
    color: #212121;
    font-family: inherit;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.3;
}

.oq-retreat-popup__description {
    margin-top: 0;
    margin-bottom: 8px;
}

.oq-retreat-popup__support {
    margin-top: 0;
    margin-bottom: 34px;
}

.oq-retreat-popup__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-width: 180px;
    padding: 16px 28px;
    border: 1px solid #D2B450;
    background: #D2B450;
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.18em;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    transition:
        background-color 0.3s ease,
        color 0.3s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.oq-retreat-popup__button:hover,
.oq-retreat-popup__button:focus {
    background: transparent;
    color: #66522f;
    box-shadow: 0 12px 28px rgba(83, 68, 39, 0.13);
    transform: translateY(-2px);
}

.oq-retreat-popup__button:focus-visible,
.oq-retreat-popup__close:focus-visible {
    outline: 2px solid #D2B450;
    outline-offset: 4px;
}

.oq-retreat-popup__arrow {
    display: inline-block;
    font-size: 18px;
    line-height: 0;
    transition: transform 0.3s ease;
}

.oq-retreat-popup__button:hover .oq-retreat-popup__arrow,
.oq-retreat-popup__button:focus .oq-retreat-popup__arrow {
    transform: translateX(4px);
}

.oq-retreat-popup__close {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 3;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.oq-retreat-popup__close:hover {
    transform: rotate(90deg);
}

.oq-retreat-popup__close span {
    position: absolute;
    top: 20px;
    left: 11px;
    width: 20px;
    height: 1px;
    background: #5c625f;
}

.oq-retreat-popup__close span:first-child {
    transform: rotate(45deg);
}

.oq-retreat-popup__close span:last-child {
    transform: rotate(-45deg);
}

body.oq-popup-open {
    overflow: hidden;
}

/* Mobile */

@media (max-width: 640px) {
    .oq-retreat-popup {
        align-items: center;
        padding: 18px;
    }

    .oq-retreat-popup__dialog {
        max-height: calc(100vh - 36px);
    }

    .oq-retreat-popup__dialog::before {
        inset: 8px;
    }

    .oq-retreat-popup__content {
        padding: 62px 30px 48px;
    }

    .oq-retreat-popup__eyebrow {
        margin-bottom: 17px;
        font-size: 10px;
    }

    .oq-retreat-popup__title {
        font-size: clamp(34px, 10vw, 44px);
    }

    .oq-retreat-popup__rule {
        margin-top: 23px;
        margin-bottom: 23px;
    }

    .oq-retreat-popup__lead {
        font-size: 20px;
    }

    .oq-retreat-popup__description,
    .oq-retreat-popup__support {
        font-size: 15px;
        line-height: 1.65;
    }

    .oq-retreat-popup__support {
        margin-bottom: 28px;
    }

    .oq-retreat-popup__button {
        width: 100%;
    }

    .oq-retreat-popup__close {
        top: 14px;
        right: 14px;
    }
}

/* Reduced motion accessibility */

@media (prefers-reduced-motion: reduce) {
    .oq-retreat-popup,
    .oq-retreat-popup__dialog,
    .oq-retreat-popup__button,
    .oq-retreat-popup__arrow,
    .oq-retreat-popup__close {
        transition: none;
    }
}