:root {
    --primary-color: #1a5276;
    --secondary-color: #2e86c1;
    --accent-color: #3498db;
    --light-color: #f5f5f5;
    --border-color: #ddd;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.3;
    padding: 10px;
    font-size: 11px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 12px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.header {
    text-align: center;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 8px;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 6px;
}

.logo {
    max-width: 60px;
    max-height: 60px;
    margin-right: 8px;
}

.school-info {
    text-align: center;
}

.school-name {
    font-size: 14px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.school-details {
    font-size: 9px;
    color: #666;
    margin-bottom: 2px;
    line-height: 1.1;
}

.form-title {
    text-align: center;
    font-size: 13px;
    margin: 8px 0;
    color: var(--primary-color);
    text-transform: uppercase;
}

.form-section {
    margin-bottom: 8px;
    page-break-inside: avoid;
}

.section-title {
    font-size: 11px;
    color: var(--secondary-color);
    margin-bottom: 6px;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
}

.form-group {
    margin-bottom: 6px;
}

label {
    display: block;
    margin-bottom: 1px;
    font-size: 9px;
    font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="tel"],
input[type="date"],
select {
    width: 100%;
    padding: 3px;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    font-size: 9px;
    height: 20px;
    background: white;
}

/* CORRECCIÓN PARA CAMPOS DE FECHA EN IMPRESIÓN */
input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
}

input[type="date"]::-webkit-inner-spin-button {
    display: none;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -2px;
}

.form-col {
    flex: 1;
    padding: 0 2px;
    min-width: 90px;
}

.form-col-small {
    flex: 0.5;
    padding: 0 2px;
    min-width: 70px;
}

/* CORRECCIÓN PARA RADIO BUTTONS Y CHECKBOXES */
.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    white-space: nowrap;
}

.checkbox-group input {
    margin-right: 3px;
    transform: scale(0.8);
}

.checkbox-group label {
    margin-bottom: 0;
    font-size: 8px;
    white-space: nowrap;
}

/* GRUPO DE RADIOS EN LÍNEA */
.radio-group-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.radio-item {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.radio-item input {
    margin-right: 3px;
    transform: scale(0.8);
}

.radio-item label {
    margin-bottom: 0;
    font-size: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
    font-size: 8px;
}

th, td {
    border: 1px solid var(--border-color);
    padding: 3px;
    text-align: left;
}

th {
    background-color: var(--light-color);
    font-size: 8px;
    font-weight: bold;
}

/* SECCIÓN DE PADRES OPTIMIZADA */
.parents-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 6px;
}

.parent-card {
    border: 1px solid var(--border-color);
    padding: 4px;
    border-radius: 2px;
    background: #fafafa;
}

.parent-header {
    font-weight: bold;
    font-size: 9px;
    margin-bottom: 3px;
    color: var(--primary-color);
    text-align: center;
    background: #e8f4ff;
    padding: 2px;
    border-radius: 1px;
}

.parent-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
}

.acudiente-card {
    border: 1px solid var(--border-color);
    padding: 4px;
    border-radius: 2px;
    background: #fff9e6;
    margin-top: 4px;
}

.acudiente-header {
    font-weight: bold;
    font-size: 9px;
    margin-bottom: 3px;
    color: #e67e22;
    text-align: center;
    background: #fff4e6;
    padding: 2px;
    border-radius: 1px;
}

.compact-table input {
    border: none;
    width: 100%;
    padding: 1px;
    font-size: 8px;
    background: transparent;
}

/* FIRMAS CON TABLA */
.firmas-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.firma-cell {
    width: 25%;
    text-align: center;
    vertical-align: top;
    padding: 0 10px;
}

.linea-firma {
    border-bottom: 1px solid #000;
    height: 25px;
    margin-bottom: 5px;
    display: block;
}

.texto-firma {
    font-size: 9px;
    font-weight: normal;
    line-height: 1.2;
}

.btn-container {
    display: flex;
    justify-content: center;
    margin: 12px 0;
    gap: 6px;
}

.btn {
    padding: 5px 10px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 10px;
    transition: background-color 0.3s;
}

.btn-generate {
    background-color: var(--primary-color);
    color: white;
}

.btn-generate:hover {
    background-color: var(--secondary-color);
}

.btn-print {
    background-color: #27ae60;
    color: white;
}

.btn-print:hover {
    background-color: #219653;
}

/* ESTILOS ESPECÍFICOS PARA IMPRESIÓN */
@media print {
    body {
        background: white;
        padding: 0;
        font-size: 10px;
        line-height: 1.2;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .container {
        box-shadow: none;
        padding: 8px;
        max-width: 100%;
        margin: 0;
    }
    
    .btn-container {
        display: none;
    }
    
    .form-section {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 6px;
    }
    
    .section-title {
        font-size: 10px;
        margin-bottom: 4px;
    }
    
    .form-group {
        margin-bottom: 4px;
    }
    
    label {
        font-size: 8px;
        margin-bottom: 0;
    }
    
    input[type="text"],
    input[type="number"],
    input[type="tel"],
    input[type="date"],
    select {
        font-size: 8px;
        height: 18px;
        padding: 2px;
        border: 1px solid #000;
        background: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* CORRECCIÓN DEFINITIVA PARA CAMPOS DE FECHA */
    input[type="date"] {
        background: white !important;
        color: #000 !important;
    }
    
    input[type="date"]:before {
        content: attr(placeholder) !important;
        color: #666;
    }
    
    input[type="date"]:focus:before,
    input[type="date"]:valid:before {
        content: "" !important;
    }
    
    /* CORRECCIÓN PARA SELECT */
    select {
        background: white !important;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    /* RADIO BUTTONS Y CHECKBOXES EN IMPRESIÓN */
    .checkbox-group,
    .radio-group-container {
        transform: scale(0.9);
        transform-origin: left;
    }
    
    .checkbox-group input,
    .radio-item input {
        transform: scale(0.7);
        border: 1px solid #000;
    }
    
    .checkbox-group label,
    .radio-item label {
        font-size: 7px;
    }
    
    /* TABLAS EN IMPRESIÓN */
    table {
        font-size: 7px;
    }
    
    th, td {
        padding: 2px;
        border: 1px solid #000;
    }
    
    th {
        background-color: #f0f0f0 !important;
        font-size: 7px;
    }
    
    /* PADRES EN IMPRESIÓN */
    .parents-grid {
        gap: 4px;
        margin-bottom: 4px;
    }
    
    .parent-card,
    .acudiente-card {
        padding: 3px;
        border: 1px solid #000;
    }
    
    .parent-header,
    .acudiente-header {
        font-size: 8px

    }     
}