.payment-confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-content h3 {
    margin: 0 0 1.5rem 0;
    color: #333;
    text-align: center;
}

.plan-details {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.plan-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.plan-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 1rem;
}

.billing-notice {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-cancel, .btn-confirm {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
}

.btn-confirm {
    background: #007bff;
    color: white;
}

.btn-confirm:hover {
    background: #0056b3;
}

.payment-error {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 4px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Inline validation errors injected by payment-processor.js into the billing
   address modal (was hardcoded via element.style.cssText). */
.billing-modal-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Dark mode — scoped to this component's markup so the generic class names
   (.modal-content, .plan-details) don't leak onto other modals site-wide. */
[data-theme="dark"] .payment-confirmation-modal .modal-content {
    background: var(--dashboard-bg-card, #1e293b);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .payment-confirmation-modal .modal-content h3,
[data-theme="dark"] .payment-confirmation-modal .plan-name {
    color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .payment-confirmation-modal .plan-details {
    background: var(--dashboard-bg-elevated, #334155);
}

[data-theme="dark"] .payment-confirmation-modal .plan-price {
    color: #60a5fa;
}

[data-theme="dark"] .payment-confirmation-modal .billing-notice {
    color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .payment-error,
[data-theme="dark"] .billing-modal-error {
    background: var(--alert-error-bg, rgba(239, 68, 68, 0.15));
    border-color: var(--alert-error-border, rgba(239, 68, 68, 0.3));
    color: var(--alert-error-text, #fca5a5);
}

/* Phones: the modal + its actions were fixed-width and side-by-side, which
   cramped or overflowed the confirm/cancel buttons under ~480px and could block
   a mobile payment. Stack the actions full-width with accessible tap targets. */
@media (max-width: 480px) {
    .modal-content {
        padding: 1.25rem;
        width: 94%;
        max-width: none;
    }
    .plan-details {
        padding: 1rem;
    }
    .modal-actions {
        flex-direction: column-reverse; /* primary "confirm" sits on top */
        gap: 0.625rem;
    }
    .btn-cancel,
    .btn-confirm {
        width: 100%;
        padding: 0.875rem 1rem;
        min-height: 44px; /* accessible touch target */
        font-size: 1rem;
    }
}