/* ═══════════════════════════════════════════════════════════════════════
   payment.css — Payment settings admin UI + frontend Stripe Elements
   RUN_ID: QLB-PAYMENT-SETTINGS-TAB-01
   Loaded via wp_enqueue_style() — NO inline CSS anywhere.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Admin payment settings tab ─────────────────────────────────── */

.qlb-payment-settings-wrap {
    max-width: 780px;
    margin-top: 24px;
}

.qlb-pay-notice {
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 14px;
}
.qlb-pay-notice-success {
    background: #edfcf2;
    border: 1px solid #2ecc71;
    color: #1a7a43;
}

/* Section card */
.qlb-pay-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.qlb-pay-section-soon {
    opacity: .75;
}

.qlb-pay-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
}
.qlb-pay-body {
    padding: 20px;
}

/* Logos */
.qlb-pay-logo {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .5px;
    padding: 4px 12px;
    border-radius: 5px;
}
.qlb-pay-logo-stripe {
    background: #635bff;
    color: #fff;
}
.qlb-pay-logo-paypal {
    background: #003087;
    color: #fff;
}
.qlb-pay-badge-soon {
    font-size: 12px;
    font-weight: 600;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: 30px;
    padding: 3px 12px;
}

/* Toggle switch */
.qlb-pay-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.qlb-pay-toggle input[type="checkbox"] {
    display: none;
}
.qlb-pay-toggle-track {
    width: 40px;
    height: 22px;
    background: #ccc;
    border-radius: 11px;
    position: relative;
    transition: background .2s;
    flex-shrink: 0;
}
.qlb-pay-toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
}
.qlb-pay-toggle input:checked + .qlb-pay-toggle-track {
    background: #635bff;
}
.qlb-pay-toggle input:checked + .qlb-pay-toggle-track::after {
    transform: translateX(18px);
}
.qlb-pay-toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* Rows */
.qlb-pay-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}
.qlb-pay-row:last-child {
    margin-bottom: 0;
}
.qlb-pay-row-info {
    background: #f4f4f4;
    border-radius: 6px;
    padding: 10px 14px;
}

.qlb-pay-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}
.qlb-pay-hint {
    font-size: 11px;
    font-weight: 400;
    color: #888;
    margin-left: 6px;
}
.qlb-pay-stored {
    font-size: 11px;
    color: #2ecc71;
    font-weight: 600;
}

.qlb-pay-input {
    width: 100%;
    max-width: 480px;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: monospace;
    color: #333;
    background: #fafafa;
    transition: border-color .2s, box-shadow .2s;
}
.qlb-pay-input:focus {
    outline: none;
    border-color: #635bff;
    box-shadow: 0 0 0 3px rgba(99,91,255,.15);
    background: #fff;
}

.qlb-pay-radios {
    display: flex;
    gap: 20px;
}
.qlb-pay-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.qlb-pay-code {
    display: block;
    background: #1e1e1e;
    color: #9cdcfe;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-family: monospace;
    word-break: break-all;
    margin-top: 4px;
}

/* Actions */
.qlb-pay-actions {
    margin-top: 8px;
}
.qlb-pay-save-btn {
    background: #635bff !important;
    border-color: #4c45cc !important;
    font-weight: 700 !important;
    padding: 8px 20px !important;
    height: auto !important;
    border-radius: 6px !important;
    font-size: 14px !important;
}
.qlb-pay-save-btn:hover {
    background: #4c45cc !important;
}

/* ── Design page tab navigation ────────────────────────────────── */

.qlb-design-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 28px;
    margin-top: 8px;
}
.qlb-design-tab-link {
    display: inline-block;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}
.qlb-design-tab-link:hover {
    color: #635bff;
}
.qlb-design-tab-link.qlb-tab-active {
    color: #635bff;
    border-bottom-color: #635bff;
}

/* ── Frontend Stripe Elements container ───────────────────────── */

#qlb-stripe-container {
    min-height: 44px;
    margin: 18px 0 14px;
}

/* Stripe Payment Element mounts here — do not add width/overflow */

.qlb-tc-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0;
}
.qlb-tc-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    flex-shrink: 0;
    accent-color: #635bff;
    cursor: pointer;
}
.qlb-tc-label {
    font-size: 13px;
    color: #444;
    line-height: 1.5;
}
.qlb-tc-label a {
    color: #635bff;
}

#qlb-tc-error {
    display: block;
    color: #e53e3e;
    font-size: 12px;
    margin: -8px 0 10px;
}

#qlb-stripe-pay-row {
    margin-top: 18px;
}

#qlb-stripe-pay-btn {
    width: 100%;
    padding: 14px 20px;
    background: #635bff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, opacity .2s;
    letter-spacing: .3px;
}
#qlb-stripe-pay-btn:hover:not(:disabled) {
    background: #4c45cc;
}
#qlb-stripe-pay-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}
#qlb-stripe-pay-btn.qlb-processing {
    opacity: .7;
    cursor: wait;
}

#qlb-stripe-status {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    min-height: 18px;
    color: #e53e3e;
}
#qlb-stripe-status.qlb-stripe-ok {
    color: #2ecc71;
    font-weight: 600;
}

/* ── Payment success banner (step 5) ─────────────────────────── */

.qlb-payment-success {
    background: #edfcf2;
    border: 2px solid #2ecc71;
    border-radius: 10px;
    padding: 24px 28px;
    text-align: center;
    margin-top: 20px;
}
.qlb-payment-success h3 {
    color: #1a7a43;
    font-size: 22px;
    margin: 0 0 10px;
}
.qlb-payment-success p {
    color: #333;
    margin: 0 0 6px;
    font-size: 14px;
}
.qlb-payment-success .qlb-pay-ref {
    font-family: monospace;
    font-weight: 700;
    font-size: 16px;
    color: #635bff;
    background: #f4f2ff;
    padding: 4px 12px;
    border-radius: 4px;
}

/* qlb-hidden — Vanilla JS step 5 panel control
   Stripe cannot mount Elements into a display:none container.
   qlbShowPaymentStep() removes this class BEFORE calling qlbInitStripe(). */
.qlb-hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   QLB-UX-LOADER-01 — Search Loader Overlay
   ═══════════════════════════════════════════════════════════════ */

/* Full-page overlay — sits above q-card, below nav */
.qlb-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.72);
    align-items: center;
    justify-content: center;
}
.qlb-search-overlay.qlb-overlay-active {
    display: flex;
}

/* White card centred */
.qlb-search-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 36px 40px 32px;
    width: min(420px, 90vw);
    text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}

/* Rotating ring icon */
.qlb-search-spinner {
    width: 56px;
    height: 56px;
    border: 6px solid #e2e8f0;
    border-top-color: #7B2FBE;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: qlb-spin 0.9s linear infinite;
}
@keyframes qlb-spin {
    to { transform: rotate(360deg); }
}

/* Progress bar track */
.qlb-bar-track {
    height: 8px;
    border-radius: 99px;
    background: #e2e8f0;
    overflow: hidden;
    margin: 16px 0 12px;
}

/* Animated fill — 3s (QLB-UX-LOADER-FIX-01: was 2.5s, too fast) */
.qlb-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, #7B2FBE 0%, #a855f7 100%);
    transition: none;
}
.qlb-bar-fill.qlb-bar-run {
    width: 100%;
    transition: width 3.0s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Cycling status text */
.qlb-search-status {
    font-size: 15px;
    font-weight: 700;
    color: #475569;
    min-height: 22px;
    transition: opacity 0.3s ease;
}

/* Success state text */
.qlb-search-success {
    font-size: 16px;
    font-weight: 800;
    color: #16a34a;
    margin-top: 4px;
    min-height: 22px;
}

/* ═══════════════════════════════════════════════════════════════
   QLB-UX-LOADER-01 — Payment Processing Overlay
   ═══════════════════════════════════════════════════════════════ */

.qlb-payment-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9100;
    background: rgba(0, 0, 0, 0.88);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 24px;
}
.qlb-payment-overlay.qlb-overlay-active {
    display: flex;
}

/* Bold caps label */
.qlb-pay-processing-label {
    font-size: clamp(22px, 5vw, 36px);
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #ffffff;
    text-align: center;
    text-transform: uppercase;
    line-height: 1.1;
}

/* Stripe-purple pulsing ring */
.qlb-pay-spinner {
    width: 72px;
    height: 72px;
    border: 8px solid rgba(255,255,255,0.15);
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: qlb-spin 1s linear infinite;
}

/* Sub-text */
.qlb-pay-sub {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    text-align: center;
    max-width: 280px;
}
