/*
 * Stripe checkout button and account page extras (added October 2026).
 * Loaded on every page by includes/header.php, after style.css.
 *
 * Mobile first: on phones the buy button fills the panel width with a tall,
 * easy tap target and text that can wrap. On wider screens it keeps the same
 * look but stops at 420px wide so it lines up with the login form.
 */

.buy-form {
    margin-top: 1rem;
}

.btn-buy {
    display: flex;
    width: 100%;
    max-width: 420px;
    min-height: 52px;
    padding: 0.85rem 1.25rem;
    font-size: 1.05rem;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    box-shadow: 0 6px 16px rgba(196, 30, 58, 0.25);
}

.btn-buy:hover {
    transform: translateY(-1px);
}

.btn-buy:disabled {
    opacity: 0.75;
    cursor: wait;
    transform: none;
}

/* Busy buttons (assets/js/main.js, added October 8, 2026): after a click the
   button is disabled and shows a spinning circle plus "Sending..." (login)
   or "Opening secure checkout..." (buy button). Used on any .btn. */
.btn.is-busy,
.btn.is-busy:disabled {
    gap: 0.6rem;
    opacity: 0.85;
    cursor: wait;
    transform: none;
}

.btn-spinner {
    display: inline-block;
    flex: 0 0 auto;
    width: 1.05em;
    height: 1.05em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .btn-spinner { animation-duration: 1.6s; }
}

.buy-hint {
    margin-top: 0.6rem;
    margin-bottom: 0;
}

/* Email overlay before Stripe checkout. */
.enroll-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
}

.enroll-modal[hidden] {
    display: none;
}

.enroll-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 43, 74, 0.55);
}

.enroll-card {
    position: relative;
    z-index: 1;
    width: calc(100% - 1.5rem);
    max-width: 440px;
    margin: 10vh auto 0;
    background: #fff;
    border-radius: 14px;
    padding: 1.6rem 1.35rem 1.25rem;
    box-shadow: 0 18px 50px rgba(26, 43, 74, 0.28);
}

.enroll-card h2 {
    margin: 0 2rem 0.5rem 0;
}

.enroll-close {
    position: absolute;
    top: 0.6rem;
    right: 0.7rem;
    border: 0;
    background: transparent;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--color-navy);
    cursor: pointer;
}

.enroll-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

body.enroll-open {
    overflow: hidden;
}

.account-email-list {
    margin: 0.4rem 0 0;
    padding: 0;
    list-style: none;
}

.account-email-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-top: 1px solid var(--color-border);
}

.account-email-list form {
    margin: 0;
}

.account-email-list button {
    font-size: 0.85rem;
}

/* My Account: "nothing to renew" note and payment history.
   (.account-renew kept its old name from the 1-year plan.) */
.account-renew {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
}

.account-renew > p {
    margin-top: 0;
    color: var(--color-muted);
}

/* Buy button area when the visitor already has access (buy-button.php) */
.already-member-note {
    margin: 0 0 0.75rem;
}

.payment-history-title {
    margin: 1.75rem 0 0.5rem;
    font-size: 1.1rem;
}

.payment-history {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
}

.payment-history li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border);
}

@media (max-width: 480px) {
    .btn-buy {
        max-width: none;
        font-size: 1rem;
    }

    .payment-history li {
        flex-direction: column;
    }
}
