/* Paleta de colores neutra con toques de color */
:root {
    --color-fondo: #f8f8f8; /* Beige claro, neutro */
    --color-primario: #F4ACB7; /* Rosa (tono cálido) */
    --color-secundario: #ACB7F4; /* Azul (tono frío, para contraste) */
    --color-texto-oscuro: #333333;
    --color-borde: #cccccc;
    --color-sombra: rgba(0, 0, 0, 0.08);
 
    
    /* COLORES PDF Y BOTÓN */
    --color-boton-pdf: #ACB7F4; /* El color que pediste */
    --color-boton-pdf-hover: #8e9be6; 
    
    --cuqui-crema: #ffffff; 
    --cuqui-borde: #e0d0c0;
    --cuqui-titulo: #d33386;
}

/* Tipografía */
.script-font {
    font-family: 'Dancing Script', cursive; /* Tipografía caligráfica/manuscrita */
}
.courgette-font {
    font-family: 'Courgette', cursive;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* Tipografía base clara */
}

body {
    background-color: var(--color-fondo);
    color: var(--color-texto-oscuro);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: var(--color-primario);
    color: white;
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 4px 6px var(--color-sombra);
}

header h1 {
    font-size: 2.5em;
    font-weight: 700;
}

.container {
    display: flex;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    gap: 20px;
    flex: 1; /* Empuja el footer hacia abajo */
}

/* --- Tarjeta de Presentación (ASIDE) --- */
.contact-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--color-sombra);
    width: 100%; 
    max-width: 800px; /* Limitamos ancho para que no se vea gigante abajo */
    margin: 0 auto 20px auto; 
    height: fit-content;
    text-align: center;
    border-top: 5px solid var(--color-secundario);
}

.contact-card h2 {
    color: var(--color-secundario);
    font-size: 1.8em;
    margin-bottom: 15px;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.icon-link {
    font-size: 1.5em;
    color: var(--color-primario);
    transition: color 0.3s ease;
}

.icon-link:hover {
    color: var(--color-secundario);
}

.address {
    font-size: 0.9em;
    color: #666;
}

/* --- Formularios y Resultados (MAIN) --- */
.calculator-form, .results {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--color-sombra);
    flex: 1; /* Ocupan el espacio restante en escritorio */
    height: fit-content;
}

.calculator-form h2, .results h2 {
    color: var(--color-texto-oscuro);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--color-primario);
    padding-bottom: 5px;
}

.input-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="number"], select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-borde);
    border-radius: 4px;
}

/* Botón principal de Calcular */
button[onclick="calcularPatron()"] {
    background-color: var(--color-primario);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
    width: 100%; /* Ocupa todo el ancho */
}

button[onclick="calcularPatron()"]:hover {
    background-color: var(--color-secundario);
}

/* --- ESTILO NUEVO PARA EL BOTÓN PDF --- */
.btn-descargar-pdf {
    background-color: var(--color-boton-pdf) !important; /* #ACB7F4 */
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    width: 100%;
    margin-top: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
}

.btn-descargar-pdf:hover {
    background-color: var(--color-boton-pdf-hover) !important;
}


.output-box {
    border: 1px dashed var(--color-secundario);
    padding: 15px;
    min-height: 150px;
    background-color: #fffafa;
    border-radius: 4px;
    white-space: pre-wrap; 
}

.output-box h3, .output-box h4 {
    color: var(--color-primario);
}

/* --- FOOTER --- */
footer {
    text-align: center;
    margin-top: 20px;
    padding: 20px 0;
    font-size: 0.9em;
    color: #666;
    border-top: 1px solid var(--color-borde);
    background-color: #f1f1f1;
}

.container-footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nota-aclaratoria {
    display: block;
    font-size: 0.85em;
    color: #555; /* No es un error, es info */
    margin-top: 4px;
    padding-left: 10px;
    font-style: italic;
    line-height: 1.4;
}

/* ======================================================= */
/* === ESTILOS PARA INTERFAZ DE ICONOS === */
/* ======================================================= */
.project-selector {
    display: grid;
    /* 5 columnas en escritorio */
    grid-template-columns: repeat(5, 1fr); 
    gap: 10px;
}

.project-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 5px;
    border: 2px solid var(--color-borde);
    background-color: #ffffff;
    color: var(--color-texto-oscuro);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
    height: 90px; /* Altura fija para alinear */
}

.project-button:hover {
    background-color: #fdfdfd;
    border-color: var(--color-secundario);
    box-shadow: 0 2px 4px var(--color-sombra);
}

/* Estado "pulsado" o "activo" */
.project-button.active {
    background-color: var(--color-primario);
    color: white;
    border-color: var(--color-primario);
    box-shadow: 0 2px 4px var(--color-sombra);
}

.project-icon {
    font-size: 2.2em; /* Tamaño del emoji */
    margin-bottom: 5px;
    line-height: 1;
}

.project-label {
    font-weight: bold;
}


/* ======================================================= */
/* === AJUSTES DE RESPONSIVIDAD PARA DISPOSITIVOS MÓVILES === */
/* ======================================================= */
@media screen and (max-width: 768px) {
    .container {
        flex-direction: column; 
        margin: 10px auto; 
        padding: 0 10px; 
        gap: 15px; 
    }

    .calculator-form, .results {
        width: 100%; 
        flex: none; 
        padding: 20px;
    }

    header h1 {
        font-size: 1.8em;
    }

    /* En móvil, los botones-icono se ponen en 3 columnas (3+2) */
    .project-selector {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .project-button {
        height: 80px;
        padding: 10px 5px;
        font-size: 0.8em; /* Un poco más pequeño para que quepa */
    }
    .project-icon {
        font-size: 1.8em;
    }
}

/* ======================================================= */
/* === ESTILOS ESPECÍFICOS PARA EL TEMPLATE PDF === */
/* ======================================================= */
.pdf-template-container {
    /* Ancho fijo A4 aprox para captura correcta */
    width: 794px; 
    height: auto; /* Altura libre */
    min-height: 1123px;
    
    /* MARGENES INTERNOS: 80px abajo para evitar que se pegue al final */
    padding: 50px 50px 80px 50px; 
    
    background-color: var(--cuqui-crema);
    color: #333;
    font-family: 'Roboto', sans-serif;
    border: 1px solid #eee;
    box-sizing: border-box;
}

.pdf-header {
    text-align: center;
    border-bottom: 2px dashed var(--cuqui-borde);
    padding-bottom: 15px;
    margin-bottom: 30px;
}
.pdf-header h1 {
    font-family: 'Courgette', cursive;
    color: var(--cuqui-titulo);
    font-size: 2.6em;
    margin: 0;
}
.pdf-adornment { font-size: 2em; margin-bottom: 10px; }

.pdf-data-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--cuqui-borde);
    margin-bottom: 30px;
    font-size: 1.1em;
}

.pdf-section-title {
    font-family: 'Courgette', cursive;
    color: var(--cuqui-titulo);
    font-size: 1.7em;
    margin-top: 25px;
    margin-bottom: 15px;
    border-left: 5px solid #e1f5e8;
    padding-left: 15px;
    page-break-after: avoid;
}

.pdf-instruction-item {
    display: flex;
    align-items: baseline;
    margin-bottom: 12px;
    border-bottom: 1px dotted #eee;
    padding-bottom: 8px;
}

.pdf-checkbox {
    width: 16px; height: 16px;
    border: 1px solid #999;
    border-radius: 3px;
    margin-right: 12px;
    flex-shrink: 0;
    background: white;
}
.pdf-text {
    color: #444;
    line-height: 1.5;
}

.pdf-extras {
    margin-top: 50px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    page-break-inside: avoid;
}
.pdf-box {
    border: 1px solid var(--cuqui-borde);
    background: white;
    padding: 15px;
    border-radius: 8px;
    min-height: 90px;
}
.pdf-box h5 {
    font-family: 'Courgette', cursive;
    color: var(--cuqui-titulo);
    font-size: 1.3em;
    margin-top: 0;
}

.pdf-footer-note {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #ccc;
    font-size: 0.9em;
    color: #777;
    /* Margen inferior extra para el elemento final */
    margin-bottom: 40px; 
}

#pdf-page {
    background: white;
    box-sizing: border-box;
    border: 1px solid transparent;
    padding-bottom: 250px !important;  /* usa solo una */
}

#pdf-page * {
    margin: initial !important;
    padding: initial !important;
}
