/* ===============================================
   INDEX.CSS - Estilos específicos para la página de inicio principal
   =============================================== */

/* Variables CSS */
:root {
    --primary-color: #2563eb;
    --accent-color: #fbbf24;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-subtle: #f8fafc;
    --border-color: #e5e7eb;
}

/* Reset y base */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* Aplicar estilo específico a la página principal */
body.index-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: white;
    /* Mantener el padding del navbar fijo */
    padding-top: 81px !important;
}

body.index-page .main-container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Solo afectar containers que NO estén dentro del navbar */
.main-container .container, 
.main-container .container-fluid,
section .container,
section .container-fluid {
    max-width: 100%;
}

/* Asegurar que no hay márgenes en las secciones principales */
.hero-section, .how-it-works, .testimonials, .pricing-section, .final-cta {
    margin: 0;
    width: 100%;
}

/* Hero Section */
.hero-section {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 70vh;
    display: flex;
    align-items: center;
    margin-top: 0;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary-hero {
    background: var(--primary-color);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    transition: all 0.3s ease;
    color: white;
    text-decoration: none;
}

.btn-primary-hero:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
    color: white;
}

.btn-secondary-hero {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-secondary-hero:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

/* How it works section */
.how-it-works {
    padding: 80px 0;
    background: white;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.step-card {
    text-align: center;
    padding: 2rem 1rem;
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    height: 100%;
}

.step-card:hover {
    background: var(--bg-subtle);
    border-color: var(--border-color);
    transform: translateY(-4px);
}

.step-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

.step-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.step-description {
    color: var(--text-secondary);
    font-size: 1rem;
}

.section-note {
    text-align: center;
    margin-top: 3rem;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Testimonials */
.testimonials {
    padding: 80px 0;
    background: var(--bg-subtle);
}

.testimonial-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    height: 100%;
    position: relative;
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.testimonial-quote {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

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

.testimonial-location {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Pricing comparison */
.pricing-section {
    padding: 80px 0;
    background: white;
}

.pricing-table {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    margin-top: 2rem;
}

.pricing-header {
    background: var(--bg-subtle);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.pricing-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    border-bottom: 1px solid var(--border-color);
}

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

.pricing-cell {
    padding: 1rem;
    text-align: center;
    border-right: 1px solid var(--border-color);
}

.pricing-cell:last-child {
    border-right: none;
}

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

.pricing-feature {
    font-weight: 500;
    text-align: left !important;
    background: var(--bg-subtle);
}

.check-icon {
    color: #10b981;
    font-size: 1.2rem;
}

.cross-icon {
    color: #ef4444;
    font-size: 1.2rem;
}

/* CTA Final */
.final-cta {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    text-align: center;
}

.final-cta-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.final-cta-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.btn-cta-final {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 1.2rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-cta-final:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    color: var(--primary-color);
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 2rem;
    width: 100%;
    margin: 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: white;
}

.footer-note {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-ctas {
        justify-content: center;
    }
    
    .pricing-row {
        grid-template-columns: 1fr;
    }
    
    .pricing-cell {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        text-align: left !important;
    }
    
    .pricing-cell::before {
        content: attr(data-label) ": ";
        font-weight: bold;
        margin-right: 0.5rem;
    }
    
    .pricing-feature::before {
        display: none;
    }
    
    .final-cta-title {
        font-size: 2rem;
    }
}

/* Enlace "Cargar el excel oficial del [año]" bajo el input de archivo. Solo se
   muestra si el admin ha subido un Excel oficial (oficial-hint.js quita .hidden). */
.oficial-hint {
    margin-top: .3rem;
    font-size: .8rem;
    line-height: 1.3;
}
.oficial-hint a {
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}
.oficial-hint a:hover { text-decoration: underline; }
/* En DESKTOP la fila usa align-items-end y el selector de localidad reserva una
   2ª línea; para que el enlace quede pegado a la zona de subida (y no descuadre
   la fila) lo anclamos justo bajo ella con position:absolute. En MÓVIL va en
   flujo normal, bajo el input. */
@media (min-width: 768px) {
    #fileColumn { position: relative; }
    #fileColumn .oficial-hint {
        position: absolute;
        top: 100%;
        left: calc(var(--bs-gutter-x, 1rem) * .5);
        right: calc(var(--bs-gutter-x, 1rem) * .5);
        margin-top: .2rem;
    }
}

/* Selector de localidad. En DESKTOP cae en una 2ª línea bajo el CP (order-md-4):
   le reservamos altura aunque esté oculto, para no descuadrar la alineación de
   la fila. En MÓVIL aparece justo tras el CP (orden natural) y no reservamos
   hueco: que ocupe espacio solo cuando se muestre. */
@media (min-width: 768px) {
    .municipio-slot {
        min-height: 2.4rem;
    }
}

/* Momento 1: marco de expectativa sobre la zona de subida */
.upload-intro {
    margin: 0 0 1.25rem;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Momento 3: subnota bajo el título de la tabla de resultados */
.results-subnote {
    margin: 0;
    padding: 0.75rem 1rem 0;
    font-size: 0.85rem;
    color: #6b7280;
}

/* Disparador "Descárgalo aquí" (estilo enlace, abre el modal) */
.results-download-link {
    background: none;
    border: none;
    padding: 0;
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}
.results-download-link:hover {
    color: #1d4ed8;
}

/* Modal de descarga: tarjetas de opción */
.download-choice {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.1rem;
    text-align: center;
}
.download-choice-hero {
    border-color: #2563eb;
    background: #f5f8ff;
    position: relative;
    padding-top: 1.5rem;
}
.download-choice-badge {
    position: absolute;
    top: -0.7rem;
    left: 50%;
    transform: translateX(-50%);
    background: #2563eb;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    white-space: nowrap;
}
.download-choice-title {
    font-weight: 700;
    margin: 0.2rem 0 0.35rem;
    color: #1f2937;
}
.download-choice-desc {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.9rem;
    line-height: 1.45;
}
.download-choice-sep {
    text-align: center;
    color: #9ca3af;
    font-size: 0.8rem;
    margin: 0.9rem 0;
}

/* Atajo "Excel de ejemplo": línea propia bajo la fila de 3 columnas */
.sample-helper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
    margin-top: 0.25rem;
}
.use-sample-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0;
    background: none;
    border: none;
    color: #2563eb;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: left;
}
.use-sample-link:hover:not(:disabled) {
    text-decoration: underline;
}
.use-sample-link:disabled {
    opacity: 0.6;
    cursor: progress;
}
.sample-helper-desc {
    font-size: 0.82rem;
    color: #6b7280;
}
.sample-helper-ok {
    font-size: 0.83rem;
    font-weight: 600;
    color: #059669;
}
.sample-helper-ok i { margin-right: 0.25rem; }
.sample-helper-error {
    font-size: 0.83rem;
    font-weight: 600;
    color: #dc2626;
}
.preview-sample-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.preview-sample-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Panel de vista previa: captura del Excel de ejemplo */
.sample-preview {
    margin-top: 0.75rem;
}
.sample-preview-inner {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.sample-preview-img {
    display: block;
    width: 100%;
    height: auto;
    cursor: zoom-in;
}
.sample-preview-missing {
    padding: 1.25rem 0.75rem;
    font-size: 0.85rem;
    color: #6b7280;
    text-align: center;
}
.sample-preview-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}
.sample-action {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s ease;
}
.sample-action-primary {
    background: #2563eb;
    color: #fff;
}
.sample-action-primary:hover:not(:disabled) {
    background: #1d4ed8;
}
.sample-action-primary:disabled {
    opacity: 0.7;
    cursor: progress;
}
.sample-action-secondary {
    background: #fff;
    color: #2563eb;
    border-color: #c7d2fe;
}
.sample-action-secondary:hover {
    background: #eef2ff;
}
.sample-preview-hint {
    color: #9ca3af;
    font-size: 0.8rem;
    margin-left: auto;
}

/* Móvil: las acciones del panel de ejemplo apiladas a ancho completo y la
   pista en su propia línea, centrada (en vez de apretadas y envolviendo mal). */
@media (max-width: 575.98px) {
    .sample-preview-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .sample-action {
        width: 100%;
        justify-content: center;
    }
    .sample-preview-hint {
        margin-left: 0;
        text-align: center;
    }
}

/* Lightbox para ampliar la captura del ejemplo */
.img-lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow: auto;
}
.img-lightbox.hidden {
    display: none;
}
.img-lightbox img {
    max-width: 96vw;
    max-height: 92vh;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    cursor: zoom-in;
}
.img-lightbox img.zoomed {
    max-width: none;
    max-height: none;
    cursor: zoom-out;
}
.img-lightbox-close {
    position: fixed;
    top: 0.75rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
}

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