/* Farin Wata Secure Payment Portal Styles */
/* Design Philosophy: Professional, Trustworthy, Banking-Grade. Avoid "Game/AI" aesthetics. */

:root {
    --fw-orange: #fd6711;
    --fw-teal: #13c5d0;
    --fw-dark: #1f1f1f;
    --fw-gray: #f4f6f8;
    --fw-border: #e1e4e8;
    --fw-success: #27ae60;
    --fw-font: 'DM Sans', sans-serif;
}

/* Modal Overlay - Glassmorphism but subtle/professional */
.fw-payment-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(31, 31, 31, 0.75);
    backdrop-filter: blur(8px);
    /* Modern blur effect */
    z-index: 9999;
    display: none;
    /* Hidden by default */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fw-payment-overlay.active {
    opacity: 1;
    display: flex;
}

/* Main Modal Card */
.fw-payment-modal {
    background: #ffffff;
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
    font-family: var(--fw-font);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.fw-payment-overlay.active .fw-payment-modal {
    transform: translateY(0);
}

/* Header Section */
.fw-modal-header {
    background: #ffffff;
    padding: 24px 30px;
    border-bottom: 1px solid var(--fw-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fw-modal-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--fw-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.fw-secure-badge {
    background: #eefff5;
    color: var(--fw-success);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fw-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.fw-close-btn:hover {
    color: var(--fw-orange);
}

/* Body Section */
.fw-modal-body {
    padding: 30px;
    min-height: 300px;
    /* Prevent layout shift */
}

/* Form Styles */
.fw-form-group {
    margin-bottom: 20px;
}

.fw-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.fw-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--fw-border);
    border-radius: 6px;
    font-size: 15px;
    color: var(--fw-dark);
    transition: border-color 0.2s;
    font-family: var(--fw-font);
}

.fw-form-input:focus {
    outline: none;
    border-color: var(--fw-teal);
    box-shadow: 0 0 0 3px rgba(19, 197, 208, 0.1);
}

.fw-input-row {
    display: flex;
    gap: 15px;
}

/* Payment Method Selection */
.fw-payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.fw-method-card {
    border: 1px solid var(--fw-border);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.fw-method-card:hover {
    border-color: var(--fw-teal);
    background: #fcfcfc;
}

.fw-method-card.selected {
    border-color: var(--fw-orange);
    background: rgba(253, 103, 17, 0.05);
    box-shadow: 0 4px 12px rgba(253, 103, 17, 0.1);
}

.fw-method-icon {
    font-size: 24px;
    margin-bottom: 8px;
    color: #555;
}

.fw-method-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fw-dark);
}

/* Buttons */
.fw-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--fw-orange) 0%, #e65100 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.fw-btn-primary:active {
    transform: scale(0.98);
}

/* Loading State (Simulation) */
.fw-loading-state {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.fw-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--fw-teal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.fw-loading-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--fw-dark);
    margin-bottom: 8px;
}

.fw-loading-subtext {
    font-size: 13px;
    color: #888;
}

/* Crypto Display State */
.fw-crypto-state {
    display: none;
    text-align: center;
}

.fw-timer-banner {
    background: #fff8e1;
    color: #d35400;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.fw-qr-container {
    background: white;
    padding: 15px;
    border: 1px solid var(--fw-border);
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.fw-qr-image {
    width: 150px;
    height: 150px;
    /* Placeholder for generated QR styling */
    background-color: #f0f0f0;
}

.fw-address-box {
    background: var(--fw-gray);
    padding: 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    color: #333;
    word-break: break-all;
    position: relative;
    border: 1px solid #dcdcdc;
    margin-bottom: 25px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fw-copy-btn {
    background: white;
    border: 1px solid #ccc;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
    color: #555;
}

.fw-ref-id {
    font-size: 12px;
    color: #999;
    margin-top: -15px;
    margin-bottom: 20px;
}

/* Verification State */
.fw-verification-state {
    display: none;
    text-align: center;
    padding-top: 20px;
}

.fw-scan-animation {
    height: 4px;
    width: 100%;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    margin: 20px 0;
}

.fw-scan-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: var(--fw-teal);
    animation: scan 2s ease-in-out infinite;
    border-radius: 2px;
}

@keyframes scan {
    0% {
        left: -30%;
    }

    100% {
        left: 100%;
    }
}

.fw-log-console {
    background: #111;
    color: #0f0;
    font-family: monospace;
    font-size: 11px;
    padding: 15px;
    border-radius: 6px;
    text-align: left;
    height: 100px;
    overflow-y: hidden;
    margin-bottom: 20px;
    opacity: 0.9;
}

.fw-log-line {
    margin-bottom: 4px;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Success State */
.fw-success-state {
    display: none;
    text-align: center;
    padding: 30px 0;
}

.fw-success-icon {
    font-size: 50px;
    color: var(--fw-success);
    margin-bottom: 20px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Footer of modal */
.fw-modal-footer {
    background: #fdfdfd;
    padding: 15px 30px;
    border-top: 1px solid var(--fw-border);
    font-size: 11px;
    color: #aaa;
    text-align: center;
}