/* ─── Checkout modal overlay ────────────────────────────────────────────────── */

.checkout-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 800;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 16px 40px;
    overflow-y: auto;
}

.checkout-overlay[hidden] {
    display: none;
}

.checkout-modal {
    background: #151923;
    border: 1px solid #2e404e;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    padding: 32px 36px 36px;
    position: relative;
    margin: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.checkout-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
}

/* ─── Title ──────────────────────────────────────────────────────────────────── */

.checkout-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 24px;
}

/* ─── Order summary ──────────────────────────────────────────────────────────── */

.checkout-summary {
    background: #0f131b;
    border: 1px solid #2e404e;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 28px;
}

.checkout-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.55);
    padding-bottom: 8px;
}

.checkout-summary-row:last-child {
    padding-bottom: 0;
    padding-top: 8px;
    border-top: 1px solid #2e404e;
    font-size: 16px;
    font-weight: 700;
    color: #00e4fe;
}

.checkout-summary-row span:last-child {
    color: #fff;
    font-weight: 500;
}

.checkout-summary-row:last-child span:last-child {
    color: #00e4fe;
}

/* ─── Section divider ────────────────────────────────────────────────────────── */

.checkout-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    margin: 0 0 16px;
}

.checkout-section-label--billing {
    margin-top: 16px;
}

/* ─── Logged-in state bar ────────────────────────────────────────────────────── */

.checkout-logged-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #0f131b;
    border: 1px solid #2e404e;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.checkout-logged-in-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.checkout-logged-in-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.checkout-logged-in-email {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkout-logout-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    padding: 5px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.checkout-logout-btn:hover {
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

/* ─── Billing toggle ─────────────────────────────────────────────────────────── */

.checkout-billing-toggle {
    margin-bottom: 20px;
}

.checkout-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkout-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #00adef;
    cursor: pointer;
}

.checkout-checkbox-label span {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}

/* ─── Form fields ────────────────────────────────────────────────────────────── */

.checkout-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.checkout-field:last-child,
.checkout-field-row .checkout-field {
    margin-bottom: 0;
}

.checkout-field label {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.92);
    font-weight: 400;
}

.checkout-optional {
    font-weight: 400;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
}

.checkout-field input,
.checkout-field select {
    background: #0f131b;
    border: 1px solid #2e404e;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.checkout-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='8' viewBox='0 0 9 8'%3E%3Crect x='0' y='0' width='3' height='3' fill='rgba(255,255,255,0.35)'/%3E%3Crect x='6' y='0' width='3' height='3' fill='rgba(255,255,255,0.35)'/%3E%3Crect x='3' y='5' width='3' height='3' fill='rgba(255,255,255,0.35)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.checkout-field input:focus,
.checkout-field select:focus {
    border-color: #00adef;
}

.checkout-field input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.checkout-field input.is-invalid,
.checkout-field select.is-invalid {
    border-color: #e05252;
}

/* Row layout for postal + city */
.checkout-field-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    margin-bottom: 18px;
}

/* Billing section spacing */
#checkoutBillingSection .checkout-field-row {
    margin-bottom: 18px;
}

#checkoutBillingSection .checkout-field:last-of-type {
    margin-bottom: 0;
}

/* ─── Terms checkbox ─────────────────────────────────────────────────────────── */

.checkout-terms {
    margin-top: 20px;
    margin-bottom: 4px;
    padding-top: 20px;
    border-top: 1px solid #2e404e;
}

.checkout-terms-label span {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    line-height: 1.4;
}

.checkout-terms-required {
    margin: 0 0 0 32px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
}

.checkout-terms-label a {
    color: #00adef;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.checkout-terms-label a:hover {
    color: #33c7ff;
}

/* ─── Error message ──────────────────────────────────────────────────────────── */

.checkout-error {
    background: rgba(224, 82, 82, 0.12);
    border: 1px solid rgba(224, 82, 82, 0.4);
    border-radius: 8px;
    color: #ff8080;
    font-size: 13px;
    padding: 10px 14px;
    margin-top: 16px;
    margin-bottom: 4px;
    display: none;
}

.checkout-error.is-visible {
    display: block;
}

/* ─── Pay button ─────────────────────────────────────────────────────────────── */

.checkout-pay-btn {
    margin-top: 24px;
    width: 100%;
    background: #00adef;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    padding: 14px 24px;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.checkout-pay-btn:hover:not(:disabled) {
    background: #0095d0;
}

.checkout-pay-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkout-pay-btn .btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: co-spin 0.7s linear infinite;
    display: none;
}

.checkout-pay-btn.is-loading .btn-spinner {
    display: block;
}

@keyframes co-spin {
    to { transform: rotate(360deg); }
}

/* ─── Pay footer (Mollie note + payment method logos) ────────────────────────── */

.checkout-mollie-note {
    margin-top: 14px;
    margin-bottom: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
}

.checkout-payment-methods {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.checkout-method-logo {
    height: 22px;
    width: auto;
    opacity: 0.55;
    transition: opacity 0.15s;
}

.checkout-method-logo:hover {
    opacity: 0.85;
}

/* ─── Terms content modal ────────────────────────────────────────────────────── */

.terms-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 850;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.terms-modal-overlay[hidden] {
    display: none;
}

.terms-modal {
    background: #151923;
    border: 1px solid #2e404e;
    border-radius: 16px;
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}

.terms-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #2e404e;
    flex-shrink: 0;
}

.terms-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.terms-modal-close {
    position: relative;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
}

.terms-modal-body {
    overflow-y: auto;
    padding: 20px 24px;
    flex: 1;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.65;
}

.terms-modal-body h1,
.terms-modal-body h2,
.terms-modal-body h3 {
    color: #fff;
    margin-top: 1.4em;
    margin-bottom: 0.5em;
}

.terms-modal-body h1:first-child,
.terms-modal-body h2:first-child {
    margin-top: 0;
}

.terms-modal-body a {
    color: #00adef;
}

.terms-modal-body .subnav {
    display: none;
}

.terms-modal-loading {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    text-align: center;
    padding: 16px 0;
    margin: 0;
}

.terms-modal-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #2e404e;
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
}

.terms-modal-accept {
    background: #00adef;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    padding: 10px 22px;
    cursor: pointer;
    transition: background 0.15s;
}

.terms-modal-accept:hover {
    background: #0095d0;
}

/* ─── Payment result spinner ─────────────────────────────────────────────────── */

.payment-result-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(0, 173, 239, 0.2);
    border-top-color: #00adef;
    border-radius: 50%;
    animation: co-spin 0.75s linear infinite;
    margin: 0 auto;
}

/* ─── Post-payment result modal ──────────────────────────────────────────────── */

.payment-result-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.payment-result-overlay[hidden] {
    display: none;
}

.payment-result-modal {
    background: #151923;
    border: 1px solid #2e404e;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    padding: 36px 36px 32px;
    text-align: center;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.payment-result-icon {
    font-size: 48px;
    margin-bottom: 16px;
    line-height: 1;
}

.payment-result-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
}

.payment-result-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin: 0 0 24px;
}

.payment-result-btn[hidden] {
    display: none;
}

.payment-result-btn {
    display: inline-block;
    background: #00adef;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    padding: 12px 28px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.payment-result-btn:hover {
    background: #0095d0;
    color: #fff;
}

.payment-result-btn--secondary {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
}

.payment-result-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.9);
}
