/*
 * Sign-up offer popup and side tab.
 *
 * Self-contained: every rule sits under .pc-offer, and the theme's --pc-*
 * tokens are used with literal fallbacks so the popup still looks right on a
 * page that does not load main.css.
 */

.pc-offer [hidden] {
    display: none !important;
}

.pc-offer,
.pc-offer *,
.pc-offer *::before,
.pc-offer *::after {
    box-sizing: border-box;
}

/* ---------- popup ---------- */

.pc-offer__overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(20, 16, 36, 0.62);
    overflow-y: auto;
    animation: pc-offer-fade 0.2s ease-out;
}

.pc-offer__dialog {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    width: 100%;
    max-width: 760px;
    margin: auto;
    background: #fff;
    border-radius: var(--pc-radius-card, 10px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    animation: pc-offer-rise 0.25s ease-out;
}

.pc-offer__dialog:focus {
    outline: none;
}

.pc-offer__dialog--plain {
    grid-template-columns: minmax(0, 1fr);
    max-width: 480px;
}

.pc-offer__media {
    position: relative;
    min-height: 420px;
    background: var(--pc-primary, #30264b);
}

.pc-offer__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Darkens the top of the photo so the white logo always has contrast. */
.pc-offer__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(38, 33, 70, 0.88) 0%, rgba(38, 33, 70, 0.35) 45%, rgba(38, 33, 70, 0.15) 100%);
}

.pc-offer__logo {
    position: absolute;
    top: 22px;
    left: 50%;
    z-index: 1;
    width: 130px;
    height: auto;
    transform: translateX(-50%);
}

.pc-offer__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 44px 36px 32px;
    text-align: center;
    font-family: var(--pc-font-body, "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
    color: #363741;
}

.pc-offer__eyebrow {
    margin: 0 0 6px;
    font-family: var(--pc-font-head, "Montserrat", system-ui, sans-serif);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--pc-primary-3, #443a6a);
}

.pc-offer .pc-offer__title {
    margin: 0 0 14px;
    font-family: var(--pc-font-head, "Montserrat", system-ui, sans-serif);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--pc-primary, #30264b);
    text-wrap: balance;
}

.pc-offer__sub {
    margin: 0 0 22px;
    font-family: var(--pc-font-head, "Montserrat", system-ui, sans-serif);
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
}

.pc-offer__form {
    margin: 0;
}

/* Visible to screen readers; the placeholder carries the label for the eye. */
.pc-offer__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.pc-offer .pc-offer__input {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0 0 10px;
    padding: 0 14px;
    font: inherit;
    font-size: 16px; /* below 16px iOS zooms the page on focus */
    color: #1d1d1f;
    background: #fff;
    border: 1px solid #8d8d8d;
    border-radius: var(--pc-radius, 4px);
    box-shadow: none;
}

.pc-offer .pc-offer__input:focus {
    border-color: var(--pc-primary, #30264b);
    outline: 2px solid var(--pc-primary, #30264b);
    outline-offset: 1px;
}

.pc-offer .pc-offer__input[aria-invalid="true"] {
    border-color: var(--pc-accent, #de0c1b);
}

/* The trap field: off-screen rather than display:none, which some bots skip. */
.pc-offer__trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.pc-offer .pc-offer__submit {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    font-family: var(--pc-font-btn, "Mulish", system-ui, sans-serif);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: var(--pc-accent, #de0c1b);
    border: 0;
    border-radius: var(--pc-radius-btn, 5px);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.pc-offer .pc-offer__submit:hover {
    background: var(--pc-accent-2, #c40b18);
}

.pc-offer .pc-offer__submit:focus-visible {
    outline: 2px solid var(--pc-primary, #30264b);
    outline-offset: 2px;
}

.pc-offer .pc-offer__submit[disabled] {
    opacity: 0.65;
    cursor: progress;
}

.pc-offer__error {
    margin: 10px 0 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--pc-accent-deep, #92001f);
}

.pc-offer__legal {
    margin: 14px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: #6b6b6b;
    text-transform: none;
}

.pc-offer__done-text {
    margin: 0 0 22px;
    font-size: 16px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    text-transform: none;
}

.pc-offer .pc-offer__close {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 26px;
    line-height: 1;
    color: #6b6b6b;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.pc-offer .pc-offer__close:hover {
    color: #1d1d1f;
    background: #f3f6f8;
}

.pc-offer .pc-offer__close:focus-visible,
.pc-offer .pc-offer__tab-open:focus-visible,
.pc-offer .pc-offer__tab-close:focus-visible {
    outline: 2px solid var(--pc-primary, #30264b);
    outline-offset: 2px;
}

/* ---------- side tab ---------- */

.pc-offer__tab {
    position: fixed;
    top: 50%;
    left: 0;
    z-index: 900;
    transform: translateY(-50%);
}

.pc-offer .pc-offer__tab-open {
    display: block;
    max-height: 60vh;
    padding: 14px 8px;
    writing-mode: vertical-rl;
    font-family: var(--pc-font-btn, "Mulish", system-ui, sans-serif);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    background: var(--pc-accent, #de0c1b);
    border: 0;
    border-radius: 0 6px 6px 0;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.pc-offer .pc-offer__tab-open:hover {
    background: var(--pc-accent-2, #c40b18);
}

.pc-offer .pc-offer__tab-close {
    position: absolute;
    top: -12px;
    left: 100%;
    width: 24px;
    height: 24px;
    margin-left: -10px;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    color: #fff;
    background: #1d1d1f;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
}

/* A bigger touch target than the 24px circle looks. */
.pc-offer .pc-offer__tab-close::after {
    content: "";
    position: absolute;
    inset: -10px;
}

html.pc-offer-open {
    overflow: hidden;
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
    .pc-offer__dialog {
        grid-template-columns: minmax(0, 1fr);
        max-width: 420px;
    }

    .pc-offer__media {
        min-height: 0;
        height: 120px;
    }

    .pc-offer__logo {
        top: 50%;
        width: 96px;
        transform: translate(-50%, -50%);
    }

    .pc-offer__media::after {
        background: rgba(38, 33, 70, 0.7);
    }

    .pc-offer .pc-offer__close {
        color: #fff;
    }

    .pc-offer .pc-offer__close:hover {
        color: #fff;
        background: rgba(255, 255, 255, 0.18);
    }

    .pc-offer__dialog--plain .pc-offer__close {
        color: #6b6b6b;
    }

    .pc-offer__body {
        padding: 24px 20px 22px;
    }

    .pc-offer__eyebrow {
        font-size: 17px;
    }

    .pc-offer .pc-offer__title {
        font-size: 25px;
    }

    .pc-offer .pc-offer__tab-open {
        padding: 10px 6px;
        font-size: 12px;
    }
}

@keyframes pc-offer-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pc-offer-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .pc-offer__overlay,
    .pc-offer__dialog {
        animation: none;
    }

    .pc-offer .pc-offer__submit {
        transition: none;
    }
}

/* The confirmation heading takes focus so screen readers announce it; it is
   not a control, so it does not need the theme's focus ring. */
.pc-offer .pc-offer__title:focus {
    outline: none;
}

/* On a phone the page gutter is narrower than the vertical tab, which would
   sit on top of the first letters of the text. There it becomes a small pill
   in the bottom-left corner, opposite the chat button. */
@media (max-width: 640px) {
    .pc-offer__tab {
        top: auto;
        bottom: 18px;
        left: 12px;
        transform: none;
    }

    .pc-offer .pc-offer__tab-open {
        max-width: 62vw;
        max-height: none;
        padding: 11px 16px;
        writing-mode: horizontal-tb;
        font-size: 13px;
        border-radius: 32px;
    }

    .pc-offer .pc-offer__tab-close {
        top: -10px;
        left: auto;
        right: -8px;
        margin-left: 0;
    }
}
