:root {
    --primary-blue: #007bff;
    --secondary-teal: #26c2a3;
    --bg-dark: #0f171e;
    --card-bg: #ffffff;
    --text-main: #ffffff;
    --text-dark: #333333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Header & Logo */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    background-color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Esto es clave para que la imagen no se salga */
}

.logo-img-inside {
    width: 180%;
    height: 128%;
    object-fit: cover; /* O 'contain' si quieres ver el logo completo con bordes */
}



body {
    background-color: var(--bg-dark);
    /* Fondo con diseño geométrico simplificado */
    background-image: linear-gradient(135deg, #16212b 25%, transparent 25%), 
                      linear-gradient(225deg, #16212b 25%, transparent 25%);
    background-size: 100px 100px;
    color: var(--text-main);
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    background: #fff;
    color: var(--primary-blue);
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 20px;
}

.logo-text h1 { font-size: 18px; line-height: 1; }
.logo-text p { font-size: 14px; opacity: 0.8; }

/* Content Styling */
.page-title { font-size: 28px; margin-bottom: 5px; }
.breadcrumb { font-size: 14px; margin-bottom: 25px; color: #ccc; }
.breadcrumb .active { color: var(--secondary-teal); }
.tag { margin-left: 10px; opacity: 0.5; }

/* Card Styling */
.card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    color: var(--text-dark);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.card h3 { font-size: 18px; margin-bottom: 15px; }

.button-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.btn {
    border: none;
    border-radius: 12px;
    padding: 10px 12px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-blue { background-color: var(--primary-blue); }
.btn-teal { background-color: var(--secondary-teal); }

/* Data Section */
.data-extracted {
    border-top: 1px solid #eee;
    padding-top: 15px;
    position: relative;
}

.label { font-size: 14px; color: #666; margin-bottom: 10px; }

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.barcode {
    background: #f8f8f8;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'monospace';
}

.btn-copy {
    float: right;
    margin-top: 5px;
    background: #eee;
    border: none;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
}

/* Bottom elements */
.upload-area {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.btn-submit {
    width: 100%;
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 15px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

.footer {
    text-align: center;
    margin-top: 40px;
    font-size: 12px;
    opacity: 0.7;
}

/* Animación de escaneo */
.escaneando {
    position: relative;
    overflow: hidden;
}
.escaneando::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--secondary-teal);
    top: 0;
    left: 0;
    animation: scan-line 2s infinite;
    box-shadow: 0 0 10px var(--secondary-teal);
}

@keyframes scan-line {
    0% { top: 0; }
    100% { top: 100%; }
}

.hidden { display: none; }

/* Animación de entrada para la imagen */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#imgPreview {
    width: 100%;
    max-height: 250px; /* Evita que la imagen sea demasiado larga */
    object-fit: cover; /* Ajusta la imagen sin deformarla */
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-top: 10px;
}

#previewContainer {
    padding: 10px;
    background: #f9f9f9; /* Un fondo sutil dentro de la card blanca */
    border-radius: 18px;
    margin-top: 15px;
}

/* Estilo de la imagen en la card para indicar que es clickeable */
#imgPreview {
    cursor: pointer;
    transition: transform 0.3s ease;
}

#imgPreview:hover {
    filter: brightness(0.9);
}

/* Capa de fondo del modal */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

/* La imagen agrandada */
.modal-content {
    max-width: 90%;
    max-height: 80%;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    animation: zoomIn 0.3s ease;
}

/* Botón de cerrar */
.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

@keyframes zoomIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.btn-remove-cedula {
    position: absolute;
    top: 30px; /* Ajustado por el texto de la etiqueta */
    right: 10px;
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 10;
    transition: transform 0.2s;
}

.btn-remove-cedula:hover {
    transform: scale(1.1);
    background: #e60000;
}

.btn-remove-cedula {
    position: absolute;
    top: 30px; 
    right: 10px;
    background: #ff4d4d;
    color: white; /* Color del icono de papelera */
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    
    /* Estas líneas centran el icono perfectamente */
    display: flex;
    align-items: center;
    justify-content: center;
    
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    z-index: 10;
    transition: all 0.2s ease;
}

.btn-remove-cedula:hover {
    background: #e60000;
    transform: scale(1.1);
}

.btn-remove-cedula i {
    font-size: 16px; /* Tamaño del icono de papelera */
}

.file-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    background: #f8f9fa;
    border-left: 4px solid var(--primary-blue);
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-dark);
    animation: slideIn 0.3s ease;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.btn-remove {
    color: #ff4d4d;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Contenedor de la barra de progreso */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--primary-blue);
    transition: width 0.5s ease, background-color 0.3s ease;
}

/* Estado de éxito */
.file-item.upload-success {
    border-left-color: #28a745;
}

.file-item.upload-success .progress-bar-fill {
    width: 100%;
    background-color: #28a745;
}

.file-item.upload-success .file-info i {
    color: #28a745 !important;
}

/* Icono de Check miniatura de archivo*/
.check-icon {
    display: none;
    color: #28a745;
    margin-left: 10px;
    font-size: 1.2em;
}

.file-item.upload-success .check-icon {
    display: inline-block;
}


.file-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: transform 0.2s;
}

.file-thumb:hover {
    transform: scale(1.1);
}

.file-row-main {
    display: flex;
    align-items: center;
    gap: 12px; /* Espacio entre miniatura y datos */
}

.modal-overlay iframe {
    border-radius: 10px;
    background: white;
}


/* Asegúrate de que el iframe ocupe buen espacio en el modal */
.modal-overlay iframe {
    width: 90%;
    height: 85vh;
    border-radius: 8px;
    background: white;
}


.file-info-text {
    max-width: 180px; /* Ajusta este ancho según tu diseño móvil */
    display: flex;
    flex-direction: column;
}

.file-name-limit {
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;      /* Evita que el nombre salte a otra línea */
    overflow: hidden;         /* Esconde lo que sobra */
    text-overflow: ellipsis;  /* Agrega los tres puntos (...) */
    display: inline-block;
    max-width: 100%;          /* Se ajusta al contenedor padre */
}

.input-group-modern {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group-modern label {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-creditodos {
    width: 100%;
    padding: 12px 15px;
    border: 4px solid #ffffff;
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-dark);
    transition: all 0.3s ease;
    outline: none;
}

.input-creditodos:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.15);
    background-color: #ffffff;
}

.input-creditodos::placeholder {
    color: #bbb;
}

/* Clase específica para la tarjeta de datos */
.extractions.card {
    max-width: 400px;     /* Evita que se ensanche demasiado */
    margin-left: auto;    /* Estas dos líneas centran la tarjeta */
    margin-right: auto;   
    align-self: center;   /* Si usas Flexbox en el padre, esto la centra verticalmente */
    width: 100%;          /* Pero permite que sea responsiva en móviles */
    box-sizing: border-box;
}

/* Contenedor de inputs para que no empujen los bordes */
.input-group-modern {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left; /* Mantiene las etiquetas alineadas a la izquierda dentro del centrado */
}


/* 1. Definimos una medida estándar para todas las tarjetas */
.card.extractions, 
.card.requisitos {
    width: 90%;           /* En móviles ocupa casi todo el ancho */
    max-width: 420px;     /* Ancho máximo exacto para PC y Tablets */
    margin: 15px auto;    /* Centra las tarjetas y las separa entre sí */
    padding: 20px;
    background: #f6eded;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    box-sizing: border-box; /* Asegura que el padding no estire la tarjeta */
    display: flex;
    flex-direction: column;
}

/* 2. Ajustamos los títulos para que sean consistentes */
.card h3 {
    text-align: center;
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
}

/* 3. El área de carga debe ocupar todo el ancho interno */
.upload-area {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* 4. El botón debe ser proporcional a los inputs de la tarjeta de arriba */
.upload-area .btn-blue {
    width: 100%;          /* Ocupa el mismo ancho que los campos de texto */
    padding: 15px;
    border-radius: 15px;  /* Curvatura similar a los inputs */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    transition: all 0.2s ease;
}

/* 5. Aseguramos que los inputs de la otra tarjeta tengan el mismo ancho */
.input-creditodos {
    width: 100%;
    box-sizing: border-box; /* Crucial para que no se salgan de la tarjeta */
}