/* ========================================
   🎨 DESIGN SYSTEM - KYC VERIFICATION
   Mobile First | Glassmorphism | Minimal
   ======================================== */

:root {
    /* Cores Principais */
    --rosa-primary: #E91E63;
    --rosa-dark: #C2185B;
    --rosa-light: #F8BBD0;
    
    /* Tons Neutros */
    --gray-900: #1a1a1a;
    --gray-800: #2d2d2d;
    --gray-700: #424242;
    --gray-500: #757575;
    --gray-300: #e0e0e0;
    --gray-100: #f5f5f5;
    --white: #ffffff;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
    
    /* Espaçamentos */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* Border Radius */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    /* Fontes */
    --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* Reset Universal */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-base);
    background: #f5f5f5;
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container Principal - Mobile First */
.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    min-height: 100vh;
}

/* Painel de Etapas - Glassmorphism */
.etapa-painel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--glass-shadow);
    min-height: 400px;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Upload Section - Minimalista */
.upload__box {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.upload__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.02em;
}

.upload__desc {
    font-size: 0.938rem;
    color: var(--gray-700);
    margin-bottom: var(--spacing-xl);
    line-height: 1.6;
}

.upload__desc strong {
    color: var(--gray-900);
    font-weight: 500;
}

/* Área de Upload com Glassmorphism */
.upload__form {
    margin: var(--spacing-xl) 0;
}

.icon__btn {
    background: var(--rosa-primary);
    color: var(--white);
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(233, 30, 99, 0.3);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.icon__btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.icon__btn:hover::before {
    width: 300px;
    height: 300px;
}

.icon__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(233, 30, 99, 0.4);
}

.icon__btn:active {
    transform: translateY(0);
}

.icon__btn svg {
    z-index: 1;
}

.icon__btn span {
    z-index: 1;
}

.hiden {
    display: none;
}

.upload__info {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-md);
    font-size: 0.875rem;
    color: var(--gray-700);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
}

.upload__info strong {
    color: var(--rosa-primary);
    font-weight: 600;
}

/* Botão Secundário */
.btn-secundario {
    background: transparent;
    color: var(--gray-700);
    padding: var(--spacing-sm) var(--spacing-lg);
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-full);
    font-size: 0.938rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.btn-secundario:hover {
    background: var(--white);
    border-color: var(--rosa-primary);
    color: var(--rosa-primary);
    transform: translateY(-1px);
}

/* DNP Section */
.dnp__box {
    margin-bottom: var(--spacing-lg);
}

.dnp__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: var(--spacing-lg) 0 var(--spacing-md);
    letter-spacing: -0.02em;
}

.dnp__desc {
    font-size: 0.938rem;
    color: var(--gray-700);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.dnp__image {
    margin: var(--spacing-lg) 0;
    text-align: center;
}

.dnp__image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.dnp__item.col {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.dnp__column {
    flex: 1;
}

/* Botões Principais */
.btn-principal {
    background: var(--rosa-primary);
    color: var(--white);
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(233, 30, 99, 0.3);
    width: 100%;
    margin-top: var(--spacing-md);
}

.btn-principal:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(233, 30, 99, 0.4);
}

.btn-principal:active {
    transform: translateY(0);
}

/* Barra de Progresso - Minimalista */
.progresso {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-md) 0;
}

.bullet {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--gray-300);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bullet.active {
    background: var(--rosa-primary);
    width: 24px;
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.4);
}

/* ========================================
   📱 RESPONSIVO - TABLET & DESKTOP
   ======================================== */

@media (min-width: 768px) {
    .container {
        max-width: 680px;
        padding: var(--spacing-xl);
        gap: var(--spacing-xl);
    }
    
    .etapa-painel {
        padding: var(--spacing-2xl);
    }
    
    .upload__title {
        font-size: 1.75rem;
    }
    
    .dnp__item.col {
        flex-direction: row;
        gap: var(--spacing-lg);
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 1200px;
        flex-direction: row;
        align-items: flex-start;
    }
    
    .etapa-painel {
        flex: 1;
    }
    
    .produto-fixo {
        width: 100%;
        position: static;
        order: -1;
        margin-bottom: var(--spacing-lg);
    }
}

/* ========================================
   🎭 PREVIEW & LOADING STATES
   ======================================== */

#preview-container {
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

#preview-content img {
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Loader Overlay */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.loader-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loader {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-300);
    border-top: 4px solid var(--rosa-primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   🎯 ESTADOS & INTERAÇÕES
   ======================================== */

/* Focus States */
input[type="file"]:focus + .icon__btn,
button:focus,
.btn-principal:focus,
.btn-secundario:focus {
    outline: 2px solid var(--rosa-primary);
    outline-offset: 2px;
}

/* Disabled State */
.btn-principal:disabled,
.btn-secundario:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Success State */
.success-message {
    color: #2e7d32;
    font-weight: 600;
    margin-top: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

/* Error State */
.error-message {
    color: #d32f2f;
    font-weight: 500;
    margin-top: var(--spacing-sm);
    padding: var(--spacing-md);
    background: rgba(211, 47, 47, 0.1);
    border-radius: var(--radius-sm);
    border-left: 3px solid #d32f2f;
}

/* ========================================
   📦 PRODUTO FIXO
   ======================================== */

.produto-fixo {
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--glass-shadow);
    margin-bottom: var(--spacing-lg);
}

.resumo-pedido,
.resumo-lentes,
.resumo-entrega {
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--glass-border);
}

.resumo-titulo {
    font-size: 0.938rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--spacing-sm);
}

.resumo-total {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--rosa-primary);
    padding-top: var(--spacing-sm);
    border-top: 2px solid var(--rosa-primary);
    margin-top: var(--spacing-sm);
}

/* Desktop - Produto Sticky */
@media (min-width: 992px) {
    .produto-fixo {
        width: 340px;
        position: sticky;
        top: var(--spacing-lg);
        align-self: flex-start;
        margin-bottom: 0;
    }
}

/* ========================================
   📸 FACE RECOGNITION SCREEN
   ======================================== */

.upload-dnp {
    text-align: center;
}

.face-recognition-container {
    position: relative;
    margin: var(--spacing-xl) auto;
    max-width: 320px;
}

.face-oval-guide {
    position: relative;
    width: 280px;
    height: 350px;
    margin: 0 auto var(--spacing-lg);
    border: 3px dashed var(--rosa-primary);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: rgba(233, 30, 99, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

.face-guide-text {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.875rem;
    color: var(--gray-700);
    white-space: nowrap;
}

/* ========================================
   📷 MODAL CÂMERA FULLSCREEN
   ======================================== */

.camera-modal {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    background: #000;
    z-index: 999999 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0;
    transition: opacity 0.3s ease;
    transform: none !important;
    overflow: hidden;
}

.camera-modal.active {
    display: block !important;
    opacity: 1;
}

.camera-modal-content {
    position: relative;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0 !important;
}

/* Botão Fechar */
.camera-close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000001;
    transition: all 0.3s ease;
}

.camera-close-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Container do Vídeo */
.camera-preview-container {
    position: absolute;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

#camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlay com Guia */
.camera-overlay {
    position: absolute;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.6) 70%);
    z-index: 1000000;
    margin: 0 !important;
    padding: 0 !important;
}

.camera-oval-guide {
    width: 280px;
    height: 350px;
    border: 4px dashed rgba(255, 255, 255, 0.8);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-camera 2s ease-in-out infinite;
    box-shadow: 0 0 40px rgba(233, 30, 99, 0.3);
}

@keyframes pulse-camera {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

.camera-instruction {
    margin-top: 30px;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    color: white;
    font-size: 0.938rem;
    font-weight: 600;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Botão de Captura */
.camera-capture-button {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1000001;
    padding: 0;
}

.capture-ring {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    border: 4px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.camera-capture-button:hover .capture-ring {
    transform: scale(1.1);
    border-color: var(--rosa-primary);
}

.camera-capture-button:active .capture-ring {
    transform: scale(0.95);
}

.capture-inner {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: white;
    transition: all 0.2s ease;
}

.camera-capture-button:active .capture-inner {
    transform: scale(0.8);
}

/* Responsivo - Modal Câmera */
@media (max-width: 768px) {
    .camera-oval-guide {
        width: 220px;
        height: 280px;
    }
    
    .camera-instruction {
        font-size: 0.875rem;
        padding: 10px 20px;
    }
    
    .camera-capture-button {
        bottom: 30px;
        width: 70px;
        height: 70px;
    }
    
    .capture-inner {
        width: 52px;
        height: 52px;
    }
}

@media (min-width: 992px) {
    .camera-oval-guide {
        width: 320px;
        height: 400px;
    }
}

/* Camera Capture Button */
.camera-capture-btn {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--white);
    border: 4px solid var(--rosa-primary);
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: var(--spacing-lg) auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-capture-btn::before {
    content: '';
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--rosa-primary);
    transition: all 0.2s;
}

.camera-capture-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(233, 30, 99, 0.2);
}

.camera-capture-btn:active::before {
    transform: scale(0.9);
}

/* ========================================
   📄 DOCUMENT UPLOAD OPTIONS
   ======================================== */

.document-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin: var(--spacing-xl) 0;
}

.document-option {
    background: var(--white);
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.document-option:hover {
    border-color: var(--rosa-primary);
    background: rgba(233, 30, 99, 0.03);
    transform: translateX(4px);
}

.document-option-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.document-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(233, 30, 99, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rosa-primary);
}

.document-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.document-info p {
    font-size: 0.813rem;
    color: var(--gray-700);
}

.document-arrow {
    color: var(--gray-500);
    transition: transform 0.3s;
}

.document-option:hover .document-arrow {
    transform: translateX(4px);
}

/* ========================================
   ✅ UTILITIES
   ======================================== */

.text-center {
    text-align: center;
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

/* ========================================
   🚨 MODAL ESCAPE - Força saída do container
   ======================================== */
   
/* Remove qualquer limitação de container pai */
body.modal-open {
    overflow: hidden;
}

/* Força o modal a ignorar qualquer container pai */
.camera-modal {
    isolation: isolate;
}

/* Remove transformações de containers pais que possam limitar o fixed */
.processo-container,
.etapa-painel,
.container-fluid,
.row,
.col-md-6,
.col-md-12 {
    transform: none !important;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
