/**
 * KTech Checkout Modal & VietQR Payment Flow Styles
 * Designed for SeePay Manual Admin Approval and Brand Consistency.
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --ktech-navy: #001B44;
    --ktech-gold: #C6A664;
    --ktech-gold-dark: #A98743;
    --ktech-gold-light: #F9F5EA;
    --ktech-blue: #1D4ED8;
    --ktech-text: #1E293B;
    --ktech-muted: #64748B;
    --ktech-border: #E2E8F0;
    --ktech-bg-subtle: #F8FAFC;
}

.ktech-enroll-action-wrapper {
    margin: 20px 0;
}

.ktech-open-checkout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--ktech-gold) 0%, var(--ktech-gold-dark) 100%);
    color: #ffffff !important;
    font-family: 'SVN-Gilroy', 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(198, 166, 100, 0.35);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.ktech-open-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(198, 166, 100, 0.45);
    background: linear-gradient(135deg, var(--ktech-gold-dark) 0%, #8D6E2E 100%);
}

.ktech-open-checkout-btn .btn-price {
    background: rgba(0, 0, 0, 0.15);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* Modal Overlay */
.ktech-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 27, 68, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

/* Modal Container */
.ktech-modal-container {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 540px;
    border-radius: 20px;
    box-shadow: 0 25px 60px -12px rgba(0, 27, 68, 0.35);
    overflow: hidden;
    padding: 32px 28px;
    font-family: 'SVN-Gilroy', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
    animation: ktechModalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ktechModalFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.ktech-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: #F1F5F9;
    border: none;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    transition: all 0.2s;
    line-height: 1;
}

.ktech-modal-close:hover {
    background: #E2E8F0;
    color: var(--ktech-navy);
}

/* Modal Header */
.ktech-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.ktech-modal-badge {
    display: inline-block;
    background: var(--ktech-gold-light);
    color: var(--ktech-gold-dark);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.ktech-badge-pending {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FEF3C7;
    color: #B45309;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.ktech-pulse-dot {
    width: 8px;
    height: 8px;
    background: #F59E0B;
    border-radius: 50%;
    animation: ktechPulse 1.5s infinite;
}

@keyframes ktechPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.ktech-modal-header h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--ktech-navy);
    margin: 0 0 8px;
    line-height: 1.35;
}

.ktech-modal-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--ktech-gold-dark);
    margin: 6px 0 0;
}

.ktech-subtext {
    font-size: 14px;
    color: var(--ktech-muted);
    margin: 4px 0 0;
    line-height: 1.45;
}

/* Form Styles */
.ktech-form-group {
    margin-bottom: 16px;
}

.ktech-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.ktech-form-group input {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    border: 1.5px solid var(--ktech-border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--ktech-text);
    background: #FFFFFF;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.ktech-form-group input:focus {
    outline: none;
    border-color: var(--ktech-gold);
    box-shadow: 0 0 0 3px rgba(198, 166, 100, 0.2);
}

.ktech-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 480px) {
    .ktech-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.ktech-form-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #EFF6FF;
    border: 1px solid #DBEAFE;
    color: #1E40AF;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 20px;
}

.ktech-form-notice .dashicons {
    font-size: 18px;
    color: #3B82F6;
    margin-top: 1px;
}

.ktech-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--ktech-navy) 0%, #0F2D59 100%);
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 27, 68, 0.25);
    transition: all 0.25s;
    text-decoration: none;
    font-family: inherit;
}

.ktech-submit-btn:hover {
    background: linear-gradient(135deg, #0F2D59 0%, #1A3E72 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 27, 68, 0.35);
}

.ktech-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #F1F5F9;
    color: #475569 !important;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.ktech-btn-secondary:hover {
    background: #E2E8F0;
    color: var(--ktech-navy) !important;
}

/* Step 2: QR & Bank Card */
.ktech-qr-body {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 18px;
    align-items: center;
    background: var(--ktech-bg-subtle);
    border: 1px solid var(--ktech-border);
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 16px;
}

@media (max-width: 520px) {
    .ktech-qr-body {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }
}

.ktech-qr-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.ktech-qr-frame img {
    width: 165px;
    height: 165px;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

.ktech-qr-timer {
    margin-top: 8px;
    font-size: 12px;
    color: var(--ktech-muted);
}

.ktech-qr-timer strong {
    color: var(--ktech-navy);
    font-weight: 700;
}

.ktech-bank-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.ktech-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #E2E8F0;
}

.ktech-detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ktech-detail-row .label {
    color: var(--ktech-muted);
}

.ktech-detail-row .val {
    font-weight: 700;
    color: var(--ktech-navy);
}

.ktech-detail-row .val.highlight {
    color: #DC2626;
    font-size: 15px;
}

.ktech-detail-row .val.memo-code {
    color: #0369A1;
    font-family: monospace;
    font-size: 14px;
    background: #E0F2FE;
    padding: 2px 6px;
    border-radius: 4px;
}

.ktech-detail-row .copy-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ktech-copy-btn {
    background: #E2E8F0;
    border: none;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.ktech-copy-btn:hover {
    background: var(--ktech-navy);
    color: #FFFFFF;
}

/* Notice Manual Approval */
.ktech-notice-manual-approval {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #92400E;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.45;
    margin-bottom: 16px;
}

.ktech-notice-manual-approval .dashicons {
    color: #F59E0B;
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.ktech-qr-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.ktech-btn-confirm-paid {
    background: linear-gradient(135deg, var(--ktech-gold) 0%, var(--ktech-gold-dark) 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(198, 166, 100, 0.4) !important;
}

.ktech-btn-confirm-paid:hover {
    background: linear-gradient(135deg, var(--ktech-gold-dark) 0%, #8D6E2E 100%) !important;
}

.ktech-status-polling {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: var(--ktech-muted);
    padding: 6px 0;
}

.ktech-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #E2E8F0;
    border-top-color: var(--ktech-gold);
    border-radius: 50%;
    animation: ktechSpin 0.8s linear infinite;
}

@keyframes ktechSpin {
    to { transform: rotate(360deg); }
}

/* Step 3: Pending Screen */
.ktech-pending-icon,
.ktech-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.ktech-pending-icon {
    background: #FEF3C7;
    color: #D97706;
}

.ktech-pending-icon .dashicons {
    font-size: 34px;
    width: 34px;
    height: 34px;
}

.ktech-success-icon {
    background: #DCFCE7;
    color: #16A34A;
}

.ktech-success-icon .dashicons {
    font-size: 34px;
    width: 34px;
    height: 34px;
}

.ktech-badge-amber {
    display: inline-block;
    background: #FEF3C7;
    color: #B45309;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 14px;
    border-radius: 20px;
    margin: 0 auto 8px;
}

.ktech-badge-success {
    display: inline-block;
    background: #DCFCE7;
    color: #15803D;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 14px;
    border-radius: 20px;
    margin: 0 auto 8px;
}

.ktech-step-content {
    text-align: center;
}

.ktech-pending-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--ktech-navy);
    margin: 4px 0 16px;
}

.ktech-order-summary-card {
    background: var(--ktech-bg-subtle);
    border: 1px solid var(--ktech-border);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 18px;
    text-align: left;
}

.ktech-order-summary-card .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    padding: 6px 0;
    border-bottom: 1px dashed #E2E8F0;
}

.ktech-order-summary-card .summary-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ktech-order-summary-card .summary-row .label {
    color: var(--ktech-muted);
}

.ktech-order-summary-card .summary-row .val {
    font-weight: 700;
    color: var(--ktech-navy);
}

.ktech-order-summary-card .summary-row .highlight-code {
    color: #0369A1;
    font-family: monospace;
    font-size: 15px;
}

.ktech-pending-message {
    font-size: 13.5px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 22px;
}

.ktech-pending-message p {
    margin: 0 0 6px;
}

.ktech-pending-message .sub {
    font-size: 12.5px;
    color: var(--ktech-muted);
}

.ktech-pending-actions {
    display: flex;
    gap: 12px;
}

.ktech-pending-actions .ktech-submit-btn {
    flex: 2;
}

.ktech-pending-actions .ktech-btn-secondary {
    flex: 1;
}

@media (max-width: 480px) {
    .ktech-pending-actions {
        flex-direction: column;
    }
}
