:root {
    /* Vibrant palette */
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #5b21b6;
    --primary-glow: rgba(124, 58, 237, 0.2);
    
    --accent: #06b6d4;
    --accent-light: #67e8f9;
    --accent-dark: #0891b2;
    
    /* Neutrals */
    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d4d4d8;
    --gray-400: #a1a1aa;
    --gray-500: #71717a;
    --gray-600: #52525b;
    --gray-700: #3f3f46;
    --gray-800: #27272a;
    --gray-900: #18181b;
    
    /* Semantic */
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    
    /* Effects */
    --shadow-sm: 0 2px 8px rgba(124, 58, 237, 0.08);
    --shadow-md: 0 4px 16px rgba(124, 58, 237, 0.12);
    --shadow-lg: 0 8px 32px rgba(124, 58, 237, 0.16);
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.15);
    
    /* Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    
    /* Transitions */
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #FAFAFA;
    min-height: 100vh;
    color: var(--gray-800);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin: 0; padding: 20px;
}

/* Navbar - title centered */
.navbar {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.03) 0%, rgba(153, 150, 168, 0.24) 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(124, 58, 237, 0.08);
    position: relative;
}


.nav-link {
    font-size: 1rem;
    font-weight: 700;
    background: #18181bb5;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}


/* Main Container */
.main-container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Cards Grid - smaller cards */
.scrapers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* Card - Compact & Modern */
.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(124, 58, 237, 0.1);
    overflow: hidden;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    border-color: rgba(124, 58, 237, 0.2);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.3rem 1.25rem;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.03) 0%, rgba(61, 47, 153, 0.24) 100%);
    border-bottom: 1px solid rgba(124, 58, 237, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 750;
    color: #38383eb5;
    letter-spacing: -0.02em;
    text-align: center;
    flex: 1; 
}

.card-header1 h2 {
    font-size: 1rem;
    font-weight: 550;
    color: #38383eb5;
    letter-spacing: -0.02em;
}

.card-header .badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #311193 0%, #7253dd 100%);
    color: white;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.2);
}

.card-body {
    padding: 1.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8125rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-outline {
    background: white;
    border: 2px solid rgba(124, 58, 237, 0.2);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(124, 58, 237, 0.05);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.btn-group {
    display: flex;
    gap: 0.625rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

/* Form Controls */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--gray-600);
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 2px solid rgba(124, 58, 237, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--gray-800);
    background: white;
    transition: all var(--transition);
}

.form-control:hover {
    border-color: rgba(124, 58, 237, 0.2);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

@keyframes spin {
    to { 
        transform: rotate(360deg); 
    }
}

/* Responsive */
@media (max-width: 768px) {
    .scrapers-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .main-container {
        padding: 0 1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .year-input {
        gap: 0.3125rem;
    }
    
    .year-tag {
        font-size: 0.6875rem;
        padding: 0.3125rem 0.6875rem;
    }
    
}
/* Progreso */
.status-badge {
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    .status-badge .badge {
        font-size: 1rem;
        padding: 0.5rem 1rem;
        border-radius: 9999px;
        background: #f3f4f6;
    }
    
    .steps-container {
        margin: 1.5rem 0;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        overflow: hidden;
    }
    
    .step {
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #e5e7eb;
        background: white;
    }
    
    .step:last-child {
        border-bottom: none;
    }
    
    .step-icon {
        font-size: 1.25rem;
        margin-right: 0.75rem;
    }
    
    .step-text {
        flex: 1;
        font-size: 0.875rem;
        color: #374151;
    }
    
    .step-status {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        border-radius: 9999px;
    }

    .spinner {
        width: 30px;
        height: 30px;
        border: 3px solid #e0e0e0;
        border-top-color: #2563eb;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }
    @keyframes spin {
        to { transform: rotate(360deg); }
    }

    .spinner {
        width: 30px;
        height: 30px;
        border: 3px solid #e0e0e0;
        border-top-color: #2563eb;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }
    @keyframes spin {
        to { transform: rotate(360deg); }
    }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        
        .form-control:focus {
            border-color: #7c3aed;
            box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
        }
        
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
        }
        
        .btn-primary:active {
            transform: translateY(0px);
        }
        
        a:hover {
            color: #5b21b6 !important;
        }
/* Contenedor principal del proceso */
.scrapers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
    margin-bottom: 2rem;
}

/* Tarjeta individual */
.scrapers-grid .card {
    background: #ffffff;
    border: 1px solid #e9eaf6;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(20, 22, 28, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.scrapers-grid .card:hover {
    box-shadow: 0 8px 24px rgba(20, 22, 28, 0.08);
    transform: translateY(-2px);
}

/* Header de la tarjeta */
.scrapers-grid .card .card-header {
    padding: 1rem 1.25rem 0.75rem 1.25rem;
    border-bottom: 1px solid #f1f2f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.scrapers-grid .card .card-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #6b21a8;  /* Color morado */
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Badge de la agencia */
.scrapers-grid .card .card-header .badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: #ffffff;
    background: #7c3aed;  /* Morado principal */
    padding: 4px 12px;
    border-radius: 99px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Cuerpo de la tarjeta */
.scrapers-grid .card .card-body {
    padding: 1rem 1.25rem 1.25rem 1.25rem;
}

/* Lista de documentos */
.scrapers-grid .card .doc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0.75rem;
}

/* Item de documento */
.scrapers-grid .card .doc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.15s ease;
    cursor: pointer;
}

.scrapers-grid .card .doc-item:hover {
    background: #f8f9fb;
}

/* Checkbox personalizado */
.scrapers-grid .card .doc-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #7c3aed;  /* Morado */
    cursor: pointer;
    flex-shrink: 0;
}

/* Icono del documento */
.scrapers-grid .card .doc-item .doc-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8a8f9c;
}

.scrapers-grid .card .doc-item .doc-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Label del documento */
.scrapers-grid .card .doc-item label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #3c4250;
    cursor: pointer;
    line-height: 1.4;
    flex: 1;
}

/* Selector de año */
.scrapers-grid .card .year-selector {
    padding: 0.75rem 0 0 0;
    border-top: 1px solid #f1f2f5;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.scrapers-grid .card .year-selector label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #14161c;
}

.scrapers-grid .card .year-selector input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #dcdde2;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #14161c;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 120px;
}

.scrapers-grid .card .year-selector input[type="number"]:focus {
    outline: none;
    border-color: #7c3aed;  /* Morado */
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.scrapers-grid .card .year-selector input[type="number"]::placeholder {
    color: #b1b5bf;
}

/* Texto de ayuda CIRBE */
.scrapers-grid .card .year-selector .help-text {
    font-size: 0.75rem;
    color: #8a8f9c;
    font-weight: 400;
    line-height: 1.5;
}

/* Grupo de botones */
.btn-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.btn-group .btn {
    padding: 10px 24px;
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-group .btn-outline {
    color: #14161c;
    background: #ffffff;
    border: 1px solid #dcdde2;
}

.btn-group .btn-outline:hover {
    background: #f8f9fb;
    border-color: #c5c7cd;
}

.btn-group .btn-primary {
    color: #ffffff;
    background: #7c3aed;  /* Morado principal */
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.btn-group .btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

.btn-group .btn-primary:active {
    transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE AJUSTES
   ========================================================================== */

@media (max-width: 768px) {
    .scrapers-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .scrapers-grid .card .card-header {
        padding: 0.875rem 1rem 0.625rem 1rem;
    }

    .scrapers-grid .card .card-header h2 {
        font-size: 1.1rem;
    }

    .scrapers-grid .card .card-body {
        padding: 0.875rem 1rem 1rem 1rem;
    }

    .scrapers-grid .card .doc-item {
        padding: 5px 8px;
    }

    .scrapers-grid .card .doc-item label {
        font-size: 0.75rem;
    }

    .scrapers-grid .card .year-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .scrapers-grid .card .year-selector input[type="number"] {
        width: 100%;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .scrapers-grid .card .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .scrapers-grid .card .doc-item {
        padding: 4px 6px;
    }

    .scrapers-grid .card .doc-item input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
}    