:root {
    --navy-950: #020817;
    --navy-900: #061225;
    --navy-850: #0a1b31;
    --cyan: #00d4ff;
    --gold: #ffe100;
    --gold-strong: #ffcc00;
    --white: #ffffff;
    --muted: #a8b9ca;
    --line: rgba(148, 198, 255, .18);
    --glass: rgba(4, 13, 27, .78);
    --danger: #ff5f57;
}

* {
    box-sizing: border-box;
}

body.login-body {
    margin: 0;
    min-height: 100vh;
    color: var(--white);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--navy-950);
    overflow-x: hidden;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr);
}

.login-hero-panel {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    isolation: isolate;
}

.login-hero-bg {
    position: absolute;
    inset: 0;
    background-image: url("/static/img/login-hero-ryr.png");
    background-size: cover;
    background-position: center;
    transform: scale(1.02);
    z-index: 0;
}

.login-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 22%, rgba(0, 212, 255, .22), transparent 30%),
        linear-gradient(90deg, rgba(2, 8, 23, .92) 0%, rgba(2, 8, 23, .64) 42%, rgba(2, 8, 23, .20) 100%),
        linear-gradient(180deg, rgba(2, 8, 23, .18), rgba(2, 8, 23, .82));
    z-index: 1;
}

.login-hero-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, .05) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(to right, rgba(0,0,0,.9), transparent 85%);
    z-index: 2;
    pointer-events: none;
}

.login-hero-content {
    position: relative;
    z-index: 3;
    min-height: 100vh;
    max-width: 760px;
    padding: 48px clamp(34px, 6vw, 82px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-brand {
    position: absolute;
    top: 34px;
    left: clamp(34px, 6vw, 82px);
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: #dbeafe;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 12px;
}

.login-brand img {
    width: 76px;
    max-height: 48px;
    object-fit: contain;
    filter: brightness(1.55) contrast(1.1) drop-shadow(0 0 18px rgba(0, 212, 255, .22));
}

.hero-badge {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #dffbff;
    padding: 10px 14px;
    border: 1px solid rgba(0, 212, 255, .28);
    border-radius: 999px;
    background: rgba(0, 212, 255, .09);
    backdrop-filter: blur(16px);
    font-size: 13px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.hero-badge i {
    color: var(--gold);
}

.login-hero-content h1 {
    margin: 26px 0 20px;
    font-size: clamp(42px, 5.6vw, 82px);
    line-height: .94;
    letter-spacing: -.065em;
    font-weight: 950;
    max-width: 820px;
}

.login-hero-content p {
    max-width: 680px;
    margin: 0;
    color: #c2d2e4;
    font-size: 18px;
    line-height: 1.72;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 34px;
    max-width: 620px;
}

.hero-metrics div {
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(148, 198, 255, .18);
    background: rgba(255, 255, 255, .06);
    backdrop-filter: blur(18px);
}

.hero-metrics strong {
    display: block;
    color: var(--gold);
    font-size: 25px;
    line-height: 1;
    letter-spacing: -.04em;
}

.hero-metrics span {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
}

.login-form-panel {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 34px;
    background:
        radial-gradient(circle at 50% 0%, rgba(0, 212, 255, .16), transparent 34%),
        linear-gradient(180deg, #081a30 0%, #020817 100%);
}

.login-form-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(145deg, rgba(255,255,255,.035), transparent 38%),
        radial-gradient(circle at 90% 78%, rgba(255,225,0,.10), transparent 28%);
    pointer-events: none;
}

.login-card {
    position: relative;
    z-index: 1;
    width: min(100%, 460px);
    padding: 34px;
    border-radius: 30px;
    border: 1px solid rgba(148, 198, 255, .20);
    background:
        linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.045));
    box-shadow: 0 32px 90px rgba(0, 0, 0, .42);
    backdrop-filter: blur(24px);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #b7c9dc;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 26px;
}

.back-link:hover {
    color: var(--white);
}

.form-header {
    margin-bottom: 24px;
}

.form-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    color: #06101e;
    background: linear-gradient(135deg, var(--gold), var(--gold-strong));
    font-size: 28px;
    box-shadow: 0 18px 42px rgba(255, 204, 0, .24);
    margin-bottom: 18px;
}

.form-header span {
    color: var(--cyan);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.form-header h2 {
    margin: 8px 0 8px;
    font-size: 38px;
    line-height: 1;
    letter-spacing: -.045em;
}

.form-header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.login-alerts {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.login-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 95, 87, .32);
    background: rgba(255, 95, 87, .10);
    color: #ffd5d2;
    font-size: 13px;
}

.login-form {
    display: grid;
    gap: 16px;
}

.field-group {
    display: grid;
    gap: 8px;
}

.field-group label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #dbeafe;
    font-size: 13px;
    font-weight: 850;
}

.field-group label i {
    color: var(--gold);
}

.form-control-pro {
    width: 100%;
    height: 54px;
    border: 1px solid rgba(148, 198, 255, .18);
    border-radius: 17px;
    padding: 0 16px;
    color: var(--white);
    outline: none;
    background: rgba(2, 8, 23, .58);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
    transition: border .2s ease, box-shadow .2s ease, background .2s ease;
}

.form-control-pro::placeholder {
    color: rgba(168, 185, 202, .64);
}

.form-control-pro:focus {
    border-color: rgba(0, 212, 255, .55);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, .10);
    background: rgba(2, 8, 23, .72);
}

.btn-login-pro {
    width: 100%;
    height: 56px;
    border: 0;
    border-radius: 18px;
    color: #06101e;
    background: linear-gradient(135deg, var(--gold), var(--gold-strong));
    box-shadow: 0 20px 48px rgba(255, 204, 0, .26);
    font-weight: 950;
    letter-spacing: -.01em;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
    margin-top: 4px;
}

.btn-login-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 26px 58px rgba(255, 204, 0, .34);
}

.security-note {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    color: #8ea4bb;
    font-size: 12px;
    line-height: 1.45;
    margin-top: 18px;
}

.security-note i {
    color: var(--cyan);
}

.login-logos {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid rgba(148, 198, 255, .14);
}

.login-logos img {
    width: auto;
    object-fit: contain;
}

.login-logos img:first-child {
    max-width: 168px;
    max-height: 48px;
}

.login-logos img:last-child {
    max-width: 150px;
    max-height: 36px;
}

@media (max-width: 1040px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-hero-panel {
        min-height: 54vh;
    }

    .login-hero-content {
        min-height: 54vh;
        padding-top: 110px;
        padding-bottom: 42px;
    }

    .login-form-panel {
        min-height: auto;
    }
}

@media (max-width: 640px) {
    .login-hero-content {
        padding-left: 22px;
        padding-right: 22px;
    }

    .login-brand {
        left: 22px;
    }

    .login-hero-content h1 {
        font-size: 40px;
    }

    .hero-metrics {
        grid-template-columns: 1fr;
    }

    .login-form-panel {
        padding: 18px;
    }

    .login-card {
        padding: 24px;
        border-radius: 24px;
    }

    .login-logos {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* ==========================================================
   FIX LOGIN LOGOS: AEGIS + MXAIB + ONKOGENETIK JUNTOS
   ========================================================== */

/* El logo ya no va flotando en el hero izquierdo */
.login-brand {
    display: none !important;
}

/* El hero empieza limpio, sin logo encimado */
.login-hero-content {
    padding-top: 48px !important;
}

/* Card un poco más ancho para que quepan logos sin deformar */
.login-card {
    width: min(100%, 520px) !important;
    padding: 30px 34px 32px !important;
}

/* Franja superior de logos dentro del card */
.login-logo-strip {
    display: grid !important;
    grid-template-columns: 72px minmax(150px, 1fr) minmax(120px, .8fr) !important;
    align-items: center !important;
    gap: 18px !important;
    width: 100% !important;
    padding: 14px 16px !important;
    margin-bottom: 22px !important;
    border: 1px solid rgba(148, 198, 255, .18) !important;
    border-radius: 22px !important;
    background:
        radial-gradient(circle at 20% 0%, rgba(0, 212, 255, .12), transparent 45%),
        rgba(2, 8, 23, .42) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06) !important;
    overflow: hidden !important;
}

.login-logo-strip img {
    display: block !important;
    width: auto !important;
    object-fit: contain !important;
    object-position: center !important;
    justify-self: center !important;
}

/* AEGIS es vertical: controlarlo por altura y ancho */
.login-logo-aegis {
    max-height: 50px !important;
    max-width: 58px !important;
    filter: brightness(1.55) contrast(1.12) drop-shadow(0 0 12px rgba(0, 212, 255, .18)) !important;
}

/* RYR es ancho: controlarlo por ancho y altura */
.login-logo-mxaib {
    max-height: 46px !important;
    max-width: 190px !important;
    filter: brightness(1.08) contrast(1.05) !important;
}

/* RYR es bajo y horizontal */
.login-logo-onko {
    max-height: 34px !important;
    max-width: 150px !important;
    filter: brightness(1.08) contrast(1.05) !important;
}

/* Ajustar espacio del link */
.back-link {
    margin-bottom: 20px !important;
}

/* Quitar logos viejos inferiores si quedaron en alguna versión */
.login-logos {
    display: none !important;
}

@media (max-width: 1180px) {
    .login-card {
        width: min(100%, 500px) !important;
    }

    .login-logo-strip {
        grid-template-columns: 62px 1fr 130px !important;
        gap: 14px !important;
    }

    .login-logo-mxaib {
        max-width: 170px !important;
    }

    .login-logo-onko {
        max-width: 132px !important;
    }
}

@media (max-width: 640px) {
    .login-logo-strip {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        padding: 18px !important;
    }

    .login-logo-aegis {
        max-height: 48px !important;
        max-width: 56px !important;
    }

    .login-logo-mxaib {
        max-height: 44px !important;
        max-width: 230px !important;
    }

    .login-logo-onko {
        max-height: 34px !important;
        max-width: 190px !important;
    }
}


/* ==========================================================
   RYR LOGIN BRANDING: SOLO AEGIS + RYR BLANCO
   ========================================================== */

.login-logo-mxaib,
.login-logo-onko,
.login-logos {
    display: none !important;
}

.login-logo-strip-ryr {
    display: grid !important;
    grid-template-columns: 76px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 18px !important;
}

.login-logo-ryr {
    display: block !important;
    width: auto !important;
    max-height: 52px !important;
    max-width: 240px !important;
    object-fit: contain !important;
    justify-self: center !important;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .20)) !important;
}

@media (max-width: 640px) {
    .login-logo-strip-ryr {
        grid-template-columns: 1fr !important;
    }

    .login-logo-ryr {
        max-width: 230px !important;
        max-height: 48px !important;
    }
}


/* ==========================================================
   RYR LOGIN WORDMARK
   ========================================================== */

.ryr-wordmark-login {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.ryr-wordmark-login span {
    color: rgba(234, 246, 255, .86);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow: 0 0 12px rgba(0, 212, 255, .20);
}


/* ==========================================================
   RYR LOGIN PURGA TOTAL: SOLO AEGIS + RYR
   ========================================================== */

.login-logo-mxaib,
.login-logo-onko,
.login-logos {
    display: none !important;
}

.login-logo-strip-ryr {
    display: grid !important;
    grid-template-columns: 76px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 18px !important;
}

.ryr-wordmark-login {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.login-logo-ryr {
    display: block !important;
    width: auto !important;
    max-height: 52px !important;
    max-width: 240px !important;
    object-fit: contain !important;
    justify-self: center !important;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .20)) !important;
}

.ryr-wordmark-login span {
    color: rgba(234, 246, 255, .86);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow: 0 0 12px rgba(0, 212, 255, .20);
}
