/**
 * VoiceFlow — Modal potwierdzenia zakupu (styling).
 *
 * PHP port target: tools/voiceflow/checkout-modal.php
 * Source parity: VidFlow's static/buy_credits_v2.css:505-673 (2026-06-30 snapshot)
 * with `.bcv2-modal-*` → `.vf-modal-*` prefix rewrite for BoostItUp naming.
 *
 * Structural + visual parity preserved:
 *   - fixed overlay with blur backdrop
 *   - scrollable modal box with gradient background
 *   - identical spacing (32px horizontal padding for sections)
 *   - PayU indigo (#a5b4fc) + Przelewy24 red (#f87171) card logos
 *   - "no default provider" state — user must click
 *   - CTA disabled until consents + invoice-valid + provider picked
 *
 * VoiceFlow product-specific additions (marked in code):
 *   - `.vf-modal-buyer-section` — guest checkout fields (VidFlow assumes login+profile)
 *   - fonts: reuse existing Outfit from /fonts/fonts.css (already loaded on VF page)
 */

/* ============================================================
   Overlay + box
   ============================================================ */

.vf-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    z-index: 10000;
    overflow-y: auto;
}
.vf-modal-overlay[aria-hidden="false"] {
    display: flex;
}
.vf-modal-overlay[aria-hidden="true"] {
    display: none;
}

.vf-modal-box {
    width: 100%;
    max-width: 520px;
    background: linear-gradient(160deg, #17172a, #1e1e35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
    color: #e5e5f0;
    position: relative;
    font-family: 'Outfit', system-ui, sans-serif;
    line-height: 1.5;
    padding-bottom: 8px;
}

/* Close X — top-right */
.vf-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: #a5a5b8;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.vf-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ============================================================
   Header + item display
   ============================================================ */

.vf-modal-header {
    padding: 24px 32px 12px;
}
.vf-modal-eyebrow {
    font-size: 11px;
    font-weight: 700;
    color: #ff6f0f;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.vf-modal-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    line-height: 1.25;
}

.vf-modal-item {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
    align-items: center;
    margin: 8px 32px 20px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}
.vf-modal-item-coin {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ff6f0f, #b23600);
    box-shadow: 0 6px 20px rgba(255, 111, 15, 0.4);
}
.vf-modal-item-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}
.vf-modal-item-fc {
    font-size: 12px;
    color: #a5a5b8;
    margin-top: 2px;
}
.vf-modal-item-price {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
}
.vf-modal-item-price .pln {
    font-size: 14px;
    color: #a5a5b8;
    margin-left: 2px;
}

/* ============================================================
   Buyer data (VoiceFlow guest-checkout section)
   ============================================================ */

.vf-modal-buyer-section {
    padding: 0 32px 12px;
}
.vf-modal-field-row {
    display: block;
    margin-bottom: 10px;
}
.vf-modal-field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #c7c7dc;
    margin-bottom: 4px;
}
.vf-modal-buyer-section input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font: 400 14px 'Outfit', system-ui, sans-serif;
    box-sizing: border-box;
}
.vf-modal-buyer-section input:focus {
    outline: none;
    border-color: #ff6f0f;
    background: rgba(255, 255, 255, 0.06);
}
.vf-modal-buyer-section input.vf-field-invalid,
.vf-modal-buyer-section input.vf-field-invalid:focus {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}
.vf-modal-field-error {
    display: block;
    font-size: 12px;
    color: #fca5a5;
    margin-top: 4px;
    padding-left: 2px;
    line-height: 1.4;
}
.vf-modal-field-error[hidden] {
    display: none;
}
.vf-req {
    color: #ff6f0f;
}

/* ============================================================
   Section titles + consent checkboxes
   ============================================================ */

.vf-modal-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 0 8px;
    position: relative;
}
.vf-modal-section-title::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 40%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.08));
}

.vf-modal-consents {
    padding: 0 32px 12px;
}

.vf-modal-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background 0.15s, border-color 0.15s;
}
.vf-modal-checkbox-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 111, 15, 0.3);
}
.vf-modal-checkbox-row input[type="checkbox"] {
    margin-top: 2px;
    accent-color: #ff6f0f;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.vf-modal-checkbox-text {
    font-size: 13px;
    color: #d5d5e8;
    line-height: 1.5;
    flex: 1;
}
.vf-modal-checkbox-text a {
    color: #ff9a5c;
    text-decoration: underline;
}

/* ============================================================
   VAT invoice section
   ============================================================ */

.vf-modal-invoice-section {
    padding: 0 32px 12px;
}
.vf-modal-invoice-hint {
    display: block;
    color: #777;
    font-size: 11px;
    margin-top: 3px;
}
.vf-modal-invoice-warning {
    display: none;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.10);
    border-left: 3px solid #fbbf24;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
}
.vf-modal-invoice-warning.vf-visible {
    display: block;
}

/* ============================================================
   Payment method selector
   ============================================================ */

.vf-modal-payment-method {
    padding: 0 32px 12px;
}
.vf-modal-payment-method-title {
    font: 700 12px 'Outfit', system-ui, sans-serif;
    color: #9ca3af;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0 0 8px;
}
.vf-modal-payment-method-cards {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: stretch;
}
.vf-modal-method-card {
    flex: 1 1 0;
    min-width: 180px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    color: #e5e5f0;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.vf-modal-method-card:hover {
    border-color: rgba(255, 111, 15, 0.4);
    background: rgba(255, 255, 255, 0.04);
}
.vf-modal-method-card[aria-pressed="true"] {
    border-color: #ff6f0f;
    background: rgba(255, 111, 15, 0.08);
}
.vf-modal-method-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.vf-modal-payu-logo {
    font: 800 18px 'Outfit', system-ui, sans-serif;
    color: #a5b4fc;
}
.vf-modal-p24-logo {
    font: 800 18px 'Outfit', system-ui, sans-serif;
    color: #f87171;
}
.vf-modal-method-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
    transition: border-color 0.15s, background 0.15s;
}
.vf-modal-method-card[aria-pressed="true"] .vf-modal-method-check {
    border-color: #ff6f0f;
    background: #ff6f0f;
}
.vf-modal-method-card[aria-pressed="true"] .vf-modal-method-check::after {
    content: '';
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
}
.vf-modal-method-desc {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
    color: #9ca3af;
}
.vf-modal-pay-methods {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.vf-modal-pay-method {
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: #d5d5e8;
}

/* ============================================================
   Actions (Cancel + Confirm CTA)
   ============================================================ */

.vf-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 32px 24px;
}
.vf-modal-cancel {
    padding: 12px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #a5a5b8;
    font: 600 14px 'Outfit', system-ui, sans-serif;
    cursor: pointer;
    transition: background 0.15s;
    order: 2;
}
.vf-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}
.vf-modal-confirm {
    padding: 14px 24px;
    background: linear-gradient(135deg, #ff6f0f, #d94d00);
    border: none;
    border-radius: 10px;
    color: #fff;
    font: 800 15px 'Outfit', system-ui, sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: opacity 0.15s, transform 0.05s;
    order: 1;
}
.vf-modal-confirm:hover:not([disabled]) {
    transform: translateY(-1px);
}
.vf-modal-confirm[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   Utilities
   ============================================================ */

.vf-hidden {
    display: none;
}

/* Body scroll-lock class applied by JS when modal open */
body.vf-modal-open {
    overflow: hidden;
}

/* Error banner (populated by checkout.js when ?checkout_error= present in URL) */
.vf-modal-error-banner {
    margin: 8px 32px 12px;
    padding: 12px 14px;
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-left: 3px solid #ef4444;
    border-radius: 8px;
    color: #fca5a5;
    font-size: 13px;
    line-height: 1.5;
}
.vf-modal-error-banner[hidden] {
    display: none;
}
