/* ============================================================================
   3PAY.SHOP (?v=210_4_5a) — APPLE-STANDARD MULTI-ANGLE VOICE 3D FACEID SCANNER
   0 inline styles, 0 duplicate selectors, Dark + Light theme, 360px+ responsive.
   ============================================================================ */

.fid-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2600;
    background: rgba(2, 6, 18, 0.86);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    overflow-y: auto;
}

.fid-modal-card {
    width: 100%;
    max-width: 680px;
    border-radius: 22px;
    background: var(--bg-modal-panel, #0b1220);
    border: 1px solid rgba(56, 189, 248, 0.36);
    box-shadow: 0 26px 64px rgba(0, 0, 0, 0.72);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: var(--text-primary, #f1f5f9);
}

html[data-theme="light"] .fid-modal-card {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.22);
}

.fid-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.fid-kicker {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    color: #38bdf8;
    margin-bottom: 3px;
}

html[data-theme="light"] .fid-kicker {
    color: #0284c7;
}

.fid-modal-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1.25;
}

.fid-head-copy {
    min-width: 0;
}

.fid-head-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.fid-voice-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.42);
    background: rgba(14, 165, 233, 0.14);
    color: var(--text-primary, #f1f5f9);
    font-size: 0.96rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.16s ease, background-color 0.16s ease, opacity 0.16s ease;
}

.fid-voice-btn:hover {
    border-color: #38bdf8;
}

.fid-voice-btn.is-muted {
    opacity: 0.62;
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.12);
}

html[data-theme="light"] .fid-voice-btn {
    color: #0f172a;
    background: #e0f2fe;
    border-color: #7dd3fc;
}

.fid-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.28));
    background: var(--bg-elevated, rgba(18, 27, 45, 0.85));
    color: var(--text-primary, #f1f5f9);
    font-size: 0.92rem;
    font-weight: 900;
    cursor: pointer;
    flex-shrink: 0;
}

.fid-close-btn:hover {
    border-color: #38bdf8;
}

.fid-mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 5px;
    border-radius: 14px;
    background: var(--bg-elevated, rgba(18, 27, 45, 0.85));
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.22));
}

.fid-mode-tab {
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary, #94a3b8);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    line-height: 1.3;
    transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.fid-mode-tab.is-active {
    background: linear-gradient(135deg, #0052ff, #0ea5e9);
    color: #ffffff;
}

.fid-consent-box {
    padding: 11px 13px;
    border-radius: 13px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.28);
}

html[data-theme="light"] .fid-consent-box {
    background: #f0f9ff;
    border-color: #bae6fd;
}

.fid-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 0.77rem;
    line-height: 1.42;
    cursor: pointer;
}

.fid-consent-label input[type="checkbox"] {
    margin-top: 3px;
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    accent-color: #0ea5e9;
}

.fid-pane {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Приховування вкладки та кнопки QR на смартфонах із робочою камерою (показується лише як fallback при збої камери) */
.fid-modal-overlay.is-mobile-device .fid-desktop-qr-control {
    display: none;
}

.fid-modal-overlay.is-mobile-device.is-camera-fallback #fid-switch-qr-btn {
    display: inline-flex;
}

/* Сцена Apple-Standard 3D FaceID (100% керування через CSS-класи та SVG-атрибути, 0 .style.*) */
.fid-stage {
    position: relative;
    border-radius: 18px;
    padding: 20px 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: radial-gradient(circle at 50% 35%, #0f1b33 0%, #070d18 82%);
    border: 2px solid rgba(56, 189, 248, 0.36);
    transition: background-color 0.24s ease, border-color 0.2s ease, box-shadow 0.24s ease;
}

html[data-theme="light"] .fid-stage {
    background: radial-gradient(circle at 50% 35%, #f1f5f9 0%, #e2e8f0 88%);
    border-color: #94a3b8;
}

/* Розумний білий екранний софтбокс (точка 5 enroll або темне приміщення verify) */
.fid-stage.faceid-softbox-white,
html[data-theme="light"] .fid-stage.faceid-softbox-white {
    background: #ffffff;
    border-color: #e0f2fe;
    box-shadow: inset 0 0 60px rgba(255, 255, 255, 0.96), 0 0 42px rgba(255, 255, 255, 0.72);
}

/* МОДУЛЬ 6 (?v=210_6c_5a): 4 затверджені кольори 2-сек світлової анти-діпфейк перевірки після 16/16 (0 .style.*) */
.fid-stage.fid-chroma-yellow,
html[data-theme="light"] .fid-stage.fid-chroma-yellow {
    background: #FFD60A;
    border-color: #FFD60A;
    box-shadow: inset 0 0 90px rgba(255, 214, 10, 0.96), 0 0 54px rgba(255, 214, 10, 0.85);
}

.fid-stage.fid-chroma-pink,
html[data-theme="light"] .fid-stage.fid-chroma-pink {
    background: #FF2D78;
    border-color: #FF2D78;
    box-shadow: inset 0 0 90px rgba(255, 45, 120, 0.96), 0 0 54px rgba(255, 45, 120, 0.85);
}

.fid-stage.fid-chroma-green,
html[data-theme="light"] .fid-stage.fid-chroma-green {
    background: #00E676;
    border-color: #00E676;
    box-shadow: inset 0 0 90px rgba(0, 230, 118, 0.96), 0 0 54px rgba(0, 230, 118, 0.85);
}

.fid-stage.fid-chroma-cyan,
html[data-theme="light"] .fid-stage.fid-chroma-cyan {
    background: #00E5FF;
    border-color: #00E5FF;
    box-shadow: inset 0 0 90px rgba(0, 229, 255, 0.96), 0 0 54px rgba(0, 229, 255, 0.85);
}

.fid-stage.is-fullscreen-scan {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 3200;
    border-radius: 0;
    border-width: 0;
    padding: 20px 14px;
    justify-content: center;
}

.fid-stage.is-light-flash-active,
html[data-theme="light"] .fid-stage.is-light-flash-active {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 9999;
    padding: 12px;
    justify-content: center;
    align-items: center;
}

.fid-stage.is-light-flash-active .fid-stage-hud,
.fid-stage.is-light-flash-active .fid-coach-banner,
.fid-stage.is-light-flash-active .fid-mode-pill,
.fid-stage.is-light-flash-active .fid-dots-row,
.fid-stage.is-light-flash-active .fid-third-party-banner {
    display: none;
}

.fid-stage.is-light-flash-active .fid-oval-wrap {
    width: 168px;
    height: 168px;
}

.fid-stage.is-light-flash-active .fid-oval-viewport {
    width: 146px;
    height: 146px;
}

.fid-third-party-banner {
    width: 100%;
    max-width: 520px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 23, 68, 0.95);
    border: 1.5px solid #ffb3c1;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 900;
    text-align: center;
    line-height: 1.38;
    box-shadow: 0 8px 24px rgba(255, 23, 68, 0.48);
    animation: fidWarnPulse 0.9s ease-in-out infinite;
}

/* МОДУЛЬ 5 (?v=210_6c_5a): Живий ІІ-Суфлер Маленький Олежка */
.fid-coach-banner {
    width: 100%;
    max-width: 520px;
    padding: 9px 13px;
    border-radius: 13px;
    background: rgba(14, 165, 233, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.52);
    color: #f0f9ff;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.8rem;
    line-height: 1.4;
    text-align: left;
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.24);
}

html[data-theme="light"] .fid-coach-banner {
    background: rgba(15, 23, 42, 0.88);
    border-color: #38bdf8;
    color: #f8fafc;
}

.fid-coach-badge {
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.fid-coach-text {
    min-width: 0;
    font-weight: 700;
    word-break: break-word;
}

@keyframes fidWarnPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

.fid-oval-wrap {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fid-apple-ring-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.fid-ring-track {
    fill: none;
    stroke: rgba(148, 163, 184, 0.22);
    stroke-width: 4;
}

.fid-ring-progress {
    fill: none;
    stroke: #38bdf8;
    stroke-width: 3.5;
    stroke-linecap: round;
    transform-origin: 140px 140px;
    transform: rotate(-90deg);
    transition: stroke-dashoffset 0.28s ease, stroke 0.22s ease;
}

.fid-ring-progress.is-passed {
    stroke: #10b981;
}

.fid-ring-progress.is-failed {
    stroke: #ef4444;
}

.fid-ring-tick {
    stroke: rgba(148, 163, 184, 0.34);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke 0.18s ease, stroke-width 0.18s ease;
}

.fid-ring-tick.is-done {
    stroke: #10b981;
    stroke-width: 5;
}

.fid-ring-tick.is-active {
    stroke: #38bdf8;
    stroke-width: 5.5;
}

.fid-ring-tick.is-failed {
    stroke: #ef4444;
    stroke-width: 5.5;
}

.fid-ring-seg-arc {
    fill: none;
    stroke: rgba(148, 163, 184, 0.22);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke 0.18s ease, stroke-width 0.18s ease, filter 0.18s ease;
}

.fid-ring-seg-arc.is-done {
    stroke: #10b981;
    stroke-width: 9;
    filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.65));
}

.fid-ring-seg-arc.is-active {
    stroke: #38bdf8;
    stroke-width: 9.5;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.72));
}

.fid-ring-seg-arc.is-failed {
    stroke: #ef4444;
    stroke-width: 9.5;
}

/* Навігаційні стрілки Apple-Standard по 4 сторонах кола */
.fid-dir-arrow {
    position: absolute;
    z-index: 6;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 900;
    background: rgba(14, 165, 233, 0.94);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.55);
    opacity: 0;
    transform: scale(0.75);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.fid-dir-arrow.is-left {
    left: -12px;
    top: 50%;
    margin-top: -15px;
}

.fid-dir-arrow.is-right {
    right: -12px;
    top: 50%;
    margin-top: -15px;
}

.fid-dir-arrow.is-up {
    top: -12px;
    left: 50%;
    margin-left: -15px;
}

.fid-dir-arrow.is-down {
    bottom: -12px;
    left: 50%;
    margin-left: -15px;
}

.fid-oval-wrap[data-dir="left"] .fid-dir-arrow.is-left,
.fid-oval-wrap[data-dir="right"] .fid-dir-arrow.is-right,
.fid-oval-wrap[data-dir="up"] .fid-dir-arrow.is-up,
.fid-oval-wrap[data-dir="down"] .fid-dir-arrow.is-down,
.fid-oval-wrap[data-dir="nod"] .fid-dir-arrow.is-nod {
    opacity: 1;
    transform: scale(1);
    animation: fidArrowPulse 1.05s ease-in-out infinite;
}

@keyframes fidArrowPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.18);
    }
}

.fid-oval-viewport {
    position: relative;
    width: 232px;
    height: 232px;
    border-radius: 50%;
    overflow: hidden;
    background: radial-gradient(circle at 50% 42%, #13213c 0%, #060c18 82%);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22), 0 14px 36px rgba(0, 0, 0, 0.45);
    z-index: 2;
}

.fid-overlay-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

.fid-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    display: block;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.fid-oval-viewport.is-camera-live .fid-video {
    opacity: 1;
}

/* Векторний силует голови і плечей у стані очікування/помилки (0 чорної пустоти!) */
.fid-oval-silhouette {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 18px 16px 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 2;
}

.fid-oval-viewport.is-camera-live .fid-oval-silhouette {
    opacity: 0;
}

.fid-silhouette-svg {
    width: 82%;
    height: 86%;
    fill: rgba(56, 189, 248, 0.14);
    stroke: rgba(56, 189, 248, 0.62);
    stroke-width: 2.6;
    stroke-dasharray: 6 5;
    stroke-linecap: round;
    transition: stroke 0.2s ease, fill 0.2s ease;
}

.fid-oval-silhouette.is-error .fid-silhouette-svg {
    fill: rgba(239, 68, 68, 0.14);
    stroke: rgba(248, 113, 113, 0.85);
}

.fid-oval-silhouette.is-ok .fid-silhouette-svg {
    fill: rgba(16, 185, 129, 0.16);
    stroke: rgba(52, 211, 153, 0.9);
}

.fid-oval-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2.5px dashed rgba(56, 189, 248, 0.58);
    pointer-events: none;
    z-index: 5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fid-oval-ring.is-scanning {
    border-style: solid;
    border-color: rgba(56, 189, 248, 0.92);
    box-shadow: inset 0 0 22px rgba(56, 189, 248, 0.28);
}

.fid-oval-ring.is-ok {
    border-style: solid;
    border-color: #10b981;
    box-shadow: inset 0 0 24px rgba(16, 185, 129, 0.32);
}

.fid-oval-ring.is-err {
    border-style: solid;
    border-color: #ef4444;
    box-shadow: inset 0 0 24px rgba(239, 68, 68, 0.28);
}

/* Єдиний уніфікований блок статусу без дублювання червоних банерів */
.fid-stage-hud {
    width: 100%;
    max-width: 520px;
    padding: 12px 15px;
    border-radius: 14px;
    background: rgba(7, 13, 28, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.28);
    color: #f8fafc;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.fid-stage-hud.is-ok {
    background: rgba(6, 52, 38, 0.92);
    border-color: rgba(16, 185, 129, 0.72);
}

.fid-stage-hud.is-err {
    background: rgba(69, 14, 22, 0.92);
    border-color: rgba(239, 68, 68, 0.78);
}

.fid-hud-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.fid-mode-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: rgba(56, 189, 248, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #7dd3fc;
}

.fid-mode-pill.is-done {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(52, 211, 153, 0.68);
    color: #6ee7b7;
}

.fid-attempt-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.52);
    color: #fcd34d;
}

.fid-step-title {
    font-size: 0.98rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.3;
}

.fid-step-sub {
    margin: 0;
    font-size: 0.8rem;
    color: #dbeafe;
    line-height: 1.44;
}

.fid-stage-hud.is-err .fid-step-sub {
    color: #fecaca;
}

.fid-stage-hud.is-ok .fid-step-sub {
    color: #a7f3d0;
}

.fid-progress-dots {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 3px;
}

.fid-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.34);
    border: 1.5px solid rgba(255, 255, 255, 0.32);
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.fid-dot.is-active {
    background: #38bdf8;
    border-color: #ffffff;
    transform: scale(1.26);
    animation: fidDotPulse 1s ease-in-out infinite;
}

.fid-dot.is-done {
    background: #10b981;
    border-color: #ffffff;
}

.fid-dot.is-failed {
    background: #ef4444;
    border-color: #fecaca;
    transform: scale(1.2);
}

@keyframes fidDotPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.55);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(56, 189, 248, 0);
    }
}

/* Блок самонавчання «🙋 Мене не впізнає FaceID» (тільки після 5 невдалих спроб у verify) */
.fid-calibration-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fid-btn-calibration {
    width: 100%;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.65);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(234, 88, 12, 0.24));
    color: #fde68a;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}

.fid-btn-calibration:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
    border-color: #fbbf24;
}

.fid-btn-calibration:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

html[data-theme="light"] .fid-btn-calibration {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border-color: #f59e0b;
}

.fid-calibration-sent {
    padding: 11px 14px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.48);
    color: #6ee7b7;
    font-size: 0.81rem;
    font-weight: 700;
    line-height: 1.45;
}

html[data-theme="light"] .fid-calibration-sent {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #065f46;
}

.fid-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.fid-btn-primary {
    flex: 1 1 200px;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
    border: 1px solid rgba(56, 189, 248, 0.65);
    background: linear-gradient(135deg, #0052ff, #0ea5e9);
    color: #ffffff;
}

.fid-btn-primary:hover:not(:disabled) {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.fid-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.fid-btn-secondary {
    flex: 1 1 200px;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.35));
    background: var(--bg-elevated, rgba(18, 27, 45, 0.85));
    color: var(--text-primary, #f1f5f9);
}

.fid-btn-secondary:hover {
    border-color: #38bdf8;
}

/* QR-перехід на смартфон */
.fid-qr-card {
    display: grid;
    grid-template-columns: 224px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
    background: var(--bg-elevated, rgba(18, 27, 45, 0.85));
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.25));
}

.fid-qr-img-wrap {
    width: 224px;
    height: 224px;
    border-radius: 16px;
    background: #ffffff;
    border: 2px solid rgba(56, 189, 248, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    overflow: hidden;
    margin: 0 auto;
}

.fid-qr-svg-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.fid-qr-placeholder {
    font-size: 0.76rem;
    font-weight: 700;
    color: #334155;
    text-align: center;
    line-height: 1.4;
    padding: 10px;
}

.fid-qr-copy {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
}

.fid-qr-copy strong {
    font-size: 0.96rem;
    font-weight: 900;
}

.fid-qr-copy p {
    margin: 0;
    font-size: 0.79rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.45;
}

.fid-qr-link-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.fid-qr-url-input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 38px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.3));
    background: var(--bg-input, #080d18);
    color: var(--text-primary, #f1f5f9);
    font-family: monospace;
    font-size: 0.72rem;
}

.fid-qr-live-status {
    padding: 8px 11px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-size: 0.79rem;
    font-weight: 800;
    color: #38bdf8;
}

.fid-qr-live-status.is-passed {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.5);
    color: #34d399;
}

.fid-qr-live-status.is-failed {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

/* Автономна мобільна сторінка /uk-UA/faceid-mobile/{token} */
.fid-mobile-body {
    min-height: 100vh;
    margin: 0;
    background: #03060c;
    color: #f1f5f9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.fid-mobile-shell {
    width: 100%;
    max-width: 520px;
    border-radius: 22px;
    background: #0b1220;
    border: 1px solid rgba(56, 189, 248, 0.36);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.65);
}

.fid-mobile-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.fid-mobile-brand-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fid-mobile-logo {
    font-weight: 900;
    font-size: 1.15rem;
    color: #38bdf8;
}

.fid-mobile-purpose {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
}

@media (max-width: 640px) {
    .fid-modal-overlay {
        padding: 8px;
        align-items: flex-start;
    }
    .fid-modal-card {
        padding: 14px 12px;
        border-radius: 18px;
        margin: auto 0;
    }
    .fid-mode-tabs {
        grid-template-columns: 1fr;
    }
    .fid-qr-card {
        grid-template-columns: 1fr;
    }
    .fid-oval-wrap {
        width: 244px;
        height: 244px;
    }
    .fid-oval-viewport {
        width: 202px;
        height: 202px;
    }
    .fid-step-title {
        font-size: 0.9rem;
    }
    .fid-step-sub {
        font-size: 0.76rem;
    }
    .fid-coach-banner {
        padding: 8px 10px;
        font-size: 0.75rem;
        gap: 7px;
    }
}

@media (max-width: 390px) {
    .fid-oval-wrap {
        width: 220px;
        height: 220px;
    }
    .fid-oval-viewport {
        width: 182px;
        height: 182px;
    }
    .fid-coach-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
