/* ================================================================
 * Face Liveness Overrides
 * Keep Amplify liveness component in default light theme
 * for best contrast with the color-flash challenge.
 * ================================================================ */

/* "Center your face" heading */
.amplify-liveness-start-screen-instructions__heading {
    color: #333 !important;
}

/* Hide photosensitivity warning, info popover, header, dividers */
.amplify-liveness-start-screen-warning,
.amplify-liveness-popover__anchor,
.amplify-liveness-popover__anchor-secondary,
.amplify-liveness-start-screen-header,
#face-liveness-container .amplify-divider,
.face-liveness-container .amplify-divider {
    display: none !important;
}

/* "Center your face" heading */
.amplify-liveness-start-screen-instructions__heading {
    text-align: center !important;
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    padding: 8px 24px !important;
    margin: 0 !important;
}

/* ----- START SCREEN: oval preview area ----- */

.amplify-liveness-start-screen-camera-waiting {
    height: auto !important;
    min-height: 200px;
    max-height: 50vh !important;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

.amplify-liveness-start-screen-camera-waiting .amplify-liveness-figure {
    max-height: 100% !important;
    overflow: hidden;
}

.amplify-liveness-start-screen-camera-waiting .amplify-liveness-figure__image {
    max-height: 45vh !important;
    width: auto !important;
    object-fit: contain;
}

/* "Start video check" button */
.liveness-detector .amplify-button--primary {
    margin: 12px auto !important;
    display: block !important;
    position: relative !important;
}

/* ----- CAMERA MODULE: contained within card ----- */

.amplify-liveness-camera-module {
    position: relative !important;
    width: 100% !important;
    max-height: 60vh !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.amplify-liveness-camera-module--mobile {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    max-height: 60vh !important;
    z-index: auto !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.amplify-liveness-video {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    max-height: 60vh !important;
    object-fit: contain;
}

.amplify-liveness-oval-canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* Remove the persistent gray horizontal line at top of camera area */
.amplify-liveness-video-anchor,
.amplify-liveness-video-anchor *,
.liveness-detector .amplify-flex {
    border: none !important;
    outline: none !important;
}

/* Cancel button — position closer to top-right of card */
.amplify-liveness-cancel-container {
    z-index: 3 !important;
    top: 8px !important;
    right: 8px !important;
}

/* ----- RESPONSIVE ----- */

@media (max-height: 650px) {
    .amplify-liveness-start-screen-camera-waiting {
        max-height: 40vh !important;
        min-height: 160px;
    }
    .amplify-liveness-camera-module,
    .amplify-liveness-camera-module--mobile,
    .amplify-liveness-video {
        max-height: 50vh !important;
    }
    .amplify-liveness-start-screen-instructions__heading {
        font-size: 1.15rem !important;
        padding: 4px 16px !important;
    }
}

@media (max-width: 480px) {
    .amplify-liveness-start-screen-camera-waiting {
        max-height: 45vh !important;
        min-height: 160px;
    }
    .amplify-liveness-start-screen-instructions__heading {
        font-size: 1.1rem !important;
    }
}

/* "Connecting..." loader — match font size + spinner to other steps */
.amplify-liveness-connecting-loader p,
.amplify-liveness-connecting-loader span,
.amplify-liveness-connecting-loader .amplify-text {
    font-weight: 700 !important;
    font-size: 1.4rem !important;
    color: #666 !important;
}

/* Allow start screen to grow past fixed card height */
.face-card:has(.amplify-liveness-start-screen-camera-waiting),
.face-card:has(.amplify-liveness-start-screen-header),
.face-login-content:has(.amplify-liveness-start-screen-camera-waiting),
.face-login-content:has(.amplify-liveness-start-screen-header) {
    height: auto !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
}

/* Ensure camera permission waiting screen matches other modal heights */
.amplify-liveness-start-screen-camera-waiting {
    min-height: 480px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

/* Camera permission waiting screen — larger spinner + text */
.amplify-liveness-start-screen-camera-waiting .amplify-loader {
    width: 55px !important;
    height: 55px !important;
}
.amplify-liveness-start-screen-camera-waiting .amplify-text {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    color: var(--muted, #7c8494) !important;
}

/* "Connecting..." spinner — match size to other steps */
.amplify-liveness-connecting-loader .amplify-loader {
    width: 55px !important;
    height: 55px !important;
}
