/* Verificador de Códigos - CSS Moderno */

:root {
    --primary-color: #0d6efd;
    --primary-dark: #0b5ed7;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    --border-radius: 15px;
}

/* Background gradient */
.bg-gradient {
    background: var(--gradient-bg);
    min-height: 100vh;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 20%, 40%, 60%, 80% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
}

/* Logo container */
.logo-container {
    animation: fadeInUp 0.8s ease-out;
}

.logo-container i {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Cards */
.card {
    animation: fadeInUp 0.8s ease-out 0.2s both;
    border: none !important;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* Form styling */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    transform: translateY(-2px);
}

.form-control.is-invalid {
    animation: shake 0.5s;
    border-color: var(--danger-color);
}

/* Input group */
.input-group-text {
    border: 2px solid #e9ecef;
    border-right: none;
    border-radius: 10px 0 0 10px;
}

.input-group .form-control {
    border-left: none;
    border-radius: 0;
}

.input-group .btn {
    border-radius: 0 10px 10px 0;
    border: 2px solid var(--primary-color);
    border-left: none;
    padding: 12px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.input-group .btn:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* Buttons */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 10px 20px;
    transition: all 0.3s ease;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #157347 100%);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #b02a37 100%);
}

/* Loading spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
    animation: spin 1s linear infinite;
}

/* Resultado exitoso */
.resultado-exitoso {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid var(--success-color);
    border-radius: var(--border-radius);
    padding: 20px;
    animation: fadeInUp 0.5s ease-out;
}

.resultado-exitoso .user-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--success-color) 0%, #157347 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 20px rgba(25, 135, 84, 0.3);
    animation: pulse 2s infinite;
}

.resultado-exitoso .user-avatar i {
    font-size: 2rem;
    color: white;
}

/* Resultado fallido */
.resultado-fallido {
    background: linear-gradient(135deg, #f8d7da 0%, #f1aeb5 100%);
    border: 2px solid var(--danger-color);
    border-radius: var(--border-radius);
    padding: 20px;
    animation: fadeInUp 0.5s ease-out;
}

.resultado-fallido .error-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--danger-color) 0%, #b02a37 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.3);
}

.resultado-fallido .error-icon i {
    font-size: 2rem;
    color: white;
}

/* Información del usuario */
.user-info {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.user-info .info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 15px;
}

.user-info .info-item:last-child {
    border-bottom: none;
}

.user-info .info-label {
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: fit-content;
    white-space: nowrap;
}

.user-info .info-label i {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.user-info .info-value {
    color: var(--primary-color);
    font-weight: 500;
    text-align: right;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Status badges */
.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-activo {
    background: linear-gradient(135deg, var(--success-color) 0%, #157347 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

.status-inactivo {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Info cards responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .card-body {
        padding: 30px !important;
    }
    
    .display-6 {
        font-size: 2rem;
    }
    
    .input-group-lg .form-control,
    .input-group-lg .btn {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Efectos hover para las cards de información */
.row.g-3 .col-md-4 > div {
    transition: all 0.3s ease;
    cursor: pointer;
}

.row.g-3 .col-md-4 > div:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Animación para los iconos */
.row.g-3 i {
    transition: all 0.3s ease;
}

.row.g-3 .col-md-4 > div:hover i {
    transform: scale(1.1);
}

/* Mejoras adicionales */
.form-text {
    font-size: 14px;
    margin-top: 8px !important;
}

.lead {
    font-weight: 400;
    opacity: 0.8;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Logo de la compañía */
.company-logo {
    animation: fadeInUp 0.8s ease-out;
    margin-bottom: 2rem;
}

.logo-img {
    max-height: 120px;
    width: auto;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.15));
}

/* Botón de descarga de documentos */
.btn-download-docs {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-download-docs:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(13, 110, 253, 0.4);
    background: var(--primary-dark);
}

.btn-download-docs:active {
    transform: translateY(-1px);
}

/* Overlay de documentos */
.docs-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.docs-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.docs-container {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.5s ease-out;
}

.docs-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.docs-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.btn-close-docs {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close-docs:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.docs-content {
    padding: 30px;
    max-height: calc(80vh - 100px);
    overflow-y: auto;
}

.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.doc-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: var(--dark-color);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.doc-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.3);
    text-decoration: none;
}

.doc-item i {
    font-size: 1.5rem;
    margin-right: 15px;
    color: #dc3545;
    transition: all 0.3s ease;
}

.doc-item:hover i {
    color: white;
    transform: scale(1.1);
}

.doc-item span {
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
}

/* Responsive design */
@media (max-width: 768px) {
    .docs-container {
        width: 95%;
        max-height: 90vh;
    }
    
    .docs-header {
        padding: 15px 20px;
    }
    
    .docs-header h3 {
        font-size: 1.2rem;
    }
    
    .docs-content {
        padding: 20px;
    }
    
    .docs-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .btn-download-docs {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .logo-img {
        max-height: 80px;
    }
}

@media (max-width: 480px) {
    .docs-header h3 {
        font-size: 1rem;
    }
    
    .doc-item {
        padding: 12px 15px;
    }
    
    .doc-item span {
        font-size: 13px;
    }
}

/* ============ Botón de regreso al portal principal */
.portal-back-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #27AE60 0%, #2ECC71 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
    border: none;
    text-decoration: none;
}

.portal-back-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.6);
    background: linear-gradient(135deg, #2ECC71 0%, #58D68D 100%);
}

.portal-back-btn i {
    color: white;
    font-size: 20px;
    transition: all 0.3s ease;
}

.portal-back-btn:hover i {
    transform: scale(1.1);
}

/* Tooltip para el botón */
.portal-back-btn::before {
    content: 'Volver al Portal Principal';
    position: absolute;
    top: 60px;
    right: 0;
    background: rgba(39, 174, 96, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.portal-back-btn:hover::before {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .portal-back-btn {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }

    .portal-back-btn i {
        font-size: 18px;
    }

    .portal-back-btn::before {
        right: -20px;
        font-size: 11px;
        padding: 6px 10px;
    }
}
