/**
 * 🧩 Componentes Reutilizables
 * Estilos para componentes comunes (cards, buttons, forms, etc.)
 */

/* ========== CARDS ========== */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing-xl);
    overflow: hidden;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    background: rgba(190, 0, 255, 0.08);
    color: var(--text-primary);
    padding: var(--spacing-lg);
    border-bottom: 3px solid var(--orange-color);
}

.card-header h2 {
    font-size: 1.35rem;
    font-weight: 600;
}

.card-body {
    padding: var(--spacing-xl);
}

/* ========== WELCOME NOTICE ========== */
.welcome-notice {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    padding: var(--spacing-xl);
    margin: 0;
    border-bottom: 2px solid rgba(190, 0, 255, 0.1);
}

.welcome-notice h3 {
    color: var(--primary-color);
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 var(--spacing-md) 0;
    letter-spacing: -0.5px;
}

.welcome-notice p {
    color: #4a4a4a;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(190, 0, 255, 0.1);
}

.form-group small {
    display: block;
    margin-top: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ========== BUTTONS ========== */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-block;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: rgba(190, 0, 255, 0.1);
    color: var(--text-primary);
    border: 2px solid var(--orange-color);
}

.btn-primary:hover:not(:disabled) {
    background: var(--orange-color);
    color: white;
    border-color: var(--orange-color);
}

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

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-block {
    width: 100%;
    display: block;
    margin-bottom: var(--spacing-sm);
}

.button-group {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

/* ========== BADGES ========== */
.badge-count {
    background: var(--success-color);
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

/* ========== CATEGORY CARDS ========== */
.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-lg);
}

.category-card {
    border: 3px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-xxl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    animation: cardPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.category-card:nth-child(1) { animation-delay: 0.1s; }
.category-card:nth-child(2) { animation-delay: 0.2s; }
.category-card:nth-child(3) { animation-delay: 0.3s; }
.category-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardPopIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.category-card:hover {
    border-color: var(--orange-color);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px rgba(250, 100, 0, 0.15);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    color: #FA6400;
    filter: drop-shadow(0 4px 8px rgba(250, 100, 0, 0.3));
}

/* ============================================
   Submenú de Garantías
   ============================================ */
.garantias-submenu-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-lg);
}

.garantia-submenu-card {
    border: 3px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-xxl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    animation: cardPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    background: linear-gradient(135deg, rgba(250, 100, 0, 0.03) 0%, rgba(255, 255, 255, 0.8) 100%);
}

.garantia-submenu-card:nth-child(1) { animation-delay: 0.1s; }
.garantia-submenu-card:nth-child(2) { animation-delay: 0.2s; }
.garantia-submenu-card:nth-child(3) { animation-delay: 0.3s; }

.garantia-submenu-card:hover {
    border-color: var(--orange-color);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px rgba(250, 100, 0, 0.15);
    background: linear-gradient(135deg, rgba(250, 100, 0, 0.08) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.garantia-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    color: #FA6400;
    filter: drop-shadow(0 4px 8px rgba(250, 100, 0, 0.3));
}

.garantia-submenu-card h3 {
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.garantia-submenu-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

.stage-icon {
    color: #FA6400;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 4px 8px rgba(250, 100, 0, 0.3));
}

.result-actions {
    text-align: center;
    margin-top: 2rem;
}

.result-actions .btn-reset-form {
    min-width: 200px;
}

.category-card h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.category-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========== STAGE CARDS ========== */
.stage-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-lg);
}

.stage-card {
    border: 3px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-xxl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    animation: cardPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stage-card:nth-child(1) { animation-delay: 0.1s; }
.stage-card:nth-child(2) { animation-delay: 0.2s; }
.stage-card:nth-child(3) { animation-delay: 0.3s; }
.stage-card:nth-child(4) { animation-delay: 0.4s; }

.stage-card:hover {
    border-color: var(--orange-color);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 20px rgba(250, 100, 0, 0.2);
}

.stage-card h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 1rem;
}

.stage-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* ========== FILE INPUTS ========== */
.file-inputs-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.file-input-group {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-xxl);
    background: var(--card-bg);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    min-height: 280px;
    box-shadow: var(--shadow);
    cursor: pointer;
    animation: cardPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

/* Animación escalonada para inputs de archivo */
.file-input-group:nth-child(1) { animation-delay: 0.05s; }
.file-input-group:nth-child(2) { animation-delay: 0.1s; }
.file-input-group:nth-child(3) { animation-delay: 0.15s; }
.file-input-group:nth-child(4) { animation-delay: 0.2s; }
.file-input-group:nth-child(5) { animation-delay: 0.25s; }
.file-input-group:nth-child(6) { animation-delay: 0.3s; }
.file-input-group:nth-child(7) { animation-delay: 0.35s; }
.file-input-group:nth-child(8) { animation-delay: 0.4s; }

.file-input-group:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.file-input-group.enabled {
    border-color: var(--primary-color);
    background: rgba(190, 0, 255, 0.02);
    box-shadow: var(--shadow-md);
}

.file-input-group.enabled:hover {
    box-shadow: var(--shadow-xl);
}

.file-input-group.selected {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
    box-shadow: var(--shadow-md);
}

.file-input-group.selected:hover {
    box-shadow: var(--shadow-xl);
}

.file-input-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.file-input-header::before {
    content: "📄";
    font-size: 4rem;
    opacity: 0.6;
    transition: all var(--transition-normal);
}

.file-input-group.enabled .file-input-header::before,
.file-input-group.selected .file-input-header::before {
    opacity: 1;
    transform: scale(1.1);
}

.file-input-header input[type="checkbox"] {
    width: 28px;
    height: 28px;
    cursor: pointer;
    margin-top: var(--spacing-sm);
}

.file-type-label {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    text-align: center;
    line-height: 1.5;
}

/* Input de archivo oculto */
.file-input-group input[type="file"] {
    display: none;
}

/* Contenedor del botón personalizado */
.file-input-wrapper {
    margin-top: auto;
}

/* Input de archivo oculto (para custom styling) */
.hidden-file-input {
    display: none !important;
}

/* Botón corporativo de carga */
.file-upload-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    width: 100%;
    padding: 1.25rem 1.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    min-height: 60px;
}

.file-upload-button:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.file-upload-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ✅ Estado cuando el archivo está cargado */
.file-upload-button.file-loaded {
    background: var(--success-color);
    color: white;
    font-size: 0.95rem;
}

.file-upload-button.file-loaded:hover:not(:disabled) {
    background: #059669; /* success-dark */
    transform: translateY(-2px);
}

.file-name-display {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--success-color);
    border-radius: var(--border-radius-sm);
    color: var(--success-color);
    font-weight: 600;
    font-size: 0.9rem;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    animation: slideIn 0.3s ease-out;
    text-align: center;
    word-break: break-all;
}

.file-name-display.visible {
    display: flex;
}

.file-name-display.visible::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1rem;
}

/* File Loading Indicator */
.file-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-color);
    font-weight: 500;
}

.file-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(190, 0, 255, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* ========== INFO BOX ========== */
.info-box {
    background: rgba(190, 0, 255, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-lg);
}

/* Clases de utilidad */
.text-center {
    text-align: center;
}

.d-block {
    display: block;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.text-primary {
    color: var(--primary-color);
    font-weight: 600;
}

.text-primary:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ========== RESULT ========== */
.result-success {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--success-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.result-error {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--danger-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.result-batch {
    margin-bottom: var(--spacing-xl);
}

.radicado-display {
    font-size: 2rem;
    font-weight: bold;
    color: var(--success-color);
    text-align: center;
    margin: var(--spacing-md) 0;
    padding: var(--spacing-lg);
    background: white;
    border-radius: var(--border-radius);
    border: 3px dashed var(--success-color);
}

.file-list {
    list-style: none;
    margin-top: var(--spacing-md);
}

.file-list li {
    padding: var(--spacing-md);
    background: white;
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-sm);
    border: 1px solid var(--border-color);
}

.file-list li strong {
    color: var(--primary-color);
}

.file-list li small {
    display: block;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

/* ========== LOADING ========== */
.upload-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-xl);
    margin: var(--spacing-xl) 0;
    background: linear-gradient(135deg, rgba(190, 0, 255, 0.1), rgba(16, 185, 129, 0.1));
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    animation: pulse 2s ease-in-out infinite;
}

.upload-progress.hidden {
    display: none;
}

.progress-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(190, 0, 255, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

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

.progress-text {
    text-align: left;
}

.progress-text strong {
    display: block;
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.progress-text p {
    color: var(--text-secondary);
    margin: 0;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(190, 0, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(190, 0, 255, 0);
    }
}

/* ========== NOTIFICATION ANIMATIONS ========== */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* ========== SISTEMA DE NOTIFICACIONES ========== */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--z-notification);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

.notification {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: white;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-xl);
    border-left: 4px solid;
    opacity: 0;
    transform: translateX(400px);
    transition: all var(--transition-normal);
    pointer-events: all;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.notification-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Tipos de notificaciones */
.notification-success {
    border-left-color: var(--success-color);
}

.notification-success .notification-icon {
    color: var(--success-color);
}

.notification-error {
    border-left-color: var(--danger-color);
}

.notification-error .notification-icon {
    color: var(--danger-color);
}

.notification-warning {
    border-left-color: var(--warning-color);
}

.notification-warning .notification-icon {
    color: var(--warning-color);
}

.notification-info {
    border-left-color: var(--primary-color);
}

.notification-info .notification-icon {
    color: var(--primary-color);
}

/* Responsive para notificaciones */
@media (max-width: 768px) {
    .notification-container {
        left: 10px;
        right: 10px;
        top: 10px;
        max-width: calc(100% - 20px);
    }
    
    .notification {
        padding: var(--spacing-md);
    }
}

/* ========== OVERLAY DE CARGA CORPORATIVO ========== */
.upload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(191, 0, 255, 0.37);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.upload-overlay.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.upload-overlay-content {
    text-align: center;
    color: white;
    max-width: 500px;
    padding: var(--spacing-xxl);
}

.upload-overlay-logo {
    font-size: 5rem;
    margin-bottom: var(--spacing-lg);
    animation: pulse-slow 2s ease-in-out infinite;
}

.upload-overlay-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: var(--spacing-md);
    animation: fadeInUp 0.5s ease-out;
}

.upload-overlay-message {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: var(--spacing-xl);
    opacity: 0.9;
    animation: fadeInUp 0.5s ease-out 0.1s both;
}

.upload-overlay-spinner {
    width: 80px;
    height: 80px;
    border: 8px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-lg);
}

.upload-overlay-progress {
    font-family: var(--font-body);
    font-size: 0.95rem;
    opacity: 0.8;
    animation: fadeInUp 0.5s ease-out 0.2s both;
}

@keyframes pulse-slow {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

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

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

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .card {
        padding: var(--spacing-md);
    }
    
    .card-body {
        padding: var(--spacing-md);
    }
    
    .card-header h2 {
        font-size: 1.5rem;
    }

    .button-group {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .btn {
        width: 100%;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .form-group label {
        font-size: 0.9375rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    .category-cards,
    .stage-cards,
    .garantias-submenu-cards {
        gap: var(--spacing-md);
        grid-template-columns: 1fr;
    }
    
    .category-card,
    .stage-card,
    .garantia-submenu-card {
        padding: var(--spacing-md);
    }

    /* File inputs en móvil: 1 columna */
    .file-inputs-container {
        grid-template-columns: 1fr;
    }

    .file-input-group {
        min-height: auto;
    }

    .file-input-header::before {
        font-size: 2.5rem;
    }
    
    /* Stages en móvil: 1 columna */
    .stage-cards {
        grid-template-columns: 1fr;
    }
    
    .stage-card {
        padding: var(--spacing-lg);
    }
}

/* Tablets: 2 columnas */
@media (min-width: 769px) and (max-width: 1024px) {
    .file-inputs-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stage-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop pequeño: 3 columnas */
@media (min-width: 1025px) and (max-width: 1440px) {
    .file-inputs-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop grande: 4 columnas */
@media (min-width: 1441px) {
    .file-inputs-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========== PÁGINA DE RESULTADOS ========== */
.result-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.result-header {
    text-align: center;
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-xl);
    background: linear-gradient(135deg, rgba(190, 0, 255, 0.1), rgba(190, 0, 255, 0.05));
    border: 2px solid var(--primary-color);
}

.result-header.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    border-color: var(--success-color);
}

.result-header.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border-color: var(--danger-color);
}

.result-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
}

.result-header h3 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--text-color);
}

.radicado-header {
    margin-top: var(--spacing-md);
    font-size: 1.3rem;
    color: var(--text-color);
    font-family: var(--font-heading);
}

.radicado-header strong {
    color: var(--primary-color);
    font-weight: 800;
}

/* Fecha y hora */
.result-datetime {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-xl);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.datetime-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.datetime-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.datetime-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Información del documento */
.result-document-info {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-xl);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--primary-color);
}

.result-document-info h4 {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

.document-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 700;
    font-family: var(--font-heading);
}

/* Batches de resultados */
.result-batch {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--success-color);
}

.result-batch.error {
    border-left-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.02);
}

.batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.batch-number {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.batch-meta {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.meta-item {
    background: rgba(190, 0, 255, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(190, 0, 255, 0.2);
}

.radicado-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(190, 0, 255, 0.3);
}

.error-badge {
    background: var(--danger-color);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Archivos cargados */
.uploaded-files {
    margin-top: var(--spacing-md);
}

.uploaded-files h5 {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.file-card {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-lg);
    padding: var(--spacing-xl);
    background: rgba(190, 0, 255, 0.03);
    border: 1px solid rgba(190, 0, 255, 0.15);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.file-card:hover {
    background: rgba(190, 0, 255, 0.08);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(190, 0, 255, 0.15);
    transform: translateY(-2px);
}

.file-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-type {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    font-family: var(--font-heading);
}

.file-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.file-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.file-category,
.file-stage {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-weight: 600;
}

.file-category {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.file-stage {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.file-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.file-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Mensajes de error */
.error-message {
    padding: var(--spacing-md);
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--border-radius);
    color: var(--danger-color);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-md);
}

.error-details {
    margin-top: var(--spacing-md);
}

.error-details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: var(--spacing-sm);
}

.error-details summary:hover {
    color: var(--primary-color);
}

.error-details pre {
    background: #f8f9fa;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    overflow-x: auto;
    margin-top: var(--spacing-sm);
}

/* ========== RESUMEN DE CARGA ========== */
.upload-summary {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-xl);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--primary-color);
}

.upload-summary h4 {
    margin: 0 0 var(--spacing-lg) 0;
    color: var(--text-color);
    font-size: 1.2rem;
    font-family: var(--font-heading);
}

.summary-section {
    background: rgba(190, 0, 255, 0.03);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    border: 1px solid rgba(190, 0, 255, 0.1);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.summary-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.summary-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.05rem;
    font-family: var(--font-heading);
}

/* Lista de documentos */
.documents-list {
    margin-top: var(--spacing-md);
    background: white;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.documents-list-header {
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary-color);
    color: var(--text-color);
    font-family: var(--font-heading);
}

.documents-list-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.document-list-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    background: rgba(190, 0, 255, 0.02);
    border-radius: 4px;
    transition: background 0.2s ease;
}

.document-list-item:hover {
    background: rgba(190, 0, 255, 0.08);
}

.doc-number {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 25px;
}

.doc-type {
    font-weight: 700;
    color: var(--primary-color);
    font-family: var(--font-heading);
    flex: 0 0 auto;
}

.doc-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-link {
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.doc-link:hover {
    background: var(--primary-color);
    color: white;
}

/* Responsive para resultados */
@media (max-width: 768px) {
    .result-header h3 {
        font-size: 1.4rem;
    }
    
    .radicado-header {
        font-size: 1.1rem;
    }
    
    .result-datetime {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .document-info-grid {
        grid-template-columns: 1fr;
    }
    
    .files-grid {
        grid-template-columns: 1fr;
    }
    
    .batch-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
    
    .batch-meta {
        width: 100%;
    }
    
    .summary-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .document-list-item {
        flex-wrap: wrap;
    }
    
    .doc-name {
        flex-basis: 100%;
        white-space: normal;
        margin-top: 0.25rem;
    }
}

/* ========== PRIVACY NOTICE ========== */
.privacy-notice {
    background: linear-gradient(135deg, #fff8f0 0%, #fff5eb 100%);
    border: 2px solid #ff9a4d;
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    box-shadow: 0 2px 8px rgba(255, 154, 77, 0.15);
}

.privacy-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 var(--spacing-md) 0;
    text-align: center;
}

.privacy-link {
    color: var(--orange-color);
    font-weight: 600;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.privacy-link:hover {
    color: #d97e00;
}

.privacy-checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    justify-content: center;
}

.privacy-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--orange-color);
}

.privacy-label {
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
}

.privacy-highlight {
    color: var(--orange-color);
    font-weight: 600;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .privacy-notice {
        padding: var(--spacing-md);
    }
    
    .privacy-text {
        font-size: 0.875rem;
    }
    
    .privacy-label {
        font-size: 0.875rem;
    }
    
    .privacy-checkbox-group {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* Móviles pequeños (< 480px) */
@media (max-width: 480px) {
    .card {
        padding: var(--spacing-sm);
    }
    
    .card-body {
        padding: var(--spacing-sm);
    }
    
    .card-header h2 {
        font-size: 1.25rem;
    }
    
    .btn {
        padding: 0.7rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .form-group label {
        font-size: 0.875rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 0.875rem;
        padding: 0.6rem;
    }
    
    .category-card,
    .stage-card {
        padding: var(--spacing-sm);
    }
    
    .category-card h3,
    .stage-card h3 {
        font-size: 1.1rem;
    }
    
    .privacy-notice {
        padding: var(--spacing-sm);
    }
    
    .privacy-text {
        font-size: 0.8125rem;
    }
    
    .privacy-label {
        font-size: 0.8125rem;
    }
}

/* ========== BOTÓN VOLVER SUPERIOR EN FORMULARIOS ========== */
.form-actions-top {
    display: flex;
    justify-content: flex-start;
    gap: var(--spacing-md); /* Espacio entre botones */
    margin: var(--spacing-lg) 0;
    padding: 0 var(--spacing-lg);
    flex-wrap: wrap; /* Permitir que los botones se envuelvan en móviles */
}

.btn-back-top {
    min-width: 120px;
}

#btn-goto-menu {
    min-width: 200px;
    white-space: nowrap;
}

