:root {
    --ci-brand-red: #D90429;
    --ci-brand-dark: #1b1b1b;
    --ci-brand-grey: #333333;
}

body.ci-modal-open {
    overflow: hidden;
}

.ci-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ci-auth-modal[hidden] {
    display: none !important;
}

.ci-auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.ci-auth-modal__card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    padding: 2rem 1.75rem 1.75rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.ci-auth-modal__card--wide {
    max-width: 520px;
}

.ci-auth-modal__card--tall {
    max-width: 540px;
    text-align: left;
    max-height: min(90vh, 640px);
    overflow-y: auto;
}

.ci-auth-modal__card--tall .ci-auth-modal__title {
    text-align: left;
}

.ci-auth-modal__text--muted {
    color: #6b7280;
    font-size: 0.88rem;
}

.ci-auth-modal__text a {
    color: var(--ci-brand-red);
    font-weight: 700;
    text-decoration: underline;
}

.ci-auth-modal__text a:hover {
    color: #b80322;
}

.ci-auth-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    background: #fff;
    color: var(--ci-brand-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

.ci-auth-modal__close:hover {
    border-color: var(--ci-brand-grey);
    background: #f9fafb;
}

.ci-auth-modal__title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ci-brand-dark);
    margin: 0 0 1rem;
    line-height: 1.35;
    padding-right: 2rem;
}

.ci-auth-modal__text {
    font-size: 0.92rem;
    color: #4b5563;
    line-height: 1.55;
    margin: 0 0 0.85rem;
}

.ci-auth-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 1.25rem;
}

.ci-auth-modal__btn {
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.88rem;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.ci-auth-modal__btn--primary {
    background: var(--ci-brand-red);
    color: #fff;
    border: 2px solid var(--ci-brand-red);
}

.ci-auth-modal__btn--primary:hover {
    background: #b80322;
    color: #fff;
}

.ci-auth-modal__btn--secondary {
    background: #fff;
    color: var(--ci-brand-dark);
    border: 2px solid var(--ci-brand-dark);
}

.ci-auth-modal__btn--secondary:hover {
    background: var(--ci-brand-dark);
    color: #fff;
}

/* Side-by-side on PC; stack only on phone. Must come after .ci-auth-modal__actions. */
.ci-auth-modal__actions.ci-auth-modal__actions--stack-sm {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
}

.ci-auth-modal__actions--stack-sm .ci-auth-modal__btn {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .ci-auth-modal__actions.ci-auth-modal__actions--stack-sm {
        flex-direction: column;
    }

    .ci-auth-modal__actions--stack-sm .ci-auth-modal__btn {
        flex: none;
        width: 100%;
        white-space: normal;
        padding: 10px 14px;
        font-size: 0.86rem;
    }
}

.ci-checkout-gate__payments {
    display: block;
    max-width: 72%;
    height: auto;
    margin: 0.35rem auto 0;
}

.ci-auth-modal__payments-text {
    font-size: 0.82rem;
    color: #4b5563;
    line-height: 1.55;
    margin: 1.1rem 0 0.65rem;
    text-align: left;
}

.checkout-gate-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: #fff;
}

.checkout-gate-card {
    max-width: 520px;
    width: 100%;
    text-align: center;
    padding: 2rem 1.5rem;
}

.checkout-gate-card h1 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--ci-brand-dark);
    margin: 0 0 1rem;
}

.checkout-gate-lead,
.checkout-gate-reassure {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 0.85rem;
}

.checkout-gate-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 1.25rem;
}

.checkout-gate-back {
    margin-top: 1.5rem;
    font-size: 0.88rem;
}

.checkout-gate-back a {
    color: var(--ci-brand-grey);
    text-decoration: none;
}

.checkout-gate-back a:hover {
    color: var(--ci-brand-red);
}
