/* Estilos Generales */
body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: #f5f7fa;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
}

/* Header Institucional (MANTENIDO TAL CUAL) */
.logo-container {
    background-color: #012B47;
    padding: 20px;
    text-align: center;
    color: white;
    margin-bottom: 20px;
}

.logo-container img.logo {
    max-height: 100px;
    width: auto;
    margin-bottom: 15px;
}

.header-title {
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin: 10px 0;
}

.header-description {
    font-size: 16px;
    color: #d1e7f3;
    margin: 0;
    max-width: 800px;
    margin: 0 auto;
}

/* Contenedor Principal */
.container {
    max-width: 900px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.form-content {
    padding: 30px;
}

/* Títulos del Formulario */
.card-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 15px;
}

.card-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: #0056b3;
}

.highlight {
    color: #0056b3;
    font-weight: 700;
}

.description-text {
    text-align: center;
    color: #555;
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.5;
}

/* Secciones del Formulario */
.form-section {
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
    background-color: #f9fafc;
}

.form-section legend {
    font-weight: 600;
    color: #2c3e50;
    padding: 0 10px;
    font-size: 18px;
}

/* Grupos de formulario - MANTENIENDO ESTRUCTURA ORIGINAL PERO MEJORANDO */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #4a5568;
    font-size: 15px;
}

.input-field,
.dropdown {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 15px;
    background-color: #fff;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.input-field:focus,
.dropdown:focus {
    border-color: #0056b3;
    outline: none;
}

.dropdown {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><polygon points="0,0 10,0 5,6" fill="%23666"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 10px;
    cursor: pointer;
    appearance: none;
}

textarea.input-field {
    min-height: 120px;
    resize: vertical;
}

/* Campos de archivo */
.input-field[type="file"] {
    padding: 10px;
    background-color: #f8fafc;
}

/* Checkbox */
.form-group-checkbox {
    display: flex;
    align-items: center;
    margin: 25px 0;
}

.form-group-checkbox input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

.link-terms {
    color: #0056b3;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
}

.link-terms:hover {
    color: #003d82;
}

/* Botón de envío */
.search-button {
    background-color: #0056b3;
    color: white;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 20px;
}

.search-button:hover {
    background-color: #004494;
}

.search-button:disabled {
    background-color: #a0aec0;
    cursor: not-allowed;
}

/* Estilo para el modal - Versión Optimizada */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(3px);
    transition: all 0.3s ease;
}

.modal-content {
    background-color: #fff;
    margin: 2% auto;
    padding: 0;
    border-radius: 10px;
    width: 85%;
    max-width: 750px;
    max-height: 90vh; /* Altura máxima del modal completo */
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    background-color: #012B47;
    color: white;
    padding: 20px 25px;
    position: relative;
    border-bottom: 4px solid #D9A441;
    flex-shrink: 0; /* Evita que se encoja */
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex-grow: 1; /* Ocupa todo el espacio disponible */
    min-height: 200px; /* Altura mínima garantizada */
}

.terms-section {
    counter-reset: term-counter;
}

.term-item {
    margin-bottom: 15px;
    padding-left: 30px;
    position: relative;
    line-height: 1.6;
    color: #4a5568;
    font-size: 15px;
}

.term-number {
    position: absolute;
    left: 0;
    font-weight: bold;
    color: #012B47;
}

.term-item strong {
    color: #2c3e50;
}

.modal-footer {
    padding: 15px 25px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: right;
    flex-shrink: 0; /* Evita que se encoja */
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.close:hover {
    color: #D9A441;
    transform: scale(1.1);
}

.modal-button {
    background-color: #012B47;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    min-width: 180px;
}

.modal-button:hover {
    background-color: #034168;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(1, 43, 71, 0.2);
}

/* Scrollbar personalizada para el modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}


/* Responsive */
@media (max-width: 768px) {
    .header-title {
        font-size: 20px;
    }
    
    .card-title {
        font-size: 24px;
    }
    
    .form-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .logo-container {
        padding: 15px;
    }
    
    .header-title {
        font-size: 18px;
    }
    
    .header-description {
        font-size: 14px;
    }
    
    .form-content {
        padding: 15px;
    }
}