/* ============================================================
   LABENLINEA - LOGIN CENTRAL
   Login + selector de laboratorio
   ============================================================ */


/* ============================================================
   RESET
   ============================================================ */

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

html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;

    background:
        linear-gradient(
            135deg,
            #003366 0%,
            #001a33 100%
        );

    font-family:
        'Plus Jakarta Sans',
        sans-serif;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
}


/* ============================================================
   TEXTURA DE FONDO
   ============================================================ */

body::before {
    content: "";

    position: fixed;
    inset: 0;

    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)' opacity='0.05'/%3E%3C/svg%3E");

    pointer-events: none;
    z-index: 0;
}


/* ============================================================
   WRAPPER
   ============================================================ */

.login-wrapper {
    position: relative;
    z-index: 10;

    width: 100%;
    max-width: 480px;

    margin: 1.5rem;

    animation:
        slideUp
        0.45s
        cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

@keyframes slideUp {

    from {
        opacity: 0;
        transform: translateY(25px);
    }

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


/* ============================================================
   TARJETA PRINCIPAL
   ============================================================ */

.lab-card {
    background:
        rgba(255, 255, 255, 0.98);

    border-radius: 24px;

    border:
        1px solid
        rgba(212, 175, 55, 0.30);

    box-shadow:
        0 25px 50px -12px
        rgba(0, 0, 0, 0.35);

    overflow: hidden;
}


/* ============================================================
   BARRA SUPERIOR
   ============================================================ */

.industrial-strip {
    height: 3px;

    background:
        linear-gradient(
            90deg,
            #d4af37,
            #0069b4,
            #003366,
            #d4af37
        );

    background-size: 200% 100%;

    animation:
        stripeMove
        6s
        linear
        infinite;
}

@keyframes stripeMove {

    from {
        background-position: 0 0;
    }

    to {
        background-position: 200% 0;
    }
}


/* ============================================================
   MARCA
   ============================================================ */

.brand-section {
    padding:
        2rem
        2rem
        1.2rem;

    text-align: center;
}


/* ============================================================
   LOGO LABENLINEA
   ============================================================ */

.brand-icon {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 0.8rem;
}

.brand-icon img {
    display: block;

    width: auto;
    max-width: 220px;
    max-height: 80px;

    object-fit: contain;
}


/* ============================================================
   TÍTULO
   ============================================================ */

h1 {
    font-family:
        'JetBrains Mono',
        monospace;

    font-weight: 700;

    font-size: 1.7rem;

    color: #003366;

    margin-bottom: 0.65rem;
}


/* ============================================================
   BADGE
   ============================================================ */

.lab-badge {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    background:
        linear-gradient(
            135deg,
            #0069b4,
            #003366
        );

    padding:
        0.4rem
        1rem;

    border-radius: 40px;

    font-size: 0.68rem;

    font-weight: 600;

    color: #ffffff;

    font-family:
        'JetBrains Mono',
        monospace;
}

.lab-badge i {
    font-size: 0.75rem;
}


/* ============================================================
   DESCRIPCIÓN
   ============================================================ */

.login-description {
    max-width: 320px;

    margin:
        1rem
        auto
        0;

    color: #64748b;

    font-size: 0.85rem;

    line-height: 1.55;
}


/* ============================================================
   FORMULARIO
   ============================================================ */

.form-container {
    padding:
        0.5rem
        2rem
        1.7rem;
}


/* ============================================================
   INPUT
   ============================================================ */

.input-field {
    position: relative;

    margin-bottom: 1.2rem;
}

.field-icon {
    position: absolute;

    left: 18px;
    top: 50%;

    transform: translateY(-50%);

    color: #0069b4;

    z-index: 2;

    transition:
        color
        0.2s;
}

.input-field input {
    width: 100%;

    background: #ffffff;

    border:
        1.5px solid
        #e2e8f0;

    border-radius: 44px;

    padding:
        0.9rem
        3rem;

    font-family:
        'Plus Jakarta Sans',
        sans-serif;

    font-size: 0.9rem;

    font-weight: 500;

    color: #1a2a3a;

    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.input-field input:focus {
    outline: none;

    border-color: #0069b4;

    box-shadow:
        0 0 0 3px
        rgba(0, 105, 180, 0.10);
}

.input-field input::placeholder {
    color: #94a3b8;

    font-weight: 400;
}

.input-field.focused .field-icon {
    color: #003366;
}


/* ============================================================
   MOSTRAR / OCULTAR CONTRASEÑA
   ============================================================ */

.toggle-pass {
    position: absolute;

    right: 18px;
    top: 50%;

    transform: translateY(-50%);

    border: none;

    background: none;

    color: #64748b;

    cursor: pointer;

    padding: 5px;

    font-size: 1rem;
}

.toggle-pass:hover {
    color: #0069b4;
}


/* ============================================================
   ERRORES
   ============================================================ */

.error-message {
    background: #fee2e2;

    border-left:
        3px solid
        #dc2626;

    padding:
        0.75rem
        1rem;

    border-radius: 12px;

    margin-bottom: 1.25rem;

    color: #991b1b;

    font-size: 0.82rem;

    font-weight: 500;

    display: flex;

    align-items: center;

    gap: 9px;
}

.error-message i {
    color: #dc2626;
}

.field-error {
    color: #b91c1c;

    font-size: 0.72rem;

    margin:
        -0.8rem
        1rem
        1rem;
}


/* ============================================================
   BOTÓN LOGIN
   ============================================================ */

.login-btn {
    width: 100%;

    border: none;

    border-radius: 44px;

    padding: 0.9rem;

    margin-top: 0.35rem;

    background:
        linear-gradient(
            135deg,
            #0069b4,
            #003366
        );

    color: #ffffff;

    font-family:
        'JetBrains Mono',
        monospace;

    font-size: 0.82rem;

    font-weight: 700;

    letter-spacing: 1px;

    cursor: pointer;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 12px;

    box-shadow:
        0 4px 12px
        rgba(0, 105, 180, 0.25);

    transition:
        transform 0.2s,
        box-shadow 0.2s,
        opacity 0.2s;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-1px);

    box-shadow:
        0 8px 20px -6px
        rgba(0, 105, 180, 0.4);
}

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

.login-btn:disabled {
    cursor: wait;
    opacity: 0.85;
}


/* ============================================================
   FOOTER DE TARJETA
   ============================================================ */

.footer-simple {
    padding:
        1rem
        1.5rem;

    border-top:
        1px solid
        #e2e8f0;

    background: #f8fafc;

    text-align: center;

    color: #64748b;

    font-family:
        'JetBrains Mono',
        monospace;

    font-size: 0.68rem;

    display: flex;

    justify-content: center;
    align-items: center;

    gap: 7px;
}

.footer-simple i {
    color: #d4af37;
}


/* ============================================================
   VERSIÓN / TEXTO EXTERIOR
   ============================================================ */

.version-info {
    width: fit-content;

    margin:
        1rem
        auto
        0;

    padding:
        0.5rem
        1rem;

    border-radius: 20px;

    background:
        rgba(0, 51, 102, 0.4);

    backdrop-filter:
        blur(4px);

    color:
        rgba(255, 255, 255, 0.55);

    font-family:
        'JetBrains Mono',
        monospace;

    font-size: 0.58rem;

    letter-spacing: 0.5px;

    text-align: center;
}


/* ============================================================
   SELECTOR DE LABORATORIOS
   ============================================================ */

.tenant-container {
    padding:
        0.3rem
        2rem
        1.8rem;
}

.tenant-form {
    margin-bottom: 0.8rem;
}

.tenant-form:last-child {
    margin-bottom: 0;
}


/* ============================================================
   OPCIÓN DE LABORATORIO
   ============================================================ */

.tenant-option {
    width: 100%;

    min-height: 72px;

    padding:
        0.75rem
        1rem;

    border:
        1.5px solid
        #e2e8f0;

    border-radius: 16px;

    background: #ffffff;

    cursor: pointer;

    display: flex;

    align-items: center;

    gap: 14px;

    text-align: left;

    font-family:
        'Plus Jakarta Sans',
        sans-serif;

    transition:
        border-color 0.2s,
        transform 0.2s,
        box-shadow 0.2s;
}

.tenant-option:hover {
    border-color: #0069b4;

    transform: translateY(-1px);

    box-shadow:
        0 7px 18px
        rgba(0, 105, 180, 0.10);
}


/* ============================================================
   ICONO DEL LABORATORIO
   ============================================================ */

.tenant-icon {
    width: 44px;
    height: 44px;

    flex:
        0 0
        44px;

    border-radius: 13px;

    display: flex;

    align-items: center;
    justify-content: center;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #0069b4,
            #003366
        );

    font-size: 1rem;
}


/* ============================================================
   DATOS DEL LABORATORIO
   ============================================================ */

.tenant-data {
    min-width: 0;

    flex: 1;

    display: flex;

    flex-direction: column;

    gap: 3px;
}

.tenant-data strong {
    color: #003366;

    font-size: 0.9rem;

    font-weight: 700;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}

.tenant-data small {
    color: #64748b;

    font-size: 0.72rem;
}


/* ============================================================
   FLECHA DEL LABORATORIO
   ============================================================ */

.tenant-arrow {
    color: #94a3b8;

    font-size: 0.8rem;

    transition:
        transform 0.2s,
        color 0.2s;
}

.tenant-option:hover .tenant-arrow {
    color: #0069b4;

    transform: translateX(3px);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 560px) {

    .login-wrapper {
        margin: 1rem;
    }

    .brand-section {
        padding:
            1.5rem
            1.5rem
            1rem;
    }

    .brand-icon img {
        max-width: 180px;
        max-height: 65px;
    }

    .form-container {
        padding:
            0.5rem
            1.5rem
            1.4rem;
    }

    .tenant-container {
        padding:
            0.3rem
            1.5rem
            1.5rem;
    }

    h1 {
        font-size: 1.45rem;
    }

    .lab-badge {
        font-size: 0.60rem;

        padding:
            0.35rem
            0.8rem;
    }

    .login-description {
        font-size: 0.8rem;
    }

    .tenant-option {
        min-height: 68px;
    }

    .tenant-icon {
        width: 40px;
        height: 40px;

        flex-basis: 40px;
    }

    .version-info {
        font-size: 0.55rem;
    }
}


/* ============================================================
   ACCESIBILIDAD
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    * {
        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;

        transition-duration:
            0.01ms !important;
    }
}

input:focus-visible,
button:focus-visible {
    outline:
        2px solid
        #d4af37;

    outline-offset: 2px;
}