:root {
    --primary-blue: #4285f4;
    --focus-blue: #1a73e8;
}

body {
    font-family: 'Roboto', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* --- CAPTCHA WIDGET OVERRIDES --- */
.captcha-widget {
    background: #f9f9f9;
    border: 1px solid #d3d3d3;
    border-radius: 4px;
    /* Bootstrap-like radius */
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    z-index: 10;
}

.captcha-widget:hover {
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #c1c1c1;
    border-radius: 2px;
    background: #fff;
    position: relative;
    transition: border 0.3s;
}

.checkbox.loading {
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-blue);
    border-right: 2px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.checkbox.checked {
    border: none;
    background: transparent;
}

.checkbox.checked::after {
    content: 'check';
    font-family: 'Material Icons';
    color: #0f9d58;
    font-size: 29px;
    font-weight: bold;
    position: absolute;
    top: -10px;
    left: 0px;
}

.label {
    font-size: 14px;
    color: #222;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.7;
    margin-right: 4px;
}

.logo-img {
    width: 32px;
    height: 32px;
    background-image: url('https://www.gstatic.com/recaptcha/api2/logo_48.png');
    background-size: cover;
}

.privacy-terms {
    font-size: 10px;
    color: #555;
    text-align: center;
    margin-top: 2px;
    line-height: 1.1;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- MODAL CHALLENGE (Existing - Functional) --- */
.challenge-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    z-index: 9999;
    /* Higher than Bootstrap */
}

.challenge-overlay.active {
    pointer-events: all;
    background: rgba(255, 255, 255, 0.5);
}

.challenge-box {
    background: #fff;
    width: 400px;
    max-width: 95vw;
    border: 1px solid #ccc;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    padding: 8px;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.2s, transform 0.2s;
    display: none;
}

.challenge-overlay.active .challenge-box {
    opacity: 1;
    transform: scale(1);
    display: block;
}

.challenge-header {
    background: var(--primary-blue);
    color: #fff;
    padding: 16px 16px 20px 16px;
    margin: -8px -8px 8px -8px;
}

.challenge-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.2;
}

.challenge-header strong {
    display: block;
    font-size: 28px;
    font-weight: 700;
    margin-top: 4px;
}

.challenge-subtext {
    font-size: 14px;
    font-weight: 400;
    margin-top: 8px;
    opacity: 0.9;
}

/* Grid for Level 1 & 2 */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    margin-bottom: 8px;
}

.tile {
    position: relative;
    cursor: pointer;
    aspect-ratio: 1;
    overflow: hidden;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: bold;
    color: #777;
    transition: transform 0.1s ease-in-out;
}

.tile.selected {
    transform: scale(0.8);
}

.tile.selected::after {
    content: 'check';
    font-family: 'Material Icons';
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--primary-blue);
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 2px solid #fff;
    z-index: 2;
}

.challenge-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.footer-icons {
    display: flex;
    gap: 12px;
    color: #555;
}

.verify-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 10px 24px;
    font-weight: bold;
    border-radius: 2px;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.verify-btn:hover {
    background: var(--focus-blue);
}

/* --- HIDDEN ELEMENTS --- */
#hidden-camera-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

#analysis-canvas {
    display: none;
}