/* ===== VARIABLES CORPORATIVAS UNIFICADAS ===== */
:root {
    /* Paleta profesional - Azul corporativo */
    --afocat-primary: #2c3e50;
    --afocat-primary-light: #34495e;
    --afocat-primary-dark: #1a252f;
    --afocat-secondary: #7f8c8d;
    --afocat-border: #ecf0f1;
    --afocat-light: #f9f9f9;
    --afocat-dark: #2c3e50;
    --afocat-success: #27ae60;
    --afocat-danger: #e74c3c;
    --afocat-warning: #f39c12;
    --afocat-info: #3498db;
    
    /* Estados más sutiles */
    --afocat-success-bg: rgba(39, 174, 96, 0.08);
    --afocat-danger-bg: rgba(231, 76, 60, 0.08);
    --afocat-warning-bg: rgba(243, 156, 18, 0.08);
    
    /* Estilos minimalistas */
    --afocat-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    --afocat-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08);
    --afocat-radius: 6px;
    --afocat-radius-sm: 4px;
    --afocat-transition: all 0.2s ease;
}

/* ===== COMPONENTE DE FORMULARIO PROFESIONAL ===== */
.afocat-form-wrapper {
    background: white;
    border-radius: var(--afocat-radius);
    padding: 60px 180px;
    box-shadow: var(--afocat-shadow);
    margin-bottom: 20px;
    border: 1px solid var(--afocat-border);
}

.afocat-form-wrapper h3 {
    color: var(--afocat-primary);
    margin-bottom: 25px;
    font-size: 50px;
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid var(--afocat-border);
    padding-bottom: 12px;
    text-align: center;
    text-transform: uppercase;
}

.afocat-form-group {
    margin-bottom: 20px;
}

.afocat-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--afocat-primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.afocat-input {
    width: 100%;
    padding: 12px 14px !important;
    border: 1px solid var(--afocat-border);
    border-radius: var(--afocat-radius-sm);
    font-size: 15px;
    transition: var(--afocat-transition);
    background-color: white;
    color: var(--afocat-dark);
    font-family: 'Segoe UI', 'Roboto', sans-serif;
}

.afocat-input:focus {
    outline: none;
    border-color: var(--afocat-primary);
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.1);
}

/* ===== FORMULARIO RESPONSIVE - DISEÑO POR DEFECTO (MÓVIL) ===== */
.afocat-form {
    display: block;
}

.afocat-form-divider {
    text-align: center;
    margin: 25px 0;
    color: var(--afocat-secondary);
    font-weight: 600;
    font-size: 14px;
    position: relative;
}

.afocat-form-divider::before {
    content: '';
    position: absolute;
    left: 10%;
    top: 50%;
    right: 10%;
    height: 1px;
    background: var(--afocat-border);
    z-index: 1;
}

.afocat-form-divider span {
    background: white;
    padding: 0 20px;
    display: inline-block;
    position: relative;
    z-index: 2;
}

.afocat-form-actions {
    margin-top: 20px;
    text-align: center;
}

.afocat-help-text {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--afocat-secondary);
    font-style: italic;
}

/* ===== RESULTADOS PROFESIONALES - DISEÑO MINIMALISTA ===== */
.afocat-resultado {
    background: white;
    border-radius: var(--afocat-radius);
}

.afocat-resultado h3 {
    color: var(--afocat-primary);
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--afocat-border);
}

/* Contenedor de resultados - Estilo tipo tabla sin bordes visibles */
.afocat-resultado-item {
    background: white;
    margin-bottom: 1px;
    padding: 0;
    overflow: hidden;
    transition: var(--afocat-transition);
}

.afocat-resultado-item:hover {
    background: var(--afocat-light);
}

.afocat-resultado-body {
    padding: 0;
}

/* Sistema de filas profesional - estilo minimalista */
.afocat-resultado-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--afocat-border);
}

.afocat-resultado-row:last-child {
    border-bottom: none;
}

.afocat-resultado-col {
    flex: 1;
    min-width: 300px;
    padding: 0;
    display: flex;
}

.afocat-resultado-col b{
    padding-right: 5px;
}

/* Estilo de cada campo de resultado */
.afocat-resultado-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    min-height: 56px;
    box-sizing: border-box;
}

.afocat-resultado-field:nth-child(even) {
    background: var(--afocat-light);
}

/* Etiqueta del campo */
.afocat-resultado-label {
    color: var(--afocat-primary);
    font-weight: 500;
    font-size: 14px;
    min-width: 180px;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}

/* Valor del campo */
.afocat-resultado-value {
    color: var(--afocat-dark);
    text-align: right;
    flex: 1;
    word-break: break-word;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
}

/* ===== ESTADOS MINIMALISTAS MEJORADOS ===== */
.estado-vigente,
.estado-vencido,
.estado-desconocido {
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px; /* Espacio mejorado entre icono y texto */
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid transparent;
    min-height: 32px;
}

.estado-vigente {
    color: var(--afocat-success);
    background: var(--afocat-success-bg);
    border-color: rgba(39, 174, 96, 0.2);
}

.estado-vigente::before {
    content: '✓';
    font-weight: bold;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.estado-vencido {
    color: var(--afocat-danger);
    background: var(--afocat-danger-bg);
    border-color: rgba(231, 76, 60, 0.2);
}

.estado-vencido::before {
    content: '✗';
    font-weight: bold;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.estado-desconocido {
    color: var(--afocat-secondary);
    background: rgba(127, 140, 141, 0.08);
    border-color: rgba(127, 140, 141, 0.2);
}

.estado-desconocido::before {
    content: '?';
    font-weight: bold;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

/* ===== MODAL BOOTSTRAP STYLE ===== */
.afocat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    display: none;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

/* Cuando el modal está abierto, ocultamos el scroll de la página principal */
body.modal-open {
    overflow: hidden;
    padding-right: 0px !important; /* Espacio para evitar salto de contenido */
}

.afocat-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1040;
}

.afocat-modal-dialog {
    position: relative;
    width: auto;
    max-width: 800px;
    margin: 1.75rem auto;
    pointer-events: none;
    z-index: 1050;
}

.afocat-modal.show .afocat-modal-dialog {
    transform: none;
}

.afocat-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid var(--afocat-border);
    border-radius: var(--afocat-radius);
    box-shadow: var(--afocat-shadow-lg);
    outline: 0;
    z-index: 0; 
}

.afocat-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--afocat-border);
    background: var(--afocat-light);
    border-top-left-radius: var(--afocat-radius);
    border-top-right-radius: var(--afocat-radius);
}

.afocat-modal-title {
    margin-bottom: 0;
    line-height: 1.5;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--afocat-primary);
}

.afocat-modal-close {
    padding: 0.5rem;
    margin: -0.5rem -0.5rem -0.5rem auto;
    background-color: transparent;
    border: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--afocat-secondary);
    cursor: pointer;
    border-radius: var(--afocat-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.afocat-modal-close:hover {
    color: var(--afocat-danger);
    background: rgba(231, 76, 60, 0.1);
}

.afocat-modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1.2rem;
}

/* Contenedor interno para el contenido del modal */
.afocat-modal-body-inner {
    padding: 0;
}

/* Resultados dentro del modal */
.afocat-modal .afocat-resultado-item {
    border: 1px solid var(--afocat-border);
    border-radius: var(--afocat-radius);
    overflow: hidden;
    background: white;
}

.afocat-modal .afocat-resultado-header {
    background: var(--afocat-light);
    padding: 1rem 0.5rem;
    border-bottom: 1px solid var(--afocat-border);
}

.afocat-modal .afocat-resultado-header h4 {
    margin: 0;
    color: var(--afocat-primary);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.afocat-modal .afocat-resultado-body {
    padding: 1.1rem;
}

.afocat-modal .afocat-resultado-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.625rem;
}

.afocat-modal .afocat-resultado-col {
    flex: 1;
    min-width: 250px;
    padding: 0 0.625rem;
}

.afocat-modal .afocat-resultado-col p {
    margin: 0;
    /*padding: 0.625rem 0;*/
    border-bottom: 1px solid rgba(236, 240, 241, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 36px;
}

.afocat-modal .afocat-resultado-col p:last-child {
    border-bottom: none;
}

.afocat-modal .afocat-resultado-col strong {
    color: var(--afocat-primary);
    font-weight: 500;
    min-width: 140px;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.afocat-modal .afocat-resultado-col span {
    color: var(--afocat-dark);
    text-align: right;
    flex: 1;
    word-break: break-word;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.afocat-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--afocat-border);
    background: var(--afocat-light);
    border-bottom-right-radius: var(--afocat-radius);
    border-bottom-left-radius: var(--afocat-radius);
    gap: 0.5rem;
}

/* ===== BOTONES PROFESIONALES ===== */
.afocat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    border: 1px solid var(--afocat-primary);
    border-radius: var(--afocat-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--afocat-transition);
    text-decoration: none;
    background: white;
    color: var(--afocat-primary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.5;
    gap: 0.5rem;
}

.afocat-btn-primary {
    background: var(--afocat-primary);
    color: white;
    border-color: var(--afocat-primary);
}

.afocat-btn-primary:hover {
    background: var(--afocat-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--afocat-shadow);
}

.afocat-btn-secondary {
    background: white;
    color: var(--afocat-primary);
    border-color: var(--afocat-border);
}

.afocat-btn-secondary:hover {
    background: var(--afocat-light);
    border-color: var(--afocat-primary-light);
}

/* ===== ESTADOS DESTACADOS - VERSIÓN MEJORADA ===== */
.afocat-estado-container {
    text-align: center;
}

.afocat-estado-badge {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: white;
    border-radius: var(--afocat-radius);
}

.afocat-estado-badge .estado-vigente,
.afocat-estado-badge .estado-vencido,
.afocat-estado-badge .estado-desconocido {
    padding: 0.625rem 1.5rem;
    font-size: 0.9375rem;
    border: none;
    gap: 0.75rem;
    min-height: auto;
}

.afocat-estado-badge .estado-vigente {
    background: var(--afocat-success);
    color: white;
}

.afocat-estado-badge .estado-vencido {
    background: var(--afocat-danger);
    color: white;
}

.afocat-estado-badge .estado-desconocido {
    background: var(--afocat-secondary);
    color: white;
}

/* ===== UTILIDADES ===== */
.afocat-text-center { text-align: center; }
.afocat-mt-20 { margin-top: 20px; }
.afocat-mb-20 { margin-bottom: 20px; }
.afocat-mt-30 { margin-top: 30px; }
.afocat-mb-30 { margin-bottom: 30px; }

/* ===== SCROLLBAR PARA MODAL ===== */
.afocat-modal-body::-webkit-scrollbar {
    width: 8px;
}

.afocat-modal-body::-webkit-scrollbar-track {
    background: var(--afocat-light);
    border-radius: 4px;
}

.afocat-modal-body::-webkit-scrollbar-thumb {
    background: var(--afocat-secondary);
    border-radius: 4px;
    opacity: 0.5;
}

.afocat-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--afocat-primary-light);
    opacity: 0.7;
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.afocat-modal.show {
    animation: fadeIn 0.3s ease;
}

.afocat-modal.show .afocat-modal-dialog {
    animation: modalSlideDown 0.3s ease;
}

/* ===== FORMULARIO EN ESCRITORIO (HORIZONTAL) ===== */
@media (min-width: 769px) {
    .afocat-form {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        gap: 20px;
    }
    
    .afocat-form-group {
        flex: 1;
        min-width: 200px;
        margin-bottom: 0;
    }
    
    .afocat-form-divider {
        flex: 0 0 auto;
        margin: 0;
        padding: 0 10px;
        position: relative;
        bottom: -10px;
    }
    
    .afocat-form-divider::before {
        display: none;
    }
    
    .afocat-form-divider span {
        background: var(--afocat-light);
        padding: 10px 16px;
        border-radius: 50%;
        border: 2px solid var(--afocat-border);
        font-size: 13px;
        min-width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .afocat-form-actions {
        flex: 1 0 100%;
        margin-top: 25px;
    }
}

/* ===== RESPONSIVE DESIGN GENERAL ===== */
@media (max-width: 768px) {
    .afocat-form-wrapper {
        padding: 1.25rem;
    }
    
    .afocat-resultado-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem 0.9375rem;
    }
    
    .afocat-resultado-label {
        min-width: auto;
        font-size: 0.8125rem;
    }
    
    .afocat-resultado-value {
        text-align: left;
        width: 100%;
        font-size: 0.875rem;
    }
    
    .afocat-resultado-col {
        min-width: 100%;
    }
    
    .afocat-modal-dialog {
        max-width: 95%;
        margin: 0.5rem auto;
    }
    
    .afocat-modal-header {
        padding: 0.75rem 1rem;
    }
    
    .afocat-modal-body {
        padding: 1rem;
    }
    
    .afocat-modal-footer {
        padding: 0.75rem 1rem;
        flex-direction: column;
    }
    
    .afocat-modal-footer .afocat-btn {
        width: 100%;
    }
    
    .afocat-modal .afocat-resultado-col {
        flex: 100%;
        min-width: 100%;
    }
    
    .afocat-modal .afocat-resultado-col p {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.375rem;
        padding: 0.75rem 0;
    }
    
    /* Ajustes para el formulario en tablet */
    .afocat-form-divider::before {
        left: 5%;
        right: 5%;
    }
}

@media (max-width: 480px) {
    .afocat-form-wrapper {
        padding: 1rem;
    }
    
    .afocat-form-wrapper h3 {
        font-size: 1.125rem;
    }
    
    .afocat-form-divider::before {
        left: 0;
        right: 0;
    }
    
    .afocat-form-divider span {
        padding: 0 15px;
    }
    
    .afocat-modal-dialog {
        margin: 0.25rem auto;
        width: 98%;
    }
    
    .afocat-modal-header {
        padding: 0.625rem 0.875rem;
    }
    
    .afocat-modal-body {
        padding: 0.875rem;
    }
    
    .afocat-modal .afocat-resultado-body {
        padding: 0.875rem;
    }
    
    .estado-vigente,
    .estado-vencido,
    .estado-desconocido {
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* ===== SEPARADORES SUTILES ===== */
.afocat-divider {
    height: 1px;
    background: var(--afocat-border);
    margin: 1.25rem 0;
    border: none;
}

/* ===== TEXTO SECUNDARIO ===== */
.afocat-text-muted {
    color: var(--afocat-secondary);
    font-size: 0.8125rem;
    font-style: italic;
}

/* ===== SIN RESULTADOS ===== */
.afocat-no-results {
    text-align: center;
    padding: 2.5rem 1.25rem;
    color: var(--afocat-secondary);
    border: 1px solid var(--afocat-border);
    border-radius: var(--afocat-radius);
    background: var(--afocat-light);
}

.afocat-no-results::before {
    content: '📄';
    font-size: 2.25rem;
    display: block;
    margin-bottom: 0.9375rem;
    opacity: 0.5;
}


/* ===== LOADING SPINNER ===== */
.afocat-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.afocat-loading .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}