/* FACE-LOGIN 1.0.0 (package C): the face sign-in of the login page, shown as the second slide in place of the fields (no dots).
   Only the shared semantic theme variables of dark.css (--f3-theme-*, --f3-tech-*); the accent is the theme accent,
   not identity-green. No mesh, HUD chips, laboratory states or Face Identity mark.
   The slides box exists only after faceLogin.js was told "offered" by the server; until then nothing here applies. */

.face-login {
    margin-top: 4px;
    text-align: center;
    color: var(--f3-theme-table-ink, #e8eef5);
}

.face-login[hidden],
.face-login [hidden],
.face-login-slides [hidden] {
    display: none !important;
}

/* ---- slides: the fields (slide 1) and the camera (slide 2) share one grid cell, so the page keeps the larger height */
.face-login-slides {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    box-sizing: content-box;
    overflow: hidden;
    /* room for the focus glow of the inputs inside the clipping box, without changing the layout */
    margin: -4px -6px;
    padding: 4px 6px;
    touch-action: pan-y;
    -webkit-transition: height 260ms ease;
    transition: height 260ms ease;
}

.face-login-slide {
    grid-area: 1 / 1;
    min-width: 0;
    align-self: start;
    -webkit-transition: -webkit-transform 260ms ease, opacity 260ms ease, visibility 0s linear 260ms;
    transition: transform 260ms ease, opacity 260ms ease, visibility 0s linear 260ms;
}

.face-login-slide-camera {
    text-align: center;
    color: var(--f3-theme-table-ink, #e8eef5);
    -webkit-transform: translateX(100%);
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
}

.face-login-slides.face-login-camera .face-login-slide-fields {
    -webkit-transform: translateX(-100%);
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
}

.face-login-slides.face-login-camera .face-login-slide-camera {
    -webkit-transform: none;
    transform: none;
    opacity: 1;
    visibility: visible;
    -webkit-transition-delay: 0s, 0s, 0s;
    transition-delay: 0s, 0s, 0s;
}

html[dir="rtl"] .face-login-slide-camera {
    -webkit-transform: translateX(-100%);
    transform: translateX(-100%);
}

html[dir="rtl"] .face-login-slides.face-login-camera .face-login-slide-fields {
    -webkit-transform: translateX(100%);
    transform: translateX(100%);
}

html[dir="rtl"] .face-login-slides.face-login-camera .face-login-slide-camera {
    -webkit-transform: none;
    transform: none;
}

/* the offer ended for this page (error, three misses): only the fields stay */
.face-login-slides.face-login-off .face-login-slide-camera {
    display: none;
}

/* ---- buttons, camera, texts (the panel lives inside the slides box, no longer inside .face-login) */
.face-login-slides .face-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 8px 16px;
    font-size: 14px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    cursor: pointer;
}

.face-login-slides .face-login-btn:focus-visible,
.face-login-slides .face-login-video:focus-visible {
    outline: 2px solid var(--f3-tech-accent, #23bfd2);
    outline-offset: 2px;
}

.face-login-slides .face-login-btn.face-login-primary {
    background: var(--f3-tech-accent, #23bfd2);
    border: 1px solid var(--f3-tech-accent, #23bfd2);
    color: var(--f3-tech-accent-ink, #06111d);
    font-weight: 600;
}

.face-login-slides .face-login-btn.face-login-primary:hover {
    background: var(--f3-tech-accent-hover, #35d8e8);
    border-color: var(--f3-tech-accent-hover, #35d8e8);
}

.face-login-slides .face-login-btn.face-login-secondary {
    background: transparent;
    border: 1px solid var(--f3-theme-border-strong, #424c56);
    color: var(--f3-theme-table-ink, #e8eef5);
}

.face-login-slides .face-login-btn.face-login-secondary:hover {
    background: var(--f3-theme-hover-surface, #2c323a);
}

/* the panel only receives programmatic focus (tabindex -1) so the arrow keys keep working: no ring around the whole card */
.face-login-slides .face-login-panel:focus {
    outline: 0;
}

.face-login-slides .face-login-panel {
    box-sizing: border-box;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    padding: 12px;
    background: var(--f3-theme-panel-surface, #23272e);
    border: 1px solid var(--f3-theme-border, #343b43);
    color: var(--f3-theme-table-ink, #e8eef5);
}

/* the camera surface: 4:3, rounded (the global * rule squares every corner, hence !important) */
.face-login-slides .face-login-stage {
    position: relative;
    width: 100%;
    padding-top: 75%;
    overflow: hidden;
    background: var(--f3-theme-deep-surface, #1a1d22);
    border: 1px solid var(--f3-theme-border-strong, #424c56);
    border-radius: 14px !important;
}

.face-login-slides .face-login-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* the mirror is presentation only: the frames sent to the server are raw */
    -webkit-transform: scaleX(-1);
    transform: scaleX(-1);
    background: transparent;
}

/* one to three short words, lightly translucent, never over the middle of the face */
.face-login-slides .face-login-hud {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 6px 10px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--f3-theme-table-ink, #e8eef5);
    background: rgba(24, 26, 30, .62);
    border-radius: 8px !important;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.face-login-slides .face-login-confirm {
    padding: 12px 0 4px;
}

.face-login-slides .face-login-ask {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--f3-theme-table-ink, #e8eef5);
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.face-login-slides .face-login-countdown {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--f3-theme-muted, #a8b2bd);
}

.face-login .face-login-message,
.face-login-slides .face-login-message {
    margin: 10px 0 0;
    font-size: 14px;
    line-height: 1.35;
    color: var(--f3-theme-muted, #a8b2bd);
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.face-login-slides .face-login-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

/* the answer buttons stay stacked: the slide is only as wide as the login column */

@media (max-width: 389px) {
    .face-login-slides .face-login-panel {
        padding: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .face-login,
    .face-login *,
    .face-login-slides,
    .face-login-slides * {
        -webkit-transition: none !important;
        transition: none !important;
        -webkit-animation: none !important;
        animation: none !important;
    }
}
