/* Login — Opción A (portal educativo limpio), fondo igual que el sistema */

:root {
    --login-radius: 20px;
    --login-radius-sm: 12px;
    --login-ease: cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Mismo fondo difuso que modulos.css — el usuario lo cambia desde Dash */
.sagyc-backdrop {
    position: fixed;
    inset: -64px;
    z-index: -2;
    pointer-events: none;
    background-image: var(--sagyc-bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(48px) saturate(1.45) brightness(1.05);
    transform: scale(1.1);
    opacity: 1;
}

.sagyc-backdrop-tint {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 248, 250, 0.08) 50%, rgba(240, 245, 255, 0.12) 100%),
        radial-gradient(ellipse at 15% 8%, var(--sagyc-accent-soft, rgba(0, 0, 0, 0.05)) 0%, transparent 50%),
        radial-gradient(ellipse at 88% 92%, rgba(52, 120, 180, 0.04) 0%, transparent 45%);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: var(--color-tabla-titulo-fuente, #2d3436);
    overflow-x: hidden;
    background-image: var(--body-bg-image, none);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: #ffffff;
    border-radius: var(--login-radius);
    border: 1px solid var(--sagyc-panel-border, rgba(0, 0, 0, 0.1));
    box-shadow: 0 1px 2px rgba(30, 20, 28, 0.04), 0 16px 48px rgba(30, 20, 28, 0.1);
    padding: 2.75rem 2.25rem;
    position: relative;
    overflow: hidden;
    animation: login-card-in 0.35s var(--login-ease) both;
}

@keyframes login-card-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-boton-enfasis), var(--resaltado1));
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-logo {
    width: 110px;
    height: 110px;
    background: #ffffff;
    border: 1px solid var(--color-boton-borde);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 14px;
}

.brand-logo img {
    max-width: 100%;
    height: auto;
}

.brand-name {
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--color-tabla-titulo-fuente);
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.brand-subtitle {
    font-size: 0.92rem;
    color: var(--sagyc-text-muted, #6b7280);
    font-weight: 400;
}

.form-floating {
    margin-bottom: 1rem;
}

.form-floating > .form-control,
.form-floating > .form-select {
    height: 54px;
    background: #ffffff;
    border: 1px solid var(--sagyc-panel-border, rgba(0, 0, 0, 0.12));
    border-radius: var(--login-radius-sm);
    padding-left: 3rem;
    font-size: 0.95rem;
    color: var(--color-tabla-titulo-fuente);
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.form-floating > label {
    padding-left: 3rem;
    color: #6b7280;
}

.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    background: #fff;
    border-color: var(--color-boton-enfasis);
    box-shadow: 0 0 0 3px var(--color-focus-ring, rgba(0, 0, 0, 0.15));
    outline: none;
}

.input-icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    z-index: 10;
    font-size: 1rem;
    transition: color 0.15s ease;
}

.form-floating:focus-within .input-icon {
    color: var(--color-boton-enfasis);
}

.btn-submit {
    background: var(--color-boton-enfasis);
    color: #fff;
    border: 1px solid var(--color-boton-enfasis);
    border-radius: var(--login-radius-sm);
    padding: 0.9rem 1rem;
    font-weight: 600;
    font-size: 1rem;
    width: 100%;
    cursor: pointer;
    transition: transform 0.15s var(--login-ease), box-shadow 0.15s ease, filter 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px var(--color-focus-ring, rgba(0, 0, 0, 0.18));
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px var(--color-focus-ring, rgba(0, 0, 0, 0.22));
    filter: brightness(1.04);
    color: #fff;
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:focus-visible {
    outline: 2px solid var(--color-boton-enfasis);
    outline-offset: 2px;
}

.btn-ghost {
    background: #ffffff;
    color: var(--color-boton-enfasis);
    border: 1px solid var(--color-boton-borde);
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--login-radius-sm);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-ghost:hover {
    background: var(--color-boton-hover);
    border-color: var(--color-boton-enfasis);
    color: var(--color-boton-enfasis);
    transform: translateY(-1px);
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
    border-top: 1px solid var(--sagyc-panel-border, rgba(0, 0, 0, 0.1));
    padding-top: 1.25rem;
}

.login-footer p {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.version-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #f8f9fb;
    border: 1px solid var(--color-boton-borde);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}

.form-check-input:checked {
    background-color: var(--color-boton-enfasis);
    border-color: var(--color-boton-enfasis);
}

.swal2-popup {
    border-radius: var(--login-radius) !important;
    font-family: 'Inter', sans-serif !important;
    border: 1px solid var(--sagyc-panel-border, rgba(0, 0, 0, 0.1)) !important;
    box-shadow: 0 16px 48px rgba(30, 20, 28, 0.12) !important;
}

@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.35rem;
    }

    .brand-logo {
        width: 92px;
        height: 92px;
    }
}

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

    .btn-submit:hover,
    .btn-ghost:hover {
        transform: none;
    }
}
