/* Paleta Institucional Universidad Distrital */
:root {
    --ud-azul: #0a2e5c;
    --ud-oro: #e5a924;
    --ud-gris-borde: #ccc;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #f4f6f9;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Contenedor Central Absoluto */
.ud-wrapper-centrado {
    width: 100%;
    max-width: 950px;
    display: flex;
    justify-content: center;
}

.ud-tarjeta-formulario {
    background-color: #ffffff;
    border: 1px solid var(--ud-gris-borde);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 100%;
    padding: 30px;
}

.ud-panel-primario {
    border: 1px solid var(--ud-azul);
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
}

.ud-panel-heading {
    color: #ffffff;
    background-color: var(--ud-azul);
    padding: 10px 15px;
    font-weight: bold;
    font-size: 14px;
}

.ud-panel-body {
    padding: 20px;
}

.text-center {
    text-align: center;
}

h1.form-title {
    font-size: 28px;
    font-weight: 500;
    color: #333;
}

.panel-title-bar {
    background-color: var(--ud-azul);
    height: 6px;
    margin-bottom: 25px;
    border-radius: 2px;
    border-bottom: 2px solid var(--ud-oro);
}

/* Estructura de Campos */
.ud-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.ud-form-row-doble {
    display: flex;
    gap: 20px;
}

.col-mitad {
    width: 50%;
}

.row-end {
    align-items: flex-end;
    flex-direction: row;
    justify-content: flex-end;
    gap: 15px;
}

.label-largo {
    padding-bottom: 8px;
}

.control-label {
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    height: 38px;
    padding: 6px 12px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--ud-azul);
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 46, 92, 0.12);
}

.input-readonly {
    background-color: #e9ecef;
    color: #495057;
    text-align: center;
}

.text-uppercase {
    text-transform: uppercase;
}

.posicion-relativa {
    position: relative;
}

.divisor-suave {
    border: 0;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

.red-divider {
    border: 0;
    border-top: 2px solid #a94442;
    margin: 25px 0;
}

/* Botonera */
.ud-botonera-container {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn-ud {
    padding: 8px 24px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

/* Elementos de Validación */
.text-danger-msg {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
}

.spinner-validacion {
    display: none;
    position: absolute;
    right: 12px;
    top: 11px;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(10, 46, 92, 0.2);
    border-radius: 50%;
    border-top-color: var(--ud-azul);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Adaptabilidad para Teléfonos Celulares */
@media (max-width: 768px) {
    .ud-form-row-doble {
        flex-direction: column;
        gap: 0;
    }
    .col-mitad {
        width: 100%;
    }
    .row-end {
        flex-direction: column;
        align-items: flex-start;
    }
    .ud-tarjeta-formulario {
        padding: 15px;
    }
}
/* --- Componente Toast Nativo Universidad Distrital --- */
.ud-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: 100%;
}

.ud-toast {
    background-color: #323232;
    color: #ffffff;
    padding: 14px 18px;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    line-height: 1.4;
    border-left: 4px solid var(--ud-oro);
    opacity: 0;
}

.ud-toast-icon {
    color: var(--ud-oro);
    font-size: 16px;
    flex-shrink: 0;
}

.ud-toast-content {
    flex-grow: 1;
}

/* Animaciones del Toast */
.animate-toast-in {
    animation: toastFadeIn 0.4s forwards;
}

.animate-toast-out {
    animation: toastFadeOut 0.4s forwards;
}

@keyframes toastFadeIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes toastFadeOut {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-10px); opacity: 0; }
}
/* --- Estilos para el Grupo de Correo Integrado --- */
.ud-input-group {
    display: flex;
    width: 100%;
    align-items: center;
}

.ud-input-group .form-control {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.ud-input-group-text {
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #bbb;
    border-left: none;
    height: 38px;
    padding: 6px 12px;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}
/* --- Contenedor y Estilo del Toast Profesional Centralizado --- */
.ud-toast-container-centro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; /* Permite clicks detrás a menos que el toast esté activo */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.ud-toast-centro {
    pointer-events: auto; /* Activa la interacción del cuadro */
    background-color: #ffffff;
    width: 100%;
    max-width: 450px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--ud-azul);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ud-toast-centro-header {
    background-color: var(--ud-azul);
    color: #ffffff;
    padding: 12px 16px;
    font-weight: bold;
    font-size: 13px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--ud-oro);
}

.ud-toast-centro-body {
    padding: 20px 16px;
    color: #333333;
    font-size: 14px;
    line-height: 1.5;
}

.ud-toast-centro-btn {
    background-color: #212529;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    margin: 0 auto 15px auto;
    transition: background-color 0.15s ease-in-out;
    width: fit-content;
}

.ud-toast-centro-btn:hover {
    background-color: #000000;
}

/* Animaciones de Entrada y Salida */
.animate-toast-in {
    animation: toastCentroIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.animate-toast-out {
    animation: toastCentroOut 0.2s ease-in forwards;
}

@keyframes toastCentroIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes toastCentroOut {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(0.9); opacity: 0; }
}
/* Asegura visualización completa del texto en campos extensos y datalists */
.input-proyecto-completo {
    width: 100% !important;
    text-overflow: clip !important;
    white-space: normal !important;
}
/* --- Componente Dropdown de Ancho Completo para Proyectos --- */
.ud-custom-select-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 38px;
    padding: 6px 12px;
    border: 1px solid #bbb;
    border-radius: 4px;
    background-color: #ffffff;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

.ud-custom-select-box i {
    color: var(--ud-azul);
    font-size: 12px;
    transition: transform 0.2s ease;
}

.ud-placeholder-text {
    color: #757575;
}

.ud-custom-dropdown {
    display: none;
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border: 1px solid var(--ud-azul);
    border-radius: 4px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    z-index: 1000;
}

.ud-custom-dropdown.open {
    display: block;
}

.ud-dropdown-search-wrapper {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
    gap: 8px;
}

.ud-dropdown-search-wrapper i {
    color: #777;
}

.ud-dropdown-search-wrapper .form-control {
    height: 32px;
    font-size: 13px;
}

.ud-dropdown-list {
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
}

.ud-dropdown-list li {
    padding: 10px 14px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    white-space: normal; /* Permite que el texto largo pase a la siguiente línea si es necesario */
    word-wrap: break-word;
    line-height: 1.4;
    border-bottom: 1px solid #f1f1f1;
}

.ud-dropdown-list li:last-child {
    border-bottom: none;
}

.ud-dropdown-list li:hover {
    background-color: #e9ecef;
    color: var(--ud-azul);
    font-weight: 500;
}
/* --- Estructura de Filas Múltiples Combinadas por Porcentajes --- */
.ud-form-row-trio {
    display: flex;
    gap: 15px;
    width: 100%;
}

/* Clases de porcentaje exacto */
.col-50 { width: 50%; }
.col-40 { width: 40%; }
.col-35 { width: 35%; }
.col-25 { width: 25%; }

/* Margen de separación inferior */
.mb-3 {
    margin-bottom: 16px;
}

/* Adaptabilidad Responsiva Total para Teléfonos Móviles */
@media (max-width: 768px) {
    .ud-form-row-trio {
        flex-direction: column;
        gap: 0;
    }
    .col-50, .col-40, .col-35, .col-25 {
        width: 100% !important;
    }
}
/* --- Toast de Éxito Corporativo (Verde) --- */
.ud-toast-centro.ud-toast-exito {
    border-color: #28a745;
}

.ud-toast-centro.ud-toast-exito .ud-toast-centro-header {
    background-color: #28a745;
    border-bottom: 2px solid var(--ud-oro);
}

.ud-toast-centro.ud-toast-exito .ud-toast-centro-btn {
    background-color: #28a745;
}

.ud-toast-centro.ud-toast-exito .ud-toast-centro-btn:hover {
    background-color: #218838;
}
