/* ============================================================
   CUH · Acceso de médicos — diseño moderno (v2)
   ------------------------------------------------------------
   Hoja propia de la pantalla de ingreso. No toca css/login.css
   para no alterar restablecer.php ni otras pantallas.
   Los colores salen de css/cuh-tema.css.
   ============================================================ */

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

html, body { height: 100%; }

body.cuh-login {
    margin: 0;
    font-family: "Plus Jakarta Sans", var(--cuh-fuente);
    color: var(--cuh-tinta);
    background: #eef3f8;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

.lg-pantalla {
    display: grid;
    grid-template-columns: 1.04fr .96fr;
    min-height: 100vh;
}

/* ============================================================
   1. Panel de marca (izquierda)
   ============================================================ */

.lg-marca {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    overflow: hidden;
    color: #fff;
    background: #071f27;
}

/* La foto va como fondo y dentro de una media query: asi el
   telefono, que no muestra este panel, no la descarga. */
.lg-marca-foto {
    position: absolute;
    inset: 0;
    background-position: center 20%;
    background-size: cover;
    opacity: .30;
    filter: saturate(.8) contrast(1.05);
    transform: scale(1.04);
    animation: lgAcerca 26s ease-in-out infinite alternate;
}
@media (min-width: 992px) {
    .lg-marca-foto { background-image: url("../../images/doctorlogin.jpg"); }
}
@keyframes lgAcerca {
    from { transform: scale(1.04); }
    to   { transform: scale(1.12); }
}

/* velo de color: el texto siempre queda legible sobre la foto */
.lg-velo {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(155deg, rgba(7,31,39,.90) 0%, rgba(7,94,104,.72) 45%, rgba(6,26,33,.96) 100%);
}

/* luces que se mueven despacio detras del velo */
.lg-luz {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .55;
    pointer-events: none;
}
.lg-luz-1 {
    width: 460px; height: 460px;
    top: -140px; right: -120px;
    background: radial-gradient(circle, rgba(19,167,183,.95) 0%, transparent 68%);
    animation: lgFlota 19s ease-in-out infinite alternate;
}
.lg-luz-2 {
    width: 380px; height: 380px;
    bottom: -130px; left: -100px;
    background: radial-gradient(circle, rgba(46,196,168,.75) 0%, transparent 70%);
    animation: lgFlota 24s ease-in-out infinite alternate-reverse;
}
@keyframes lgFlota {
    from { transform: translate3d(0,0,0) scale(1); }
    to   { transform: translate3d(-46px, 40px, 0) scale(1.16); }
}

/* trama de puntos muy tenue, da textura sin ensuciar */
.lg-trama {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.16) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 78%);
            mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 78%);
    opacity: .5;
}

.lg-marca > .lg-capa { position: relative; z-index: 1; }

.lg-logo img {
    width: 188px;
    max-width: 58%;
    height: auto;
    filter: drop-shadow(0 8px 22px rgba(0,0,0,.45));
}

/* --- bloque central --- */
.lg-marca-texto { max-width: 480px; }

.lg-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 6px 14px;
    border-radius: var(--cuh-r-full);
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.20);
    backdrop-filter: blur(6px);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: #a9f0f8;
}
.lg-eyebrow i { font-size: 10px; }

.lg-marca-texto h2 {
    margin: 0 0 14px;
    font-size: 38px;
    line-height: 1.16;
    font-weight: 800;
    letter-spacing: -1.2px;
}
.lg-brillo {
    background: linear-gradient(100deg, #7fe4ee 0%, #2ec4a8 55%, #a9f0f8 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
}
.lg-marca-texto > p {
    margin: 0 0 30px;
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255,255,255,.74);
    max-width: 420px;
}

/* --- tarjetas de cristal con las ventajas --- */
.lg-puntos { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.lg-puntos li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border-radius: 15px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.13);
    backdrop-filter: blur(8px);
    font-size: 13.5px;
    font-weight: 600;
    color: rgba(255,255,255,.92);
    transition: background .25s ease, transform .25s ease, border-color .25s ease;
    animation: lgSube .7s cubic-bezier(.2,.7,.3,1) both;
}
.lg-puntos li:nth-child(1) { animation-delay: .10s; }
.lg-puntos li:nth-child(2) { animation-delay: .18s; }
.lg-puntos li:nth-child(3) { animation-delay: .26s; }
.lg-puntos li:hover {
    background: rgba(255,255,255,.12);
    border-color: rgba(127,228,238,.38);
    transform: translateX(5px);
}
.lg-puntos i {
    flex: 0 0 auto;
    width: 36px; height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 14px;
    color: #071f27;
    background: linear-gradient(135deg, #7fe4ee 0%, #2ec4a8 100%);
    box-shadow: 0 8px 18px -10px rgba(127,228,238,.9);
}

/* --- pie con el latido --- */
.lg-marca-pie { display: grid; gap: 13px; }
.lg-latido { width: 100%; height: 26px; overflow: hidden; opacity: .65; }
.lg-latido path {
    fill: none;
    stroke: #7fe4ee;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 320;
    stroke-dashoffset: 320;
    animation: lgLatido 3.4s linear infinite;
}
@keyframes lgLatido {
    to { stroke-dashoffset: -320; }
}
.lg-marca-pie p {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 11.5px;
    letter-spacing: .3px;
    color: rgba(255,255,255,.55);
}
.lg-marca-pie i { color: #7fe4ee; }

/* ============================================================
   2. Panel de acceso (derecha)
   ============================================================ */

.lg-acceso {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 44px 30px;
    overflow: hidden;
    background: #eef3f8;
}

/* luces suaves detras de la tarjeta: dan sentido al cristal */
.lg-acceso::before,
.lg-acceso::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}
.lg-acceso::before {
    width: 420px; height: 420px;
    top: -120px; right: -110px;
    background: radial-gradient(circle, rgba(19,167,183,.34) 0%, transparent 68%);
}
.lg-acceso::after {
    width: 380px; height: 380px;
    bottom: -140px; left: -120px;
    background: radial-gradient(circle, rgba(46,196,168,.26) 0%, transparent 70%);
}

.lg-tarjeta {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 448px;
    padding: 40px 40px 32px;
    border-radius: 26px;
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(255,255,255,.9);
    backdrop-filter: blur(22px) saturate(1.4);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
    box-shadow:
        0 1px 0 rgba(255,255,255,.9) inset,
        0 2px 8px rgba(16,31,49,.05),
        0 34px 70px -30px rgba(8,39,49,.5);
    animation: lgEntra .6s cubic-bezier(.2,.7,.3,1) both;
}
/* hilo de color en el borde superior */
.lg-tarjeta::before {
    content: '';
    position: absolute;
    top: 0; left: 34px; right: 34px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, transparent, var(--cuh-primario-claro), var(--cuh-ok), transparent);
}

@keyframes lgEntra {
    from { opacity: 0; transform: translateY(20px) scale(.985); }
    to   { opacity: 1; transform: none; }
}
@keyframes lgSube {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.lg-tarjeta > * { animation: lgSube .6s cubic-bezier(.2,.7,.3,1) both; }
.lg-tarjeta > *:nth-child(1) { animation-delay: .06s; }
.lg-tarjeta > *:nth-child(2) { animation-delay: .12s; }
.lg-tarjeta > *:nth-child(3) { animation-delay: .18s; }
.lg-tarjeta > *:nth-child(4) { animation-delay: .24s; }
.lg-tarjeta > *:nth-child(5) { animation-delay: .30s; }

/* logo solo visible cuando se oculta el panel de marca */
.lg-logo-movil { display: none; margin-bottom: 24px; text-align: center; }
.lg-logo-movil img { width: 152px; height: auto; }

.lg-saludo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    margin-bottom: 16px;
    border-radius: var(--cuh-r-full);
    background: linear-gradient(120deg, var(--cuh-primario-suave), #eafaf6);
    border: 1px solid var(--cuh-primario-borde);
    color: var(--cuh-info-texto);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
}
.lg-saludo i { color: var(--cuh-primario-claro); }

.lg-tarjeta h1 {
    margin: 0 0 8px;
    font-size: 29px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.15;
    color: var(--cuh-tinta);
}
.lg-sub {
    margin: 0 0 28px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--cuh-apagado);
}

/* ---------- aviso de error ---------- */
.lg-aviso {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 22px;
    padding: 13px 15px;
    border-radius: 14px;
    background: linear-gradient(120deg, #fdeef1, #fdf3f4);
    border: 1px solid #f6d3d8;
    color: var(--cuh-peligro-texto);
    font-size: 12.5px;
    line-height: 1.55;
    box-shadow: 0 10px 24px -18px rgba(163,34,54,.9);
    animation: lgTiembla .45s ease both;
}
.lg-aviso > i {
    flex: 0 0 auto;
    width: 26px; height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(209,84,78,.14);
    font-size: 12px;
}
.lg-aviso b { display: block; margin-bottom: 2px; font-size: 13px; }
@keyframes lgTiembla {
    0%, 100% { transform: none; }
    22%      { transform: translateX(-6px); }
    64%      { transform: translateX(5px); }
}

/* ---------- campos con etiqueta flotante ---------- */
.lg-campo { margin-bottom: 15px; }

.lg-caja {
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid var(--cuh-linea);
    border-radius: 15px;
    background: rgba(255,255,255,.7);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.lg-caja:focus-within {
    border-color: var(--cuh-primario);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(8,127,140,.13);
}

.lg-caja > .lg-ico {
    position: absolute;
    left: 16px;
    font-size: 14px;
    color: #a8bccb;
    pointer-events: none;
    transition: color .18s ease, transform .18s ease;
}
.lg-caja:focus-within > .lg-ico { color: var(--cuh-primario); transform: scale(1.08); }

.lg-caja input {
    width: 100%;
    height: 62px;
    padding: 22px 16px 6px 46px;
    border: 0;
    border-radius: 15px;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--cuh-tinta);
    outline: none;
}
.lg-caja input#usuario { text-transform: lowercase; }
.lg-caja input#password { padding-right: 52px; letter-spacing: .6px; }

/* la etiqueta vive dentro del campo y sube al escribir */
.lg-caja label {
    position: absolute;
    left: 46px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 600;
    color: #9db2c2;
    pointer-events: none;
    transition: all .18s cubic-bezier(.2,.7,.3,1);
}
.lg-caja input:focus + label,
.lg-caja input:not(:placeholder-shown) + label,
.lg-caja input:-webkit-autofill + label {
    top: 13px;
    transform: none;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .9px;
    text-transform: uppercase;
    color: var(--cuh-primario);
}

/* el navegador pinta los campos autocompletados de amarillo:
   se respeta el fondo del diseño sin perder el autorrelleno */
.lg-caja input:-webkit-autofill,
.lg-caja input:-webkit-autofill:hover,
.lg-caja input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--cuh-tinta);
    -webkit-box-shadow: 0 0 0 60px #fff inset;
    transition: background-color 9999s ease-out;
}

.lg-ojo {
    position: absolute;
    right: 8px;
    width: 38px; height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 11px;
    background: none;
    color: #9db2c2;
    font-size: 14px;
    cursor: pointer;
    transition: color .16s ease, background .16s ease;
}
.lg-ojo:hover { color: var(--cuh-primario); background: var(--cuh-primario-suave); }

/* aviso de bloq mayús */
.lg-mayus {
    display: none;
    align-items: center;
    gap: 7px;
    margin: 8px 0 0 4px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--cuh-aviso-texto);
}
.lg-mayus.lg-visible { display: flex; animation: lgSube .3s ease both; }

/* ---------- recordar y enlace ---------- */
.lg-fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 20px 0 24px;
}

.lg-recordar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cuh-tinta-2);
    cursor: pointer;
    user-select: none;
}
.lg-recordar input { position: absolute; opacity: 0; width: 0; height: 0; }
.lg-marca-check {
    width: 21px; height: 21px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1.5px solid var(--cuh-linea);
    border-radius: 7px;
    background: #fff;
    color: transparent;
    font-size: 10px;
    transition: background .2s cubic-bezier(.2,.7,.3,1), border-color .2s ease, color .2s ease, transform .2s ease;
}
.lg-recordar:hover .lg-marca-check { border-color: var(--cuh-primario-borde); }
.lg-recordar input:checked + .lg-marca-check {
    background: var(--cuh-grad-acento);
    border-color: var(--cuh-primario);
    color: #fff;
    transform: scale(1.06);
}
.lg-recordar input:focus-visible + .lg-marca-check {
    box-shadow: 0 0 0 4px rgba(8,127,140,.16);
}

.lg-olvido {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--cuh-primario);
    text-decoration: none;
    transition: color .15s ease;
}
.lg-olvido:hover { color: var(--cuh-primario-oscuro); text-decoration: underline; }

/* ---------- botón ---------- */
.lg-boton {
    position: relative;
    width: 100%;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    overflow: hidden;
    border: 0;
    border-radius: 15px;
    background: linear-gradient(120deg, #087f8c 0%, #13a7b7 52%, #2ec4a8 100%);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .2px;
    cursor: pointer;
    box-shadow: 0 16px 32px -16px rgba(8,127,140,.95);
    transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}
/* destello que cruza el boton al pasar el mouse */
.lg-boton::after {
    content: '';
    position: absolute;
    top: 0; left: -120%;
    width: 60%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.34), transparent);
    transform: skewX(-18deg);
    transition: left .55s ease;
}
.lg-boton:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 22px 40px -18px rgba(8,127,140,1);
}
.lg-boton:hover::after { left: 130%; }
.lg-boton:active { transform: translateY(0); }
.lg-boton[disabled] { opacity: .78; cursor: default; transform: none; }
.lg-boton i { transition: transform .18s ease; }
.lg-boton:hover i { transform: translateX(3px); }
.lg-boton .lg-girando {
    display: none;
    width: 17px; height: 17px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lgGira .7s linear infinite;
}
.lg-boton.lg-enviando .lg-girando { display: block; }
.lg-boton.lg-enviando i { display: none; }
.lg-boton.lg-enviando::after { display: none; }
@keyframes lgGira { to { transform: rotate(360deg); } }

/* ---------- pie de la tarjeta ---------- */
.lg-pie {
    margin: 26px 0 0;
    padding-top: 20px;
    border-top: 1px solid rgba(16,31,49,.07);
    text-align: center;
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--cuh-apagado);
}
.lg-pie-sello {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
    padding: 4px 12px;
    border-radius: var(--cuh-r-full);
    background: var(--cuh-ok-suave);
    color: var(--cuh-ok-texto);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.lg-pie-sello i { font-size: 10px; }

/* ============================================================
   3. Adaptación a pantallas pequeñas
   ============================================================ */

@media (max-width: 1299.98px) {
    .lg-marca { padding: 40px 42px; }
    .lg-marca-texto h2 { font-size: 32px; }
}

/* Portátiles de pantalla baja: el panel de marca se compacta para
   que el latido y el pie no queden cortados. */
@media (min-width: 992px) and (max-height: 840px) {
    .lg-marca { padding: 32px 44px; }
    .lg-logo img { width: 156px; }
    .lg-eyebrow { margin-bottom: 14px; }
    .lg-marca-texto h2 { font-size: 29px; margin-bottom: 10px; }
    .lg-marca-texto > p { font-size: 14px; margin-bottom: 20px; }
    .lg-puntos { gap: 9px; }
    .lg-puntos li { padding: 10px 14px; font-size: 12.5px; }
    .lg-puntos i { width: 32px; height: 32px; font-size: 13px; }
    .lg-latido { height: 20px; }
    .lg-acceso { padding: 30px; }
    .lg-tarjeta { padding: 32px 34px 26px; }
}

@media (min-width: 992px) and (max-height: 720px) {
    .lg-marca { padding: 24px 40px; }
    .lg-marca-texto > p { display: none; }
    .lg-marca-texto h2 { font-size: 26px; }
    .lg-logo img { width: 140px; }
    .lg-latido { display: none; }
}

@media (max-width: 991.98px) {
    .lg-pantalla { grid-template-columns: 1fr; }
    .lg-marca { display: none; }
    .lg-logo-movil { display: block; }
    .lg-acceso { padding: 28px 18px 36px; }
    .lg-acceso::before { width: 320px; height: 320px; top: -130px; right: -90px; }
    .lg-acceso::after  { width: 300px; height: 300px; }
    .lg-tarjeta { padding: 32px 24px 26px; border-radius: 24px; }
    .lg-tarjeta h1 { font-size: 25px; }
}

@media (max-width: 400px) {
    .lg-fila { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .lg-tarjeta, .lg-tarjeta > *, .lg-aviso, .lg-puntos li { animation: none; }
    .lg-marca-foto, .lg-luz, .lg-latido path { animation: none; }
    .lg-boton, .lg-caja, .lg-caja label { transition: none; }
}
