* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            background-color: #f8f9fa;
            color: #333;
            display: flex;
            justify-content: center;
        }

        .container {
            width: 100%;
            max-width: 450px;
            background-color: #f8f9fa;
            min-height: 100vh;
            position: relative;
            padding-bottom: 100px;
        }

        header {
            background: white;
            padding: 16px;
            display: flex;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 10;
            border-bottom: 1px solid #f0f0f0;
            height: 60px;
        }

        .back-btn {
            font-size: 20px;
            color: #666;
            cursor: pointer;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: background 0.2s;
            flex-shrink: 0;
        }
        .back-btn:active {
            background: #f0f0f0;
        }
        .back-btn.hide {
            visibility: hidden;
            pointer-events: none;
        }

        header h1 {
            font-size: 20px;
            font-weight: 600;
            flex: 1;
            text-align: center;
            margin: 0;
            line-height: 1.2;
        }

        .header-spacer {
            width: 32px;
            flex-shrink: 0;
        }

        .content {
            padding: 16px;
        }

        .card {
            background: white;
            border-radius: 24px;
            padding: 20px;
            margin-bottom: 16px;
            box-shadow: 0 2px 12px rgba(0,0,0,0.04);
        }

        /* Camera Section */
        .camera-card {
            background: #000;
            border-radius: 24px;
            overflow: hidden;
            margin-bottom: 16px;
            position: relative;
            min-height: 500px;
        }
        
        #cameraPreview {
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%; /* 🔥 WAJIB */

    object-fit: cover; /* biar tetap proporsional */

    background: #000;
    transform: scaleX(1);

    opacity: 0;
    transition: opacity 0.3s ease;
}
        /* Overlay gelap untuk menutupi video sebelum izin diberikan */
        .camera-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #111;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 20;
            border-radius: 24px;
            backdrop-filter: blur(2px);
            transition: opacity 0.4s ease;
        }
        
        .camera-overlay i {
            font-size: 48px;
            color: #42a5f5;
            margin-bottom: 16px;
            background: rgba(255,255,255,0.1);
            padding: 16px;
            border-radius: 60px;
        }
        
        .camera-overlay p {
            color: #ddd;
            font-size: 14px;
            font-weight: 500;
            text-align: center;
            padding: 0 24px;
            margin-top: 8px;
        }
        
        .camera-overlay .request-btn {
            margin-top: 24px;
            background: #42a5f5;
            border: none;
            padding: 10px 24px;
            border-radius: 40px;
            color: white;
            font-weight: bold;
            font-size: 14px;
            cursor: pointer;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
            transition: transform 0.1s ease;
        }
        
        .camera-overlay .request-btn:active {
            transform: scale(0.96);
        }
        
        .camera-overlay.hide-overlay {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }
        
        .camera-controls {
            display: flex;
            gap: 12px;
            padding: 12px;
            background: rgba(0,0,0,0.7);
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            justify-content: center;
            z-index: 15;
        }
        
        .cam-btn {
            background: rgba(255,255,255,0.9);
            border: none;
            width: 48px;
            height: 48px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            color: #42a5f5;
            transition: all 0.2s;
        }
        
        .cam-btn:active {
            transform: scale(0.95);
        }
        
        .cam-btn.flash-active {
            background: #42a5f5;
            color: white;
        }
        
        /* Tombol ganti kamera - perbaikan posisi icon di dalam bulatan */
        .switch-cam-btn {
            position: absolute;
            top: 16px;
            right: 16px;
            background: rgba(0,0,0,0.65);
            border: none;
            width: 44px;
            height: 44px;
            border-radius: 50%;
            color: white;
            cursor: pointer;
            z-index: 15;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(4px);
        }
        
        .switch-cam-btn i {
            font-size: 20px;
            margin: 0;
            padding: 0;
            line-height: 1;
        }
        
        .switch-cam-btn:active {
            transform: scale(0.94);
            background: rgba(0,0,0,0.85);
        }
        
                                
.scan-guide {
    position: absolute;

    top: 40px;
    left: 40px;
    right: 40px;

    bottom: 120px; /* biar gak nabrak tombol bawah */

    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 20px;

    pointer-events: none;
    z-index: 12;

    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
}
        
        .scan-guide.visible {
            opacity: 1;
        }
        
        .scan-guide::before {
            content: "Arahkan ke QRIS";
            position: absolute;
            bottom: -35px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0,0,0,0.7);
            color: white;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            white-space: nowrap;
        }
        
        /* Upload Card */
        .upload-card {
            background: #f8f9fa;
            border-radius: 24px;
            padding: 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 2px dashed #ddd;
            margin-bottom: 16px;
        }
        .upload-card:active {
            transform: scale(0.98);
        }
        .upload-icon {
            font-size: 40px;
            color: #42a5f5;
            margin-bottom: 8px;
        }
        .upload-text {
            color: #666;
            font-size: 14px;
            font-weight: 500;
        }
        .upload-text strong {
            color: #42a5f5;
        }
        .upload-sub {
            font-size: 11px;
            color: #888;
            margin-top: 6px;
        }
        #fileInput {
            display: none;
        }

        .merchant-info {
            display: flex;
            align-items: center;
            margin-bottom: 24px;
        }
        .merchant-icon {
            width: 52px;
            height: 52px;
         background: linear-gradient(135deg, #42a5f5, #1976d2);
            border-radius: 28px;
            display: flex;
            justify-content: center;
            align-items: center;
            color: white;
            margin-right: 14px;
            font-size: 24px;
        }
        .merchant-details h2 {
            font-size: 18px;
            font-weight: 700;
            margin-bottom: 4px;
            color: #1e2a3e;
        }
        .badge {
            display: inline-block;
            padding: 4px 10px;
            border-radius: 40px;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.5px;
            margin-top: 6px;
        }
        .badge-dinamis {
    background: #bbdefb;
    color: #1565c0;
}
        .badge-statis {
    background: #e3f2fd;
    color: #1976d2;
}

        .input-container {
            background-color: #f9fafb;
            border-radius: 20px;
            padding: 12px 20px;
            display: flex;
            align-items: center;
            margin-bottom: 16px;
            border: 1px solid #edf2f7;
            transition: all 0.2s;
        }
        .input-container:focus-within {
            border-color: #42a5f5;
            background: white;
          box-shadow: 0 4px 12px rgba(66,165,245,0.3);
        }
        .currency {
            font-size: 28px;
            font-weight: 600;
            color: #1e2a3e;
            margin-right: 10px;
        }
        .amount-input {
            border: none;
            background: transparent;
            font-size: 32px;
            font-weight: 600;
            width: 100%;
            outline: none;
            padding: 8px 0;
        }
        .amount-input:read-only {
            color: #2c3e50;
        }
        .amount-note {
            font-size: 12px;
            color: #4caf50;
            margin: -8px 0 12px 12px;
        }
        .divider {
            height: 1px;
            background-color: #edf2f7;
            margin: 20px 0 16px;
        }
        .fee-row, .total-row {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
        }
        .fee-row span:first-child, .total-row span:first-child {
            font-size: 15px;
            color: #5a6874;
        }
        .total-row {
            margin-top: 8px;
            padding-top: 12px;
            border-top: 1px solid #edf2f7;
        }
        .total-row span:first-child {
            font-size: 16px;
            font-weight: 700;
            color: #1e2a3e;
        }
        .total-row span:last-child {
            font-size: 20px;
            font-weight: 800;
            color: #42a5f5;
        }

        footer {
            position: fixed;
            bottom: 0;
            width: 100%;
            max-width: 450px;
            padding: 16px;
            background: transparent;
            display: none;
        }
        footer.show {
            display: block;
        }
        .btn-lanjut {
            width: 100%;
            padding: 16px;
            background-color: #42a5f5;
            color: white;
            border: none;
            border-radius: 60px;
            font-size: 16px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            box-shadow: 0 4px 12px rgba(66,165,245,0.3);
        }
        .btn-lanjut:active {
            transform: scale(0.97);
        }
        .btn-lanjut.disabled {
            background-color: #e0e0e0;
            color: #9e9e9e;
            box-shadow: none;
            pointer-events: none;
        }

        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.7);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            flex-direction: column;
        }
        .loading-overlay.show {
            display: flex;
        }
        .loader {
            width: 48px;
            height: 48px;
            border: 4px solid rgba(66,165,245,0.2);
            border-top-color: #42a5f5;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        .loading-text {
            color: white;
            font-size: 14px;
            margin-top: 12px;
        }

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 9999;
        }
        .modal-overlay.success { background: #4caf50; }
        .modal-overlay.error { background: #e74f3a; }
        .modal-gif { width: 220px; }

        .custom-alert {
            position: fixed;
            bottom: 90px;
            left: 20px;
            right: 20px;
            background: white;
            border-radius: 20px;
            padding: 18px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.15);
            z-index: 10001;
            transform: translateY(100%);
            transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
            max-width: 410px;
            margin: 0 auto;
        }
        .custom-alert.show { transform: translateY(0); }
        .custom-alert-title {
            font-weight: 800;
            margin-bottom: 8px;
            font-size: 18px;
        }
        .custom-alert-title.success { color: #2e7d32; }
        .custom-alert-title.error { color: #c62828; }
        .custom-alert-message {
            font-size: 14px;
            color: #4a5568;
            margin-bottom: 16px;
            white-space: pre-line;
        }
        .custom-alert-button {
            background: #42a5f5;
            border: none;
            padding: 10px;
            border-radius: 40px;
            color: white;
            font-weight: 600;
            cursor: pointer;
            width: 100%;
            font-size: 14px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        
        .mode-selector {
            display: flex;
            gap: 12px;
            margin-bottom: 16px;
        }
        .mode-btn {
            flex: 1;
            padding: 12px;
            border: none;
            border-radius: 30px;
            background: white;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        .mode-btn.active {
            background: #42a5f5;
            color: white;
        }
        
        .camera-status {
            position: absolute;
            bottom: 70px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0,0,0,0.6);
            color: white;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 11px;
            white-space: nowrap;
            pointer-events: none;
            z-index: 15;
        }
