/**
 * Login EduControl: glassmorphism tranquilo (fondo amplio + panel translúcido).
 * Acentos institucionales (--login-accent*) desde carnet_tema_login_shell_style_attr.
 */
html.login-html {
    height: 100%;
}

html.login-html body.login-page--glass {
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
}

:root {
    --login-accent: #8b1538;
    --login-accent-mid: #c41e3a;
    --login-accent-dark: #6b0f2b;
    --login-ink: #f8fafc;
    --login-muted: rgba(248, 250, 252, 0.72);
    --login-card-radius: 20px;
    /* Botón principal: azul sereno (independiente del acento institucional) */
    --login-glass-btn: #0ea5e9;
    --login-glass-btn-mid: #0284c7;
    --login-glass-highlight: rgba(56, 189, 248, 0.35);
}

.login-page {
    min-height: 100vh;
    margin: 0;
    position: relative;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--login-ink);
    background: #0a1628;
}

/* Fondo de pantalla completa */
.login-ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.login-ambient__photo {
    position: absolute;
    inset: -2px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    transform: scale(1.02);
}

/* Sin archivo de fondo: aurora suave (la clase la pone index.php) */
.login-page--no-photo .login-ambient__gradient {
    background: radial-gradient(ellipse 120% 80% at 50% 20%, rgba(14, 165, 233, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 90% 60% at 80% 70%, rgba(251, 191, 36, 0.12) 0%, transparent 45%),
        linear-gradient(165deg, #0c1929 0%, #0f172a 40%, #020617 100%);
}

.login-ambient__gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(2, 6, 23, 0.25) 0%,
        rgba(15, 23, 42, 0.45) 42%,
        rgba(2, 6, 23, 0.82) 100%
    );
}

.login-ambient__vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 85% 75% at 50% 45%, transparent 30%, rgba(2, 6, 23, 0.55) 100%);
}

.login-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 4vw, 2.5rem) clamp(0.75rem, 3vw, 1.5rem);
    box-sizing: border-box;
}

/* Una sola pantalla: menos padding vertical y contenido más compacto */
.login-shell--fit {
    min-height: 100dvh;
    max-height: 100dvh;
    padding: clamp(0.35rem, 1.2dvh, 0.65rem) clamp(0.65rem, 2.5vw, 1rem);
    justify-content: flex-start;
    align-items: center;
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.login-access--fit {
    gap: 0.22rem;
    width: 100%;
}

@media (max-height: 720px) {
    .login-page--glass .login-brand-icon--platform {
        width: 64px;
        height: 64px;
        padding: 5px;
        border-radius: 16px;
    }

    .login-access--fit .login-card {
        padding: 0.55rem 0.75rem;
    }

    .login-shell--fit {
        padding: 0.25rem 0.5rem;
    }
}

.login-layout--glass {
    width: min(1180px, 96vw);
    min-height: auto;
    display: block;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

.login-access {
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-access > * {
    width: 100%;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.login-header--platform {
    width: 100%;
    max-width: 560px;
    margin-bottom: 0.35rem;
}

.login-brand-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-align: center;
}

.login-access--fit .login-header--platform {
    margin-bottom: 0.28rem;
}

.login-page--glass .login-brand-icon--platform {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    padding: 7px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 22px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-brand-icon--platform img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.login-page--glass .login-brand-title {
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.login-page--glass .login-brand-sub {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
    line-height: 1.25;
}

.login-change-inst {
    display: inline-flex;
    align-items: center;
    margin-top: 0.65rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--login-glass-highlight);
    text-decoration: none;
}

.login-change-inst:hover {
    text-decoration: underline;
    color: #7dd3fc;
}

/* Panel glass central: un poco más ancho y menos alto */
.login-page--glass .login-card {
    width: 100%;
    max-width: 500px;
    background: rgba(15, 23, 42, 0.42);
    border-radius: var(--login-card-radius);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08), 0 25px 60px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    padding: clamp(1.1rem, 2.8vw, 1.45rem);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.login-access--fit .login-card {
    padding: clamp(0.7rem, 1.8vw, 0.95rem) clamp(0.85rem, 2.5vw, 1.1rem);
}

.login-card--wide {
    max-width: 560px;
}

/* Logo de la IE: esquina superior derecha de la tarjeta */
.login-page--glass .login-card--has-inst-logo {
    position: relative;
}

.login-inst-mark {
    position: absolute;
    top: clamp(0.5rem, 1.4vw, 0.7rem);
    right: clamp(0.5rem, 1.4vw, 0.7rem);
    z-index: 2;
    width: 40px;
    height: 40px;
    padding: 3px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.login-inst-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-page--glass .login-card--has-inst-logo .login-eslogan {
    padding-right: 3.1rem;
}

.login-page--glass .login-eslogan {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(251, 191, 36, 0.95);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 0.3rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.login-page--glass .login-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    color: #fff;
}

.login-page--glass .login-card-lead {
    font-size: 0.8rem;
    color: var(--login-muted);
    margin: 0 0 0.55rem;
    line-height: 1.35;
}

.login-form {
    margin-top: 0.25rem;
}

.login-page--glass .login-card .form-label {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 0.22rem;
}

.login-page--glass .login-card .form-select,
.login-page--glass .login-card .form-control-plaintext {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f1f5f9;
    border-radius: 12px;
    min-height: 38px;
    font-size: 0.88rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

/* Lista desplegable: texto oscuro sobre fondo claro en Windows — forzar tema oscuro y option legibles */
.login-select-ie {
    color-scheme: dark;
}

.login-page--glass .login-card .login-select-ie option,
.login-page--glass .login-card select.form-select option {
    background-color: #0f172a;
    color: #f8fafc;
}

.login-page--glass .login-card .form-select:focus {
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.login-page--glass .login-card .form-control-plaintext {
    color: rgba(241, 245, 249, 0.95);
}

.login-page--glass .login-inst-readonly {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.login-page--glass .login-card .text-muted {
    color: rgba(255, 255, 255, 0.55) !important;
}

.login-page--glass .login-card .text-secondary {
    color: rgba(255, 255, 255, 0.58) !important;
}

.login-input-wrap {
    position: relative;
    margin-bottom: 0.82rem;
}

.login-access--fit .login-input-wrap {
    margin-bottom: 0.45rem;
}

.login-input-wrap--glass .input-icon {
    color: rgba(255, 255, 255, 0.45);
    font-size: 1.05rem;
}

.login-input-wrap--glass .form-control {
    padding-left: 2.35rem;
    padding-right: 0.25rem;
    min-height: 38px;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0;
    color: #fff;
    font-size: 0.9rem;
    box-shadow: none;
}

.login-input-wrap--glass .form-control::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.login-input-wrap--glass .form-control:focus {
    border-bottom-color: rgba(56, 189, 248, 0.85);
    box-shadow: none;
    outline: none;
}

.login-input-wrap--password .form-control {
    padding-right: 3.1rem;
}

/* Botón “ojo”: bien visible sobre el campo */
.login-page--glass .login-password-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(125, 211, 252, 0.55);
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.35) 0%, rgba(2, 132, 199, 0.45) 100%);
    color: #f0f9ff;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.28rem;
    line-height: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.login-page--glass .login-password-toggle:hover {
    color: #fff;
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.55) 0%, rgba(14, 165, 233, 0.55) 100%);
    border-color: rgba(186, 230, 253, 0.85);
}

.login-page--glass .login-password-toggle:active {
    transform: translateY(-50%) scale(0.97);
}

.login-password-toggle:focus-visible {
    outline: 2px solid rgba(125, 211, 252, 0.95);
    outline-offset: 2px;
}

.login-forgot {
    font-size: 0.78rem;
    text-align: left;
    margin: 0.1rem 0 0.55rem;
}

.login-access--fit .login-forgot {
    margin: 0 0 0.45rem;
}

.login-page--glass .login-forgot a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-weight: 500;
}

.login-page--glass .login-forgot a:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

.btn-login-submit {
    width: 100%;
    min-height: 42px;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 0.88rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--login-glass-btn) 0%, var(--login-glass-btn-mid) 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.35);
    transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-login-submit:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 28px rgba(14, 165, 233, 0.45);
}

.btn-login-submit:active {
    transform: translateY(1px);
}

.login-remember {
    margin-top: 0.55rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 0;
}

.login-page--glass .form-check-input {
    border-color: rgba(255, 255, 255, 0.35);
    background-color: rgba(255, 255, 255, 0.08);
}

.login-page--glass .form-check-input:checked {
    background-color: var(--login-glass-btn);
    border-color: var(--login-glass-btn);
}

.login-footer {
    margin-top: 0.4rem;
    text-align: center;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.3;
}

.login-page--glass .login-footer a {
    color: rgba(255, 255, 255, 0.62);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.login-page--glass .login-footer a:hover {
    color: #7dd3fc;
}

.login-access--fit .login-footer {
    margin-top: 0.28rem;
}

.login-page--glass .login-alert {
    border-radius: 10px;
    font-size: 0.8rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    color: #fecaca;
}

.login-page--glass .alert-warning {
    color: #fef3c7;
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.12);
}

.login-page--glass .alert-danger {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(220, 38, 38, 0.15);
}

/* Selector de instituciones (vistas alternativas) */
.login-inst-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .login-inst-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.login-inst-form {
    margin: 0;
}

.login-inst-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    min-height: 140px;
    padding: 1rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-inst-tile:hover {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 6px 24px rgba(14, 165, 233, 0.15);
}

.login-inst-tile:focus {
    outline: 2px solid rgba(56, 189, 248, 0.7);
    outline-offset: 2px;
}

.login-inst-tile-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.login-inst-tile-logo img {
    object-fit: contain;
    border-radius: 8px;
}

.login-inst-tile-icon {
    font-size: 2rem;
    color: #38bdf8;
    margin-bottom: 0.35rem;
}

.login-inst-tile-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: #fff;
    line-height: 1.3;
}

.login-inst-tile-slogan {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 0.35rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.login-notices-stack {
    width: 100%;
    max-width: 560px;
    margin: 0 auto 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-access--fit .login-notices-stack {
    margin-bottom: 0.3rem;
    gap: 0.35rem;
}

/* Avisos en capa glass */
.login-platform-banner {
    width: 100%;
    max-width: 560px;
    margin: 0;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.login-platform-banner--compact {
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
}

.login-platform-banner--compact .login-platform-banner__title {
    font-size: 0.72rem;
    margin-bottom: 0.2rem;
}

.login-platform-banner--compact .login-platform-banner__text {
    font-size: 0.86rem;
    font-weight: 500;
}

.login-platform-banner--ie {
    border-left: 3px solid color-mix(in srgb, var(--login-accent) 70%, #fff);
}

.login-platform-banner--info {
    background: rgba(14, 165, 233, 0.14);
    border-color: rgba(56, 189, 248, 0.4);
    color: #e0f2fe;
}

.login-platform-banner--mantenimiento {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.4);
    color: #fef3c7;
}

.login-platform-banner--urgente {
    background: rgba(220, 38, 38, 0.18);
    border-color: rgba(248, 113, 113, 0.45);
    color: #fecaca;
    animation: login-banner-pulse-urgent 1.8s ease-in-out infinite;
}

@keyframes login-banner-pulse-urgent {
    0%,
    100% {
        box-shadow: 0 4px 20px rgba(220, 38, 38, 0.15);
    }
    50% {
        box-shadow: 0 8px 32px rgba(220, 38, 38, 0.35);
    }
}

.login-platform-banner__inner {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.login-platform-banner__icon {
    font-size: 1.35rem;
    flex-shrink: 0;
    line-height: 1;
    opacity: 0.95;
}

.login-platform-banner__title {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.25rem;
    opacity: 0.88;
}

.login-platform-banner__text {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
    .login-platform-banner--urgente {
        animation: none;
    }
}

.login-mobile-hint {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
}

.login-mobile-hint summary {
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    user-select: none;
    line-height: 1.3;
}

.login-mobile-hint summary::-webkit-details-marker {
    display: none;
}

.login-mobile-hint summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 0.35rem;
    transition: transform 0.15s ease;
}

.login-mobile-hint[open] summary::before {
    transform: rotate(90deg);
}

.login-mobile-hint__body {
    margin-top: 0.45rem;
    padding-left: 0.15rem;
    line-height: 1.4;
    font-size: 0.72rem;
}

.login-mobile-hint__body strong {
    color: rgba(255, 255, 255, 0.88);
}
