* {
    box-sizing: border-box;
    transition: all 0.3s ease;
}

:root {
    --ancho-completo: 100%;
    --color-primario: #007BFF;
    --color-secundario: #0056b3;
    --sombra-suave: 0 4px 6px rgba(0, 0, 0, 0.1);
    --sombra-intensa: 0 8px 15px rgba(0, 0, 0, 0.15);
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: -20px 0 !important;
    padding: 20px;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 123, 255, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(0, 123, 255, 0.05) 0%, transparent 20%);
        
}

.container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--sombra-intensa);
    width: 100%;
    max-width: 1400px;
    margin: 20px auto;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--color-primario), #00a8ff, var(--color-primario));
}

.encabezado-card {
    background-color: f9f9f9;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    text-align: center;
    width: 100%;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
}


.logo {
    display: block;
    margin: 0 auto 10px;
    max-width: 120px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.institucion, h2, h3 {
    text-align: center;
    font-size: 25px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

h2 {
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: bold;
    color: #333;
    display: block;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--color-primario, #007BFF); /* por si no está definida */
    margin: 10px auto 0;
    border-radius: 3px;
}


/* Numeración de secciones */
form {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: space-between;
    counter-reset: section-counter;
}

.section-container {
    position: relative;
    flex: 1;
    min-width: 300px;
    margin-top: 50px;
}

.section-container::before {
    content: counter(section-counter);
    counter-increment: section-counter;
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--color-primario);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 2;
    border: 3px solid white;
}

/* Colores diferentes para cada número */
.section-container:nth-child(1)::before { background: #007BFF; }
.section-container:nth-child(2)::before { background: #28a745; }
.section-container:nth-child(3)::before { background: #6f42c1; }

.section-card {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 1px solid #ddd;
    box-shadow: var(--sombra-suave);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Efecto hover RESTAURADO */
.section-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-intensa);
}

h3 {
    font-size: 18px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--color-primario);
    padding-bottom: 5px;
    color: #444;
    text-align: center;
}

.form-footer {
    flex-basis: 100%;
    margin-top: 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.row.col-3 > .column {
    flex: 0 0 calc(33.33% - 15px);
}

.row.col-2 > .column {
    flex: 0 0 calc(50% - 15px);
}

.row.col-3 {
    background: #e3f7ff;
    border: 2px dashed #007BFF;
}

.column {
    flex: 1;
    min-width: 380px;
}

/* Campos de entrada */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="file"],
select {
    width: 100% !important;
    display: block;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    height: 40px;
    transition: all 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primario);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23007BFF'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 30px;
}

.requisitos-box {
    padding: 15px;
    background-color: #f1f1f1;
    border-left: 4px solid var(--color-primario);
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    width: 100%;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    color: #555;
}

.descripcion-textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    background-color: #f9f9f9;
    resize: none;
    transition: all 0.3s;
}

/* Botones con efectos RESTAURADOS */
button {
    background-color: var(--color-primario);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    width: calc(100% - 30px);
    margin: 10px 15px;
    transition: all 0.3s;
    height: 40px;
    box-shadow: var(--sombra-suave);
}

button:hover {
    background-color: var(--color-secundario);
    box-shadow: var(--sombra-intensa);
    transform: translateY(-2px);
}

.form-footer button {
    width: 250px;
    margin: 20px auto;
    display: block;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.swal2-confirm {
    width: auto !important;
    height: auto !important;
    padding: 10px 20px !important;
    font-size: 16px !important;
    line-height: normal !important;
    background-color: var(--color-primario) !important;
}

/* === MODAL PERSONALIZADO === */
.modal-custom {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

.modal-content-custom {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
}

.modal-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.modal-title-custom {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.btn-close-custom {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #000;
}

/* Cuerpo con scroll y canvases responsivos */
.modal-body-custom {
    max-height: 70vh;
    overflow-y: auto;
}

.modal-body-custom canvas {
    display: block;
    margin: 0 auto 30px auto;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}



.modal-lg {
    max-width: 90vw;
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 10px;
    padding: 20px;
}


/* Estilos básicos para el modal */
#modalResumen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.custom-modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.archivo-fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 13px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 6px 10px;
    flex-wrap: nowrap;
  }
  
  .archivo-nombre {
    margin: 0;
    color: #28a745;
    font-weight: 600;
    font-size: 13px;
    flex-grow: 1;
    max-width: 250px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 1.4;
  }
  
  .archivo-botones {
    display: flex;
    gap: 5px;
    min-width: 70px;
    justify-content: flex-end;
  }
  
  .btn-accion {
    padding: 3px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    transition: all 0.2s ease;
    background-color: #fff !important;
  }
  
  .btn-accion:hover {
    transform: scale(1.05);
    opacity: 0.85;
  }
  
  .btn-eliminar {
    color: #dc3545;
    border-color: #dc3545;
  }
  
  .btn-eliminar:hover {
    background-color: #ffe5e9;
    color: #dc3545;
    border-color: #dc3545;
  }
  
  .btn-previsualizar {
    color: #007bff;
    border-color: #007bff;
  }
  
  .btn-previsualizar:hover {
    background-color: #e5f0ff;
    color: #0056b3;
    border-color: #007bff;
  }
  

  
  
@keyframes fadeInModal {
    from {
      opacity: 0;
      transform: scale(0.95);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }
  
  .modal-instrucciones-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeInModal 0.4s ease-out;
  }
  
  .modal-instrucciones-content {
    background-color: #ffffff;
    padding: 1.5rem 2.5rem; /* menos padding arriba/abajo, más a los lados */
    border-radius: 15px;
    max-width: 680px;       /* más ancho */
    width: 90%;
    max-height: 85vh;       /* límite de altura en viewport */
    overflow-y: auto;       /* scroll si se pasa en altura */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    text-align: left;
    font-family: 'Segoe UI', sans-serif;
    animation: fadeInModal 0.4s ease-out;
  }
  
  
  .modal-instrucciones-content h2 {
    margin-top: 0;
    font-size: 1.6rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #007BFF;
    padding-bottom: 0.5rem;
  }
  
  .modal-instrucciones-content ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
    font-size: 1rem;
  }
  
  .modal-instrucciones-content li {
    margin-bottom: 0.7rem;
    line-height: 1.4;
  }
  
  #cerrarInstrucciones {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 0.6rem 1.3rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: not-allowed;
    transition: background-color 0.3s ease;
    opacity: 0.6;
  }
  
  #cerrarInstrucciones.habilitado {
    cursor: pointer;
    opacity: 1;
  }
  
  #cerrarInstrucciones:hover:enabled {
    background-color: #467ab3;
  }

.auto-height-descripcion {
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
    background-color: #f9f9f9;
    white-space: pre-wrap;       /* Respeta saltos de línea */
    word-wrap: break-word;       /* Ajusta palabras largas */
    min-height: 60px;            /* Altura mínima inicial */
    max-height: 300px;           /* Altura máxima antes de scroll */
    overflow-y: auto;            /* Muestra scroll si el contenido excede */
}

  
/* Responsividad */
@media (max-width: 1200px) {
    form {
        flex-direction: column;
        gap: 60px;
    }
    .section-container {
        width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 15px;
    }
    .section-container::before {
        width: 35px;
        height: 35px;
        font-size: 16px;
        top: -25px;
    }
    .column {
        min-width: 100%;
    }
    .form-footer button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    h2 {
        font-size: 18px;
    }
    h3 {
        font-size: 14px;
    }
    input, select, textarea {
        font-size: 12px;
    }
    button {
        font-size: 14px;
    }
}