/* KRW ↔ VND Exchange - Frontend Styles */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&display=swap');

.kve-wrapper {
    font-family: 'Be Vietnam Pro', sans-serif;
    max-width: 560px;
    margin: 30px auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    background: #fff;
}

/* Header */
.kve-header {
    background: linear-gradient(135deg, #0a3cff 0%, #c0392b 100%);
    padding: 30px 20px 24px;
    text-align: center;
    color: #fff;
}
.kve-flag-row {
    font-size: 2rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.kve-arrow-icon {
    font-size: 1.4rem;
    opacity: 0.9;
}
.kve-title {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.kve-subtitle {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.85;
}

/* Notice */
.kve-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 12px 16px;
    font-size: 0.875rem;
    color: #92400e;
    line-height: 1.5;
}
.kve-notice-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* Rates Display */
.kve-rates-display {
    display: flex;
    align-items: center;
    background: #f8faff;
    border-bottom: 1px solid #e8edf5;
    padding: 14px 20px;
    gap: 0;
}
.kve-rate-card {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.kve-rate-label { font-size: 0.78rem; color: #64748b; font-weight: 500; }
.kve-rate-eq { font-size: 0.75rem; color: #94a3b8; }
.kve-rate-value { font-size: 1rem; font-weight: 700; color: #1e3a8a; }
.kve-rate-divider { width: 1px; background: #dde4f0; height: 40px; margin: 0 16px; }

/* Form Box */
.kve-form-box {
    padding: 24px 24px 28px;
}

/* Direction Toggle */
.kve-direction-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
}
.kve-dir-btn {
    flex: 1;
    padding: 10px 8px;
    border: none;
    border-radius: 9px;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
    font-family: inherit;
}
.kve-dir-btn.active {
    background: #fff;
    color: #1e3a8a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Fields */
.kve-field { margin-bottom: 14px; }
.kve-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.kve-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.kve-input-wrap { position: relative; }
.kve-currency-badge {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #6b7280;
    font-weight: 600;
    pointer-events: none;
}
.kve-input {
    width: 100%;
    padding: 11px 14px 11px 32px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    color: #1e293b;
    background: #fff;
}
.kve-input:not(.kve-input-wrap .kve-input) { padding-left: 14px; }
.kve-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.kve-field:not(:first-of-type) .kve-input,
.kve-field-row .kve-input { padding-left: 14px; }

/* Fix: non-amount inputs don't have currency badge */
#kve_bank_account, #kve_account_name, #kve_email, #kve_phone {
    padding-left: 14px;
}

/* Result Box */
.kve-result-box {
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
    border: 2px solid #bfdbfe;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
}
.kve-result-label { font-size: 0.78rem; color: #6b7280; font-weight: 500; margin-bottom: 4px; }
.kve-result-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: #1e3a8a;
    letter-spacing: -0.5px;
}
.kve-result-currency { opacity: 0.6; font-size: 1.2rem; margin-right: 4px; }
.kve-result-fee { font-size: 0.78rem; color: #b45309; margin-top: 6px; font-weight: 600; }
.kve-result-rate { font-size: 0.75rem; color: #64748b; margin-top: 4px; }

/* Divider */
.kve-section-divider {
    display: flex;
    align-items: center;
    margin: 18px 0 14px;
    gap: 10px;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.kve-section-divider::before, .kve-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* Submit Button */
.kve-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s;
    letter-spacing: 0.2px;
}
.kve-submit-btn:hover {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(29,78,216,0.35);
}
.kve-submit-btn:active { transform: translateY(0); }

/* Error */
.kve-error {
    margin: 0 24px 20px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #b91c1c;
    font-size: 0.875rem;
}

/* Modal */
.kve-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.kve-modal-content {
    background: #fff;
    border-radius: 20px;
    padding: 36px 32px;
    text-align: center;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: kveModalIn 0.3s ease;
}
@keyframes kveModalIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}
.kve-modal-icon { font-size: 3rem; margin-bottom: 12px; }
.kve-modal-title { margin: 0 0 8px; font-size: 1.3rem; font-weight: 700; color: #1e293b; }
.kve-modal-msg { margin: 0 0 20px; color: #64748b; font-size: 0.9rem; line-height: 1.6; }
.kve-ticket-display {
    background: #f8faff;
    border: 2px dashed #bfdbfe;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}
.kve-ticket-label { font-size: 0.78rem; color: #6b7280; display: block; margin-bottom: 6px; font-weight: 600; }
.kve-ticket-code {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e3a8a;
    letter-spacing: 2px;
    font-family: monospace;
    margin-bottom: 10px;
}
.kve-copy-btn {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: background 0.2s;
}
.kve-copy-btn:hover { background: #dbeafe; }

/* Payment Info Box (trong modal thành công) */
.kve-payment-box {
    background: #fffbeb;
    border: 2px solid #fde68a;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
}
.kve-payment-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 10px;
    text-align: center;
}
.kve-payment-qr {
    display: block;
    width: 100%;
    max-width: 220px;
    margin: 0 auto 14px;
    border-radius: 8px;
    border: 1px solid #fde68a;
}
.kve-payment-lines {
    font-size: 0.85rem;
    color: #78350f;
    line-height: 1.7;
}
.kve-payment-note {
    margin-top: 6px;
    font-weight: 700;
    color: #92400e;
}

.kve-modal-close {
    background: #f1f5f9;
    border: none;
    color: #475569;
    padding: 10px 28px;
    border-radius: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: background 0.2s;
}
.kve-modal-close:hover { background: #e2e8f0; }

/* Discount Code */
.kve-discount-row { display: flex; gap: 8px; }
.kve-discount-row .kve-input { flex: 1; }
.kve-discount-btn {
    flex-shrink: 0;
    padding: 0 18px;
    background: #1e293b;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.kve-discount-btn:hover { background: #0f172a; }
.kve-discount-msg { margin: 8px 0 0; font-size: 0.8rem; font-weight: 600; }
.kve-discount-msg.kve-discount-ok { color: #15803d; }
.kve-discount-msg.kve-discount-err { color: #b91c1c; }

/* Lookup Box */
.kve-lookup-box {
    padding: 20px 24px 28px;
    border-top: 1px solid #f1f5f9;
}
.kve-lookup-title { font-size: 0.95rem; font-weight: 700; color: #1e293b; margin-bottom: 12px; }
.kve-lookup-row { display: flex; gap: 8px; margin-bottom: 14px; }
.kve-lookup-row .kve-input { flex: 1; }
.kve-lookup-btn {
    flex-shrink: 0;
    padding: 11px 18px;
    background: #1e293b;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.kve-lookup-btn:hover { background: #0f172a; }
.kve-lookup-empty { text-align: center; color: #94a3b8; font-size: 0.85rem; padding: 12px 0; }
.kve-lookup-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.kve-lookup-card:last-child { margin-bottom: 0; }
.kve-lookup-row-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: #475569;
    padding: 4px 0;
}
.kve-lookup-row-line strong { color: #1e293b; }
.kve-lookup-status {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #1d4ed8;
}

@media (max-width: 480px) {
    .kve-field-row { grid-template-columns: 1fr; }
    .kve-dir-btn { font-size: 0.72rem; }
    .kve-discount-row, .kve-lookup-row { flex-direction: column; }
}

/* Ô ghi chú khách trên form */
.kve-textarea { resize: vertical; min-height: 70px; font-family: inherit; line-height: 1.5; }
