.face-modal[hidden] { display: none; }
.face-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(10, 22, 45, .72);
    backdrop-filter: blur(8px);
}
.face-dialog {
    width: min(720px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(8, 20, 42, .34);
}
.face-dialog__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid #e5eaf1;
}
.face-dialog__head h2 {
    margin: 0;
    color: #102851;
    font-size: 23px;
    letter-spacing: 0;
}
.face-dialog__head p {
    margin: 5px 0 0;
    color: #71809a;
    font-size: 14px;
}
.face-dialog__close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid #d7e1ef;
    border-radius: 8px;
    background: #f5f8fc;
    color: #102851;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}
.face-stage-wrap { padding: 20px 24px 10px; }
.face-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    background: #0c1730;
}
.face-stage video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}
.face-stage::after {
    content: "";
    position: absolute;
    inset: 12% 25%;
    border: 2px solid rgba(255,255,255,.54);
    border-radius: 50%;
    box-shadow: 0 0 0 999px rgba(4, 14, 34, .13);
    pointer-events: none;
}
.face-target {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    width: 74px;
    height: 74px;
    border: 4px solid #dff54a;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 8px rgba(223,245,74,.16), 0 4px 18px rgba(0,0,0,.22);
    transition: left .7s cubic-bezier(.4,0,.2,1), top .7s cubic-bezier(.4,0,.2,1), width .45s, height .45s;
    animation: faceTargetPulse 1.25s ease-in-out infinite;
    pointer-events: none;
}
.face-target.is-near { width: 126px; height: 126px; }
.face-modal.is-quick .face-target {
    width: 112px;
    height: 142px;
    border-width: 3px;
    animation-duration: 1.8s;
}
@keyframes faceTargetPulse {
    0%, 100% { box-shadow: 0 0 0 7px rgba(223,245,74,.14), 0 4px 18px rgba(0,0,0,.22); }
    50% { box-shadow: 0 0 0 15px rgba(223,245,74,.05), 0 4px 18px rgba(0,0,0,.22); }
}
.face-step {
    min-height: 46px;
    padding: 15px 24px 5px;
    color: #102851;
    font-size: 17px;
    font-weight: 800;
    text-align: center;
}
.face-progress {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    padding: 12px 24px;
}
.face-progress span {
    height: 5px;
    border-radius: 3px;
    background: #dfe7f2;
    transition: background .2s;
}
.face-progress span.is-done { background: #1f73e8; }
.face-message {
    min-height: 46px;
    margin: 0 24px 12px;
    padding: 12px 14px;
    border: 1px solid #dce6f4;
    border-radius: 8px;
    color: #53647e;
    background: #f6f9fd;
    font-size: 14px;
    font-weight: 700;
}
.face-message.is-error {
    border-color: #fecaca;
    color: #b42318;
    background: #fff1f0;
}
.face-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 24px 22px;
}
.face-dialog__actions button {
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid #d4dfed;
    border-radius: 8px;
    color: #102851;
    background: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.face-dialog__actions .face-retry {
    border-color: #1f73e8;
    color: #fff;
    background: #1f73e8;
}
.face-dialog__actions button:disabled { opacity: .55; cursor: wait; }
@media (max-width: 620px) {
    .face-modal { padding: 0; }
    .face-dialog { width: 100%; max-height: 100vh; min-height: 100vh; border: 0; border-radius: 0; }
    .face-dialog__head, .face-stage-wrap { padding-left: 16px; padding-right: 16px; }
    .face-step, .face-progress { padding-left: 16px; padding-right: 16px; }
    .face-message { margin-left: 16px; margin-right: 16px; }
    .face-stage { margin-top: 7vh; }
}
