/* ==========================================================================
   LOGIN CLINICAL FREE - DISEÑO OFICIAL (IMAGEN 1 & IMAGEN 2)
   100% RESPONSIVE: Móviles, tablets, laptops, pantallas 4K y modo landscape.
   ========================================================================== */

* {
    box-sizing: border-box;
}

body.login-page {
    margin: 0;
    padding: clamp(20px, 4vh, 40px) 16px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #030d1d;
    background-image: 
        radial-gradient(circle at 18% 30%, rgba(0, 180, 240, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 82% 35%, rgba(0, 140, 220, 0.10) 0%, transparent 40%),
        radial-gradient(circle at 50% 90%, rgba(2, 24, 52, 0.75) 0%, transparent 60%),
        linear-gradient(135deg, #020917 0%, #06152b 50%, #030a17 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #e2e8f0;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Decoraciones de fondo: Circuitería tecnológica y holograma médico */
.login-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* Holograma cruz médica / circuitería en esquina superior derecha */
.login-bg-cross {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 320px;
    height: 320px;
    opacity: 0.18;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.25) 0%, transparent 70%);
}

.login-bg-cross svg {
    width: 100%;
    height: 100%;
    stroke: #00d2ff;
    fill: none;
    stroke-width: 1.5;
}

/* Red de constelaciones y nodos ciber-médicos */
.login-bg-circuits {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.22;
}

/* Contenedor principal de dos columnas */
.login-layout-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(24px, 4vw, 48px);
}

/* --------------------------------------------------------------------------
   COLUMNA IZQUIERDA: HERO / BRANDING (LOGO OFICIAL IMAGEN 2)
   -------------------------------------------------------------------------- */
.login-hero-section {
    flex: 1 1 480px;
    max-width: 560px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-left: 10px;
}

.login-hero-logo {
    width: 100%;
    max-width: 440px;
    margin-bottom: 24px;
}

.login-hero-logo picture {
    display: block;
    width: 100%;
}

.login-hero-logo img {
    width: 100%;
    height: auto;
    max-height: 155px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 10px 25px rgba(0, 160, 240, 0.25));
}

.login-hero-slogan {
    font-size: clamp(16px, 2.1vw, 21px);
    line-height: 1.55;
    color: #8da4bc;
    margin: 0;
    letter-spacing: -0.2px;
}

.login-hero-slogan strong {
    color: #ffffff;
    font-weight: 700;
}

.login-hero-company {
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #061528;
    border: 1px solid #14324f;
    border-radius: 9999px;
    padding: 5px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #cbd5e1;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.login-hero-company .company-dot {
    width: 6.5px;
    height: 6.5px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981, 0 0 12px rgba(16, 185, 129, 0.8);
    display: inline-block;
}

.login-hero-company .company-name {
    color: #e2e8f0;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   COLUMNA DERECHA: TARJETA DE LOGIN (IMAGEN 1)
   -------------------------------------------------------------------------- */
.login-card-section {
    flex: 1 1 420px;
    width: 100%;
    max-width: 420px;
    min-width: 0;
}

.login-card {
    width: 100%;
    background: rgba(8, 24, 46, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 192, 240, 0.22);
    border-radius: 22px;
    padding: 40px 36px 36px;
    box-shadow: 
        0 25px 60px -10px rgba(0, 5, 16, 0.75),
        0 0 35px rgba(0, 160, 240, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    box-shadow: 
        0 30px 70px -10px rgba(0, 5, 16, 0.85),
        0 0 45px rgba(0, 180, 255, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.login-card-title {
    font-size: 25px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 24px 0;
    text-align: center;
    letter-spacing: -0.3px;
}

/* Alertas de autenticación */
.login-alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 18px;
    display: none;
    line-height: 1.4;
    word-break: break-word;
}

.login-alert-danger {
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: #fca5a5;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

.login-alert-warning {
    background: rgba(217, 119, 6, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.45);
    color: #fde68a;
    display: block;
}

/* Campos del formulario */
.login-form-group {
    margin-bottom: 18px;
    text-align: left;
}

.login-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #8da4bc;
    margin-bottom: 7px;
}

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

.login-input {
    width: 100%;
    height: 46px;
    background: #061528;
    border: 1px solid #14324f;
    border-radius: 10px;
    padding: 0 16px;
    font-size: 14.5px;
    color: #ffffff;
    outline: none;
    transition: all 0.25s ease;
}

.login-input::placeholder {
    color: #435b75;
}

/* Foco con resplandor cyan idéntico a Imagen 1 */
.login-input:focus {
    border-color: #00c0f0;
    background: #081a32;
    box-shadow: 
        0 0 0 3px rgba(0, 192, 240, 0.25),
        0 0 16px rgba(0, 192, 240, 0.45);
}

/* Input de contraseña con botón para ver/ocultar */
.login-input-pass {
    padding-right: 46px;
}

.login-toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #557291;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s ease;
}

.login-toggle-pass:hover {
    color: #00d2ff;
}

.login-toggle-pass svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.login-toggle-pass .icon-eye-off {
    display: none;
}

.login-toggle-pass.password-visible .icon-eye {
    display: none;
}

.login-toggle-pass.password-visible .icon-eye-off {
    display: block;
}

/* Botón Ingresar (Píldora dorada idéntica a Imagen 1) */
.btn-login-gold {
    width: 100%;
    height: 48px;
    margin-top: 24px;
    border-radius: 28px;
    background: linear-gradient(135deg, #f2ba42 0%, #daa025 50%, #c18516 100%);
    border: none;
    color: #1a1002;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(220, 155, 30, 0.38);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login-gold:hover {
    background: linear-gradient(135deg, #ffd05b 0%, #e8ad2c 50%, #d4931a 100%);
    box-shadow: 0 8px 26px rgba(235, 170, 40, 0.55);
    transform: translateY(-1px);
    color: #110a01;
}

.btn-login-gold:active {
    transform: translateY(1px);
    box-shadow: 0 3px 12px rgba(220, 155, 30, 0.4);
}

.btn-login-gold:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
}

.login-spinner {
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* --------------------------------------------------------------------------
   PIE DE TARJETA: VERSIÓN Y EMPRESA (IDÉNTICO A LA IMAGEN)
   -------------------------------------------------------------------------- */
.login-card-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-footer-pill-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.login-version-badge {
    display: inline-flex;
    align-items: center;
    background: #061528;
    border: 1px solid #14324f;
    border-radius: 9999px;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    letter-spacing: 0.4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
}

.login-version-badge:hover {
    border-color: rgba(0, 210, 255, 0.4);
    color: #e2e8f0;
}

.version-dot {
    width: 6.5px;
    height: 6.5px;
    border-radius: 50%;
    background-color: #00d2ff;
    box-shadow: 0 0 8px #00d2ff, 0 0 12px rgba(0, 210, 255, 0.7);
    margin-right: 7px;
    display: inline-block;
}

.login-company-badge {
    display: inline-flex;
    align-items: center;
    background: #061528;
    border: 1px solid #14324f;
    border-radius: 9999px;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #cbd5e1;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.company-dot {
    width: 6.5px;
    height: 6.5px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981, 0 0 12px rgba(16, 185, 129, 0.7);
    margin-right: 7px;
    display: inline-block;
}

.login-hero-empresa {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: #93c5fd;
    background: rgba(14, 34, 61, 0.6);
    border: 1px solid rgba(0, 195, 255, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* --------------------------------------------------------------------------
   RESPONSIVIDAD DETALLADA
   -------------------------------------------------------------------------- */

/* Tablets y pantallas medianas (<= 991px) */
@media (max-width: 991px) {
    .login-layout-container {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 32px;
    }

    .login-hero-section {
        flex: none;
        width: 100%;
        max-width: 480px;
        align-items: center;
        text-align: center;
        padding-left: 0;
    }

    .login-hero-logo {
        max-width: clamp(260px, 65vw, 360px);
        margin-bottom: 14px;
    }

    .login-hero-slogan {
        font-size: clamp(15px, 3.5vw, 18px);
        max-width: 400px;
    }

    .login-card-section {
        flex: none;
        width: 100%;
        max-width: 420px;
    }
}

/* Móviles estándar (<= 480px) */
@media (max-width: 480px) {
    body.login-page {
        padding: 24px 14px;
    }

    .login-layout-container {
        gap: 24px;
    }

    .login-hero-logo {
        max-width: 260px;
        margin-bottom: 12px;
    }

    .login-hero-slogan {
        font-size: 15px;
        line-height: 1.45;
    }

    .login-card {
        padding: 30px 20px 26px;
        border-radius: 18px;
    }

    .login-card-title {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .login-input {
        height: 44px;
        font-size: 14px;
    }

    .btn-login-gold {
        height: 44px;
        font-size: 15px;
        margin-top: 20px;
    }
}

/* Móviles muy compactos (<= 360px: p. ej. Galaxy Fold cerrado, iPhone SE) */
@media (max-width: 360px) {
    body.login-page {
        padding: 16px 10px;
    }

    .login-hero-logo {
        max-width: 210px;
    }

    .login-hero-slogan {
        font-size: 13.5px;
    }

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

    .login-card-title {
        font-size: 20px;
        margin-bottom: 16px;
    }

    .login-input {
        height: 42px;
        font-size: 13.5px;
        padding: 0 12px;
    }

    .login-input-pass {
        padding-right: 40px;
    }

    .btn-login-gold {
        height: 42px;
        font-size: 14px;
        margin-top: 18px;
    }
}

/* Dispositivos en modo horizontal con altura reducida (Landscape móvil <= 600px) */
@media (max-height: 600px) and (orientation: landscape) {
    body.login-page {
        padding: 16px 20px;
    }

    .login-layout-container {
        flex-direction: row;
        align-items: center;
        gap: 28px;
    }

    .login-hero-section {
        flex: 1 1 360px;
        max-width: 380px;
        text-align: left;
        align-items: flex-start;
        padding-left: 0;
    }

    .login-hero-logo {
        max-width: 250px;
        margin-bottom: 10px;
    }

    .login-hero-slogan {
        font-size: 14px;
    }

    .login-card-section {
        flex: 1 1 380px;
        max-width: 380px;
    }

    .login-card {
        padding: 24px 26px 22px;
    }

    .login-card-title {
        font-size: 20px;
        margin-bottom: 14px;
    }

    .login-form-group {
        margin-bottom: 12px;
    }

    .login-input {
        height: 40px;
    }

    .btn-login-gold {
        height: 42px;
        margin-top: 16px;
    }
}
