/* =========================================================
   ESTILOS LOGIN - SISTEMA DE TRÁMITE DOCUMENTARIO (SISTRAMITE)
   Colores oficiales tomados del escudo institucional (Banner-DPW.png):
   azul #031136, rojo #C61115. Misma paleta y tipografia (Source Sans 3)
   que ya usa el portal publico de tramites y el panel de control.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700;800&display=swap');

:root {
    --login-blue-dark: #010719;
    --login-blue-navy: #031136;
    --login-blue-primary: #031136;
    --login-blue-hover: #020C26;
    --login-blue-vibrant: #0A2050;
    --login-blue-light: #E9EAF0;
    --login-accent-red: #C61115;
    --login-accent-red-hover: #A70E11;
    --login-accent-red-active: #870B0D;
    --login-text-main: #1e293b;
    --login-text-muted: #64748b;
    --login-input-bg: #f8fafc;
    --login-input-border: #e2e8f0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    background-color: #f1f5f9;
}

/* =========================================================
   CONTENEDOR PRINCIPAL
   ========================================================= */
.tramite-login-wrapper {
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    display: flex;
    position: relative;
    background-color: #f1f5f9;
    overflow: hidden !important;
}

/* =========================================================
   COLUMNA IZQUIERDA: HERO / BANNER INSTITUCIONAL (#031136)
   ========================================================= */
.tramite-hero-side {
    position: relative;
    flex: 1 1 58%;
    height: 100%;
    background: linear-gradient(135deg, #01050F 0%, #010719 45%, #031136 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(1.5rem, 3.5vh, 2.75rem) clamp(2rem, 3.5vw, 3.5rem);
    z-index: 1;
}

/* Canvas interactivo de constelación */
#tramite-particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    opacity: 0.85;
}

/* Imagen de fondo / Campus del Instituto (ya trae su propio diseño en azul
   con degradado y formas curvas, por eso se aplica un filtro mas suave que
   antes, para no opacar ese diseño). */
.tramite-hero-bg-image {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-size: cover;
    background-position: center center;
    opacity: 1;
    z-index: 1;
    transition: transform 12s ease-out;
}

.tramite-hero-side:hover .tramite-hero-bg-image {
    transform: scale(1.02);
}

/* Capa oscura suave, solo para reforzar la lectura del texto sobre la imagen */
.tramite-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(3, 17, 54, 0.55);
    z-index: 2;
}

/* Textos institucionales */
.tramite-hero-content {
    position: relative;
    z-index: 5;
    max-width: 520px;
    margin-top: auto;
    margin-bottom: auto;
}

.tramite-welcome-text {
    color: #f1f5f9;
    font-size: clamp(1.1rem, 1.6vw, 1.35rem);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 0.2rem;
    letter-spacing: -0.3px;
}

.tramite-hero-title {
    color: #ffffff;
    font-size: clamp(1.85rem, 3.2vw, 2.75rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    margin-bottom: 0;
}

.tramite-hero-title span {
    display: block;
    color: #ffffff;
}

/* Linea de acento bajo el titulo del hero */
.tramite-hero-title-accent {
    width: 56px;
    height: 4px;
    border-radius: 4px;
    background: #38bdf8;
    margin: 1.1rem 0 1.6rem 0;
}

/* Fila de caracteristicas destacadas (Gestion, Seguimiento, Notificaciones, Seguridad) */
/* Frase de cierre al final del banner */
.tramite-hero-quote {
    position: relative;
    z-index: 5;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.92rem;
    font-style: italic;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tramite-hero-quote i {
    color: #38bdf8;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* =========================================================
   COLUMNA DERECHA: FORMULARIO DE ACCESO CON COLOR #031136
   ========================================================= */
.tramite-form-side {
    flex: 1 1 42%;
    height: 100%;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 2.5vh, 2rem) clamp(1rem, 2vw, 2rem);
    position: relative;
    z-index: 10;
    overflow-y: auto;
}

/* Tarjeta flotante */
.tramite-card {
    background: #ffffff;
    width: 100%;
    max-width: 410px;
    border-radius: 20px;
    padding: clamp(1.5rem, 2.8vh, 2.25rem) clamp(1.25rem, 2vw, 2rem);
    box-shadow: 0 20px 45px -10px rgba(1, 25, 85, 0.14), 0 0 1px rgba(1, 25, 85, 0.1);
    border: 1px solid rgba(226, 232, 240, 0.85);
    position: relative;
    margin: auto;
}

/* Logo en la tarjeta */
.tramite-card-logo-box {
    text-align: center;
    margin-bottom: 0.9rem;
}

.tramite-logo-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 4px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.tramite-logo-icon:hover {
    transform: translateY(-2px);
}

.tramite-logo-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: #031136;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    margin: 0;
}

/* Encabezado */
.tramite-card-header {
    text-align: center;
    margin-bottom: 1.2rem;
}

.tramite-card-title {
    font-size: clamp(1.5rem, 2.1vw, 1.75rem);
    font-weight: 700;
    color: #000000;
    margin-bottom: 0.15rem;
    letter-spacing: -0.4px;
}

.tramite-card-subtitle {
    font-size: 0.98rem;
    color: #64748b;
    margin: 0;
    font-weight: 400;
}

/* Grupos de campos */
.tramite-form-group {
    margin-bottom: 0.95rem;
}

.tramite-label {
    display: block;
    font-size: 0.94rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.3rem;
}

.tramite-input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.tramite-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 4;
}

.tramite-input {
    width: 100%;
    height: 44px;
    background-color: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.5rem 0.9rem 0.5rem 2.6rem;
    font-size: 16px;
    color: #1e293b;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
    -webkit-appearance: none;
}

.tramite-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
    font-size: 0.95rem;
}

.tramite-input:hover {
    border-color: #cbd5e1;
    background-color: #ffffff;
}

.tramite-input:focus {
    border-color: #031136;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(3, 17, 54, 0.15);
}

.tramite-input:focus~.tramite-input-icon {
    color: #031136;
}

/* Botón mostrar/ocultar contraseña */
.tramite-password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s ease;
    z-index: 4;
}

.tramite-password-toggle:hover {
    color: #031136;
}

/* Texto de ayuda debajo del usuario */
.tramite-hint-text {
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 0.25rem;
    padding-left: 2px;
    font-weight: 400;
    line-height: 1.2;
}

/* Switch / Recordar credenciales */
.tramite-switch-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 1.1rem;
    margin-top: 0.2rem;
    cursor: pointer;
    user-select: none;
}

.tramite-switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
    margin-right: 8px;
    flex-shrink: 0;
}

.tramite-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.tramite-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .25s ease;
    border-radius: 34px;
}

.tramite-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .25s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.tramite-switch input:checked+.tramite-slider {
    background-color: #031136;
}

.tramite-switch input:checked+.tramite-slider:before {
    transform: translateX(14px);
}

.tramite-switch-label {
    font-size: 0.94rem;
    color: #475569;
    font-weight: 500;
    cursor: pointer;
}

/* Boton principal de login en azul institucional (#031136). */
.tramite-btn-submit {
    width: 100%;
    height: 44px;
    background-color: #0b2c63;
    background: #0b2c63;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 1.02rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(11, 44, 99, 0.28);
    touch-action: manipulation;
}

.tramite-btn-submit:hover {
    background-color: #09234F;
    background: #09234F;
    box-shadow: 0 6px 16px rgba(11, 44, 99, 0.38);
    transform: translateY(-1px);
    color: #ffffff;
}

.tramite-btn-submit:active {
    background-color: #071A3B;
    background: #071A3B;
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(11, 44, 99, 0.2);
}

/* Footer con enlace de olvido de contraseña */
.tramite-card-footer {
    margin-top: 1.1rem;
    text-align: center;
    padding-top: 0.9rem;
    border-top: 1px solid #f1f5f9;
}

.tramite-forgot-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.94rem;
    font-weight: 600;
    color: #031136;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tramite-forgot-link:hover {
    color: #0A2050;
    text-decoration: underline;
}

.tramite-badge-new {
    background: #ef4444;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 9999px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Alertas de error */
.tramite-alert-box {
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.95rem;
    font-size: 0.84rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tramite-alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.tramite-alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* =========================================================
   MEDIA QUERIES: DISPOSITIVOS MÓVILES (< 992px)
   ========================================================= */
@media (max-width: 991.98px) {

    html,
    body {
        overflow-y: auto !important;
    }

    .tramite-login-wrapper {
        flex-direction: column;
        min-height: 100vh !important;
        height: auto !important;
        max-height: none !important;
        overflow-y: auto !important;
        background: linear-gradient(135deg, #01050F 0%, #031136 50%, #0A2050 100%);
    }

    .tramite-hero-side {
        display: none !important;
    }

    .tramite-form-side {
        flex: 1 1 100%;
        width: 100%;
        min-height: 100vh;
        height: auto;
        padding: 2rem 1.25rem;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .tramite-card {
        padding: 2rem 1.35rem;
        max-width: 390px;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    }
}