:root {
    --primary: #003399;
    --primary-dark: #002266;
    --warning: #FFC107;
    --danger: #dc3545;
    --success: #198754;
    --font-main: 'Red Hat Display', sans-serif;
    --text-color: #fff;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { 
    margin: 0; padding: 0; 
    background: #ffffff; 
    color: var(--text-color); 
    font-family: var(--font-main); 
    overflow: hidden; 
    width: 100vw; height: 100dvh; 
}

#desktop-blocker { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: #ffffff; 
    z-index: 99999; display: none; 
    flex-direction: column; align-items: center; justify-content: center; 
    text-align: center; padding: 40px; 
    color: #000;
}
.desktop-content {
    animation: fadeIn 0.8s ease-out;
}
.d-name { 
    font-size: 64px; 
    font-weight: 900; 
    color: var(--primary); 
    margin: 0 0 10px 0; 
    letter-spacing: -1px;
    line-height: 1.1;
}
.d-instr { 
    font-size: 20px; 
    color: #666; 
    font-weight: 500; 
    margin: 0 0 40px 0;
}
.qr-container {
    display: inline-block;
    padding: 15px;
    background: #fff;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}
#qr-code-img { 
    width: 220px; 
    height: 220px; 
    display: block;
}

/* CAMERA UI */
#camera-feed { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    object-fit: cover; z-index: 0; background: #ffffff; 
}
.mirror { transform: scaleX(-1); }

#app { position: relative; width: 100%; height: 100%; z-index: 20; }

.screen { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100dvh; 
    display: none; flex-direction: column; justify-content: space-between; 
    background: transparent !important; 
}
.screen.active { display: flex !important; }

/* --- INTRO & PRE-SELFIE SCREEN STYLE --- */
#step-intro, #step-pre-selfie { 
    background-color: #ffffff !important; 
    color: #1d1d1d !important;
    padding: 0;
}
.intro-top {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 30px;
}
.intro-footer {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    padding: 30px 25px 40px 25px;
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
    z-index: 50;
    border-top: 1px solid rgba(255,255,255,0.5);
    animation: slideUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --- REVIEW SCREEN STYLE --- */
#step-review {
    background-color: #ffffff !important; 
    color: #1d1d1d;
    padding: 0;
}

.review-body {
    flex: 1; 
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #ffffff; 
}

#review-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    display: block;
}

.review-badge {
    position: absolute;
    top: max(40px, env(safe-area-inset-top)); 
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.review-footer {
    width: 100%;
    background: #fff; 
    padding: 20px;
    padding-bottom: max(30px, env(safe-area-inset-bottom));
    display: flex;
    gap: 15px;
    justify-content: center;
    border-top: 1px solid #eee;
}

.center-content { align-items: center; justify-content: center; background: transparent; }
.middle-area { flex-grow: 1; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }

/* TYPOGRAPHY */
h1 { margin: 0 0 10px 0; font-size: 24px; font-weight: 900; letter-spacing: 0.5px; text-transform: uppercase; }
h2 { 
    margin: 0; font-size: 18px; letter-spacing: 1px; color: #fff; 
    font-weight: 900; text-transform: uppercase; 
    display: flex; align-items: center; justify-content: center; gap: 8px; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.8); 
    margin-top: 15px; 
}

.instr-box {
    background-color: var(--warning);
    color: #000;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 0;
    display: inline-block;
    margin-top: 8px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

#step-intro p, #step-pre-selfie p { color: #555; text-shadow: none; font-weight: 500; }
#step-intro h1, #step-pre-selfie h1 { text-shadow: none; }

/* GUMBI */
.btn-fintech {
    background: linear-gradient(135deg, var(--primary) 0%, #0055d4 100%);
    border: none;
    color: white;
    font-weight: 800;
    width: 100%;
    display: flex; justify-content: center; align-items: center; gap: 10px;
    padding: 18px;
    border-radius: 16px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 16px;
    box-shadow: 0 10px 25px rgba(0, 102, 255, 0.3);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.btn-fintech:active { transform: scale(0.98); box-shadow: 0 5px 15px rgba(0, 102, 255, 0.2); }

/* BARS */
.top-bar { 
    width: 100%; text-align: center; z-index: 100; 
    padding-top: max(50px, env(safe-area-inset-top)); padding-bottom: 20px; 
    background: transparent; 
}
.bottom-bar { 
    width: 100%; text-align: center; min-height: 160px; 
    display: flex; flex-direction: column; justify-content: flex-end; align-items: center; 
    z-index: 100; padding-bottom: max(30px, env(safe-area-inset-bottom)); 
    background: transparent; 
}

/* FRAMES */
.border-id { 
    width: 85vw; max-width: 400px; aspect-ratio: 1.586 / 1; 
    border: 4px solid #fff; 
    border-radius: 24px; 
    position: relative; z-index: 20; 
    display: flex; align-items: center; justify-content: center; overflow: hidden; 
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.3)); 
    transition: border-color 0.2s;
}

.border-circle { 
    width: 75vw; height: 75vw; max-width: 320px; max-height: 320px; 
    border: 4px solid #fff; 
    border-radius: 50%; 
    position: relative; z-index: 20; overflow: hidden; 
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.5));
    transition: border-color 0.2s;
}

.badge { 
    background: var(--warning); color: #000; font-size: 11px; padding: 5px 12px; 
    border-radius: 0; display: inline-block; font-weight: 800; letter-spacing: 1px; 
    text-transform: uppercase; box-shadow: 0 2px 5px rgba(0,0,0,0.3); 
}

/* ANIMATIONS */
.scan-laser { position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--success); box-shadow: 0 0 20px var(--success); animation: scan 2s infinite ease-in-out; display: none; z-index: 30; }
@keyframes scan { 0% {top:0%; opacity:0;} 50%{opacity:1;} 100%{top:100%; opacity:0;} }

/* Status Styles moved to Modern Components section */

.progress-container { width: 100%; max-width: 250px; height: 6px; background: rgba(255,255,255,0.4); border-radius: 0; overflow: hidden; margin-top: 5px; opacity: 0; transition: opacity 0.3s; }
.progress-bar { width: 0%; height: 100%; background: var(--success); transition: width 0.1s linear; }
.manual-trigger { margin-top: 15px; padding: 10px; font-size: 13px; font-weight: 700; text-decoration: underline; color: #fff; cursor: pointer; display: none; opacity: 0; animation: fadeIn 1s forwards; text-transform: uppercase; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }

/* REVIEW BUTTONS */
.btn-review-action { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px 10px; border-radius: 0; font-weight: 800; text-transform: uppercase; font-size: 14px; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.btn-review-retry { background: #f0f0f0; color: #333; border: none; }
.btn-review-confirm { background-color: var(--success); color: #fff; border: none; box-shadow: 0 4px 0 #0f5132; }
.btn-review-confirm:active { transform: translateY(2px); box-shadow: 0 2px 0 #0f5132; }

.dot { width: 10px; height: 10px; background: #ccc; border-radius: 50%; margin: 0 5px; transition: 0.3s; box-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.dot.active { background: var(--success); transform: scale(1.3); border: 2px solid #fff; }
.spinner { width: 50px; height: 50px; border: 5px solid rgba(0,0,0,0.1); border-radius: 50%; border-top: 5px solid var(--primary); animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes fadeIn { to { opacity: 1; } }
.guide-dots { position: absolute; top:0; left:0; width: 100%; height: 100%; pointer-events: none; z-index: 25; }
.g-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #fff; opacity: 0; animation: pulseDots 2s infinite ease-in-out; }
.gd1 { top: 15px; left: 15px; animation-delay: 0s; }
.gd2 { top: 15px; right: 15px; animation-delay: 0.5s; }
.gd3 { bottom: 15px; left: 15px; animation-delay: 1s; }
.gd4 { bottom: 15px; right: 15px; animation-delay: 1.5s; }
@keyframes pulseDots { 0% { transform: scale(0.5); opacity: 0.3; } 50% { transform: scale(1.5); opacity: 1; } 100% { transform: scale(0.5); opacity: 0.3; } }

/* FLASH EFFECT */
@keyframes flash-green { 0% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7); border-color: #198754; } 50% { box-shadow: 0 0 0 20px rgba(25, 135, 84, 0); border-color: #fff; } 100% { border-color: #fff; } }
.shutter-flash-border { animation: flash-green 0.5s ease-out; }

/* DROPDOWN - ULTRA MODERN */
.form-group { position: relative; width: 100%; margin-bottom: 20px; }
.select-wrapper { position: relative; width: 100%; }

.modern-select {
    width: 100%;
    padding: 16px 20px 16px 16px;
    font-size: 16px;
    font-family: 'Red Hat Display', sans-serif;
    font-weight: 600;
    color: #1d1d1d;
    background-color: #f7f9fc;
    border: 2px solid transparent;
    border-radius: 16px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: all 0.25s ease;
}

.modern-select:focus {
    outline: none;
    background-color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.15);
}

.select-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #888;
    pointer-events: none;
    transition: 0.2s;
}

.modern-select:focus + .select-icon { color: var(--primary); transform: translateY(-50%) rotate(180deg); }

/* Small Select for Language */
.small-wrapper .modern-select {
    /* Made full width as per request */
    width: 100%;
}

/* MODERN UI COMPONENTS */
.top-bar-modern {
    width: 100%;
    z-index: 100;
    padding-top: max(40px, env(safe-area-inset-top));
    padding-bottom: 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.step-indicator {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-divider {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

.modern-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Status Pill */
.status-modern {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 14px 28px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 700;
    color: #1d1d1d;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    /* Changed bottom margin to ensure it fits well within the bar */
    margin: 0 auto 25px auto;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateY(0);
    letter-spacing: 0.5px;
    /* Added max-width control */
    max-width: fit-content;
}

.status-modern.st-wait {
    background: #eef4ff; /* Pastel Blue */
    color: #0044cc;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 68, 204, 0.15);
}

.status-modern.st-good {
    background: #e6f7ed; /* Pastel Green */
    color: #0f5132;
    border: none !important;
    box-shadow: 0 4px 15px rgba(15, 81, 50, 0.15);
}

.status-modern.st-bad {
    background: #fff5f5; /* Pastel Red */
    color: #c00;
    border: none !important;
    box-shadow: 0 4px 15px rgba(204, 0, 0, 0.1);
}

/* Review Badge Modern */
.review-badge-modern {
    position: absolute;
    top: max(30px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Update Review Buttons */
.review-footer { gap: 12px; padding: 25px 20px; border-top: none; box-shadow: 0 -10px 40px rgba(0,0,0,0.05); }
.btn-review-action { border-radius: 16px; margin: 0; padding: 18px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); font-size: 15px;}
.btn-review-confirm { background: linear-gradient(135deg, var(--success) 0%, #146c43 100%); box-shadow: 0 8px 20px rgba(25, 135, 84, 0.3); }

/* Progress Bar Update */
.progress-container { border-radius: 4px; height: 5px; background: rgba(255,255,255,0.25); width: 100%; max-width: 140px; margin-top: 0; position: absolute; bottom: 80px; }
.progress-bar { border-radius: 4px; background: #fff; box-shadow: 0 0 10px rgba(255,255,255,0.8); }

/* Hide old elements if any remain */
.badge, .instr-box { display: none !important; }


.bg-fullscreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

