/* ==============================================
   FUENTES PERSONALIZADAS
   ============================================== */
@font-face {
    font-family: "Metropolis-Regular";
    src: url("Metropolis-Regular.otf") format("opentype");
    font-style: normal;
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: "calibrib";
    src: url("calibrib.ttf") format("truetype");
    font-style: normal;
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: "calibril";
    src: url("calibril.ttf") format("truetype");
    font-style: normal;
    font-weight: normal;
    font-display: swap;
}

/* ==============================================
   RESET Y ESTILOS GENERALES
   ============================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

/* ==============================================
   ENLACES
   ============================================== */
a:link, 
a:visited {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

a:hover,
a:focus {
    color: #5094e2c5;
    text-decoration: underline;
    outline: 2px solid #5094e2c5;
    outline-offset: 2px;
}

a:active {
    color: #3a7bc8;
}

/* ==============================================
   LAYOUT PRINCIPAL
   ============================================== */
.body {
    background: url(../fondo.png) no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.main-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ==============================================
   HEADER
   ============================================== */
.header .navbar {
    background-color: transparent !important;
    font-size: 1.25rem;
    font-family: 'Lucida Sans', 'Lucida Grande', sans-serif;
    padding: 1rem 0;
}

.logo-header {
    max-width: 250px;
    width: 100%;
    height: auto;
    display: block;
}

/* ==============================================
   FORMULARIO PRINCIPAL
   ============================================== */
.main-form {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 
                0 8px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 100%;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==============================================
   ELEMENTOS DE FORMULARIO
   ============================================== */
ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.error-list {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.label {
    display: flex;
    flex-direction: column;
    text-align: left;
}

form {
    font-size: 1rem;
}

label {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"] {
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 7px;
    padding: 0.75rem;
    font-size: 1rem;
    width: 100%;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: #1d4189;
    box-shadow: 0 0 0 3px rgba(29, 65, 137, 0.1);
}

input[type="text"]:hover {
    border-color: rgba(0, 0, 0, 0.5);
}

/* Validación visual de Bootstrap */
input.is-valid {
    border-color: #28a745;
}

input.is-invalid {
    border-color: #dc3545;
}

input.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}

input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* ==============================================
   BOTONES
   ============================================== */
.area-boton {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.boton {
    background-color: #1d4189;
    border: 2px solid #1d4189;
    color: white;
    padding: 0.625rem 1.5rem;
    text-align: center;
    display: inline-block;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 200px;
}

.boton:hover {
    background-color: #2952a8;
    border-color: #2952a8;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(29, 65, 137, 0.3);
}

.boton:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(29, 65, 137, 0.3);
}

.boton:focus {
    outline: 2px solid #5094e2;
    outline-offset: 2px;
}

.boton:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ==============================================
   TIPOGRAFÍA
   ============================================== */
#letra1 {
    text-align: center;
    font-family: 'Metropolis-Regular', sans-serif;
    color: #262626;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

#letra2 {
    font-family: 'Metropolis-Regular', sans-serif;
    color: #627077;
    font-size: 1.125rem;
}

#letra3 {
    font-family: 'Metropolis-Regular', sans-serif;
    cursor: pointer;
}

#letra4 {
    font-family: 'Metropolis-Regular', sans-serif;
    color: #262626;
    font-size: 1.5625rem;
}

#letra5 {
    color: #627077;
}

/* ==============================================
   ALERTAS
   ============================================== */
.alert-danger {
    font-size: 0.9375rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* ==============================================
   RESPONSIVE DESIGN
   ============================================== */
@media screen and (max-width: 768px) {
    .main-form {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .logo-header {
        max-width: 200px;
    }
    
    #letra1 {
        font-size: 1.75rem;
    }
    
    #letra2 {
        font-size: 1rem;
    }
    
    input[type="text"] {
        padding: 0.625rem;
        font-size: 0.9375rem;
    }
    
    .boton {
        font-size: 0.9375rem;
        padding: 0.5rem 1.25rem;
    }
    
    .area-boton {
        flex-direction: column;
        align-items: stretch;
    }
    
    .boton {
        max-width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .main-form {
        padding: 1.25rem;
    }
    
    #letra1 {
        font-size: 1.5rem;
    }
    
    .logo-header {
        max-width: 150px;
    }
}

/* ==============================================
   MODO OSCURO (OPCIONAL)
   ============================================== */
@media (prefers-color-scheme: dark) {
    /* Puedes agregar estilos para modo oscuro si lo deseas */
}

/* ==============================================
   ANIMACIONES Y TRANSICIONES
   ============================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==============================================
   ESTILOS PARA SWEETALERT2
   ============================================== */
.swal-popup-custom {
    font-family: 'Metropolis-Regular', sans-serif;
    border-radius: 12px;
}

.swal-title-custom {
    font-size: 1.75rem;
    color: #262626;
    font-weight: 600;
}

.swal-text-custom {
    font-size: 1rem;
    color: #627077;
    text-align: left;
    line-height: 1.8;
}

/* Personalizar el botón de confirmación de SweetAlert */
.swal2-confirm {
    font-size: 1rem !important;
    padding: 0.625rem 1.5rem !important;
    border-radius: 12px !important;
    font-weight: 500 !important;
}

.swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(29, 65, 137, 0.25) !important;
}

/* Spinner del botón */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}