/* ══════════════════════════════════════════════════════════════════
   login-perfiles.css — Pantalla de PERFILES (estilo Netflix), dentro de la red del negocio.
   Un cuadro grande por persona con su imagen; al tocarlo, rostro o PIN.
   Va DESPUÉS de login.css y usa sus mismos tokens y su lienzo claro: sin adornos, el acabado
   está en la imagen, la tipografía y el espacio. Pensado para el iPad: cuadros ≥ 118px,
   blancos táctiles generosos, sin hover obligatorio.
   ══════════════════════════════════════════════════════════════════ */

.auth-shell-perfiles {
    align-items: flex-start;
}

.auth-shell-perfiles .perfiles-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1040px;
    margin: auto;                       /* centra en vertical cuando sobra alto, y deja scrollear cuando falta */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vp {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vp[hidden] { display: none; }

.perfiles-logo {
    display: block;
    width: auto;
    height: clamp(72px, 13vh, 124px);
    height: clamp(72px, 13dvh, 124px);
    object-fit: contain;
    filter: drop-shadow(0 8px 14px rgba(15, 23, 42, 0.11));
    margin-bottom: 0.5rem;
    animation: authFade 600ms ease 100ms both;
}

.perfiles-titulo {
    font-family: var(--display);
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.034em;
    color: var(--t1);
    margin: 0.35rem 0 0.2rem;
    text-align: center;
}

.perfiles-sub {
    font-size: 1.02rem;
    color: var(--t3);
    margin: 0 0 clamp(1.3rem, 4.5vh, 2.6rem);
    text-align: center;
}

.perfiles-aviso {
    max-width: 520px;
    margin: 0 auto 1.4rem;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.perfiles-grid {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(1.1rem, 2.6vw, 2rem) clamp(1rem, 2.4vw, 1.9rem);
}

.perfil-cuadro {
    width: clamp(124px, 17vw, 176px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.perfil-imagen {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 27%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--av1, #e8eefc), var(--av2, #d3defa));
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.05),
        0 1px 2px rgba(15, 23, 42, 0.06),
        0 16px 30px -16px rgba(15, 23, 42, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.perfil-imagen img {
    width: 76%;
    height: 76%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 7px 9px rgba(15, 23, 42, 0.2));
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

.perfil-cuadro:active .perfil-imagen {
    transform: scale(0.965);
}

.perfil-cuadro:focus-visible {
    outline: none;
}

.perfil-cuadro:focus-visible .perfil-imagen {
    box-shadow:
        0 0 0 4px #ffffff,
        0 0 0 7px var(--accent),
        0 16px 30px -16px rgba(15, 23, 42, 0.30);
}

@media (hover: hover) {
    .perfil-cuadro:hover .perfil-imagen {
        transform: translateY(-4px) scale(1.04);
        box-shadow:
            0 0 0 4px #ffffff,
            0 0 0 7px rgba(10, 132, 255, 0.85),
            0 22px 36px -16px rgba(15, 23, 42, 0.38);
    }
}

.perfil-nombre {
    max-width: 100%;
    font-size: 1.08rem;
    font-weight: 600;
    letter-spacing: -0.012em;
    color: var(--t1);
    text-align: center;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.perfil-pista {
    margin-top: -0.5rem;
    font-size: 0.78rem;
    color: var(--t4);
}

/* Insignia de cámara: avisa que este cuadro entra con el rostro (para que no sorprenda que se abra la cámara). */
.perfil-rostro {
    position: absolute;
    right: 6%;
    bottom: 6%;
    width: 27%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    color: var(--accent);
    font-size: clamp(0.85rem, 1.6vw, 1.1rem);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.07), 0 2px 6px rgba(15, 23, 42, 0.15);
}

.perfiles-alt {
    margin-top: clamp(1.6rem, 5vh, 3rem);
    padding: 0.7rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--t3);
    border-radius: 12px;
    text-decoration: none;
    touch-action: manipulation;
}

.perfiles-alt:hover,
.perfiles-alt:focus-visible {
    color: var(--accent);
    background: rgba(10, 132, 255, 0.07);
}

.perfiles-pie {
    margin-top: 1.6rem;
    display: flex;
    gap: 1.2rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--t4);
}

/* ── Ingreso de la persona elegida (tarjeta) ─────────────────────────── */

.ingreso-card {
    max-width: 440px;
    margin: 0 auto;
    padding-top: 1.1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.ingreso-volver {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    align-self: flex-start;
    margin: 0 0 0.4rem -0.4rem;
    padding: 0.55rem 0.8rem;
    border: 0;
    border-radius: 12px;
    background: none;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--t3);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.ingreso-volver:hover,
.ingreso-volver:focus-visible {
    color: var(--accent);
    background: rgba(10, 132, 255, 0.07);
}

.ingreso-quien {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.4rem;
}

.perfil-imagen-lg {
    width: clamp(88px, 14dvh, 116px);
    margin-bottom: 0.75rem;
}

.ingreso-nombre {
    font-family: var(--display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--t1);
    margin: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.ingreso-ayuda {
    min-height: 1.4em;
    margin: 0.25rem 0 0.9rem;
    font-size: 0.95rem;
    color: var(--t3);
}

.ingreso-paso {
    width: 100%;
}

.ingreso-paso[hidden] { display: none; }

.ingreso-enlace {
    display: block;
    margin: 0.9rem auto 0;
    padding: 0.65rem 1rem;
    border: 0;
    border-radius: 12px;
    background: none;
    font: inherit;
    font-size: 0.93rem;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.ingreso-enlace[hidden] { display: none; }

.ingreso-enlace:hover,
.ingreso-enlace:focus-visible {
    background: rgba(10, 132, 255, 0.07);
}

.ingreso-error {
    margin: -0.2rem 0 0.8rem;
    text-align: left;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--danger, #d70015);
}

.ingreso-error[hidden] { display: none; }

.ingreso-card .form-group {
    text-align: left;
}

@media (pointer: coarse) {
    .perfil-nombre { font-size: 1.12rem; }
}

/* iPad horizontal y pantallas bajas: el alto es lo escaso */
@media (min-width: 700px) and (max-height: 860px) {
    .perfiles-logo { height: clamp(60px, 11vh, 96px); height: clamp(60px, 11dvh, 96px); margin-bottom: 0.25rem; }
    .perfiles-sub { margin-bottom: 1.2rem; }
    .perfiles-grid { gap: 1rem 1.5rem; }
    .perfil-cuadro { width: clamp(118px, 14vw, 150px); }
    .perfiles-alt { margin-top: 1.1rem; }
    .perfiles-pie { margin-top: 0.8rem; }
    .ingreso-nombre { font-size: 1.3rem; }
    .ingreso-ayuda { margin-bottom: 0.4rem; }

    /* La tarjeta de ingreso se parte en dos: a la izquierda quién entra, a la derecha el teclado (o el rostro, o la contraseña).
       Así el teclado puede ser GRANDE aunque el alto sea poco (iPad horizontal con las barras de Safari deja ~690 px). */
    .ingreso-card {
        max-width: 780px;
        padding: 0.7rem 2rem 1.1rem;
        display: grid;
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
        grid-template-areas: "volver volver" "quien paso";
        align-items: center;
        column-gap: 1.5rem;
    }
    .ingreso-volver { grid-area: volver; }
    .ingreso-quien { grid-area: quien; margin-bottom: 0; }
    .ingreso-paso { grid-area: paso; }
    .perfil-imagen-lg { width: clamp(110px, 18dvh, 150px); margin-bottom: 0.7rem; }
}

@media (max-width: 480px) {
    .auth-shell-perfiles .perfiles-wrap { margin-top: 0.5rem; }
    .perfil-cuadro { width: calc(50% - 0.8rem); max-width: 168px; }
    .ingreso-card { padding: 1rem 1.1rem 1.2rem; }
}

/* Teléfono: la tarjeta de ingreso compacta su cabecera para que el teclado grande entre completo */
@media (max-width: 699px) {
    .ingreso-card { padding-top: 0.4rem; padding-bottom: 0.9rem; }
    .ingreso-volver { margin-bottom: 0; padding: 0.4rem 0.7rem; }
    .perfil-imagen-lg { width: 68px; margin-bottom: 0.3rem; }
    .ingreso-nombre { font-size: 1.25rem; }
    .ingreso-ayuda { margin: 0.1rem 0 0.15rem; }
    .ingreso-enlace { margin-top: 0.3rem; padding: 0.5rem 0.9rem; }
}

@media (max-height: 700px) and (max-width: 699px) {
    .perfil-imagen-lg { width: 56px; }
    .ingreso-nombre { font-size: 1.15rem; }
}

/* iPhone SE con las barras de Safari (~555 px): sin la imagen, solo el nombre, para que el teclado grande entre completo */
@media (max-height: 600px) and (max-width: 699px) {
    .ingreso-card .perfil-imagen-lg { display: none; }
}

/* Enlaces secundarios del paso del PIN («Usar mi rostro» · «Usar mi contraseña»): en una sola fila, para no gastar alto. */
.ingreso-enlaces {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 0.5rem;
    margin-top: 0.6rem;
}

.ingreso-enlaces .ingreso-enlace { margin: 0; }

@media (prefers-reduced-motion: reduce) {
    .perfiles-logo { animation: none; }
    .perfil-imagen { transition: none; }
}

/* La inicial que se muestra mientras la persona no haya elegido imagen (no hay imagen «por defecto»). Tamaño relativo al círculo/cuadro. */
.perfil-imagen { container-type: inline-size; }
.perfil-imagen img[hidden],
.perfil-imagen .av-iniciales[hidden] { display: none !important; }
.perfil-imagen .av-iniciales {
    display: block;
    font-weight: 700;
    font-size: 3.2rem;
    font-size: 42cqw;
    line-height: 1;
    color: #5d6b8a;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}
