.checkbox,
.recaptcha-box {
    position: relative;
    display: flex
}

.flatline-text,
.status-container {
    font-family: "Share Tech Mono", monospace
}

:root {
    --color-primary: #1a73e8;
    --color-danger: #d93025;
    --color-success: #0f0;
    --color-error: #ff0000;
    --color-background: #f0f0f0;
    --color-widget-bg: #f9f9f9;
    --color-border: #d3d3d3
}

* {
    box-sizing: border-box;
    font-family: Roboto, sans-serif;
    user-select: none
}

body {
    background-color: var(--color-background);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0
}

.recaptcha-box {
    background: var(--color-widget-bg);
    border: 1px solid var(--color-border);
    border-radius: 3px;
    width: 300px;
    height: 74px;
    align-items: center;
    padding: 0 12px;
    box-shadow: 0 0 4px 1px rgba(0, 0, 0, .08)
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: opacity .2s
}

.checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #c1c1c1;
    border-radius: 2px;
    background: #fff;
    margin-right: 12px;
    align-items: center;
    justify-content: center
}

.checkbox:hover {
    border: 2px solid #b2b2b2
}

.spinner {
    display: none;
    width: 26px;
    height: 26px;
    border: 4px solid rgba(0, 0, 0, .1);
    border-left-color: var(--color-primary);
    border-radius: 50%;
    animation: 1s linear infinite spin;
    position: absolute;
    left: 11px;
    will-change: transform
}

@keyframes spin {
    100% {
        transform: rotate(360deg)
    }
}

.label {
    font-size: 14px;
    color: #282828;
    font-weight: 400
}

.logo-container {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: center
}

.recaptcha-logo {
    width: 32px;
    height: 32px;
    background-image: url("https://www.gstatic.com/recaptcha/api2/logo_48.png");
    background-size: cover;
    opacity: .5
}

.privacy-terms {
    font-size: 10px;
    color: #555;
    text-align: center;
    margin-top: 2px
}

.challenge-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    transition: background .3s
}

.challenge-box {
    background: #fff;
    width: 420px;
    box-shadow: 0 0 20px rgba(0, 0, 0, .2);
    border: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(.95);
    transition: .3s ease-out;
    border-radius: 4px;
    overflow: hidden;
    will-change: opacity, transform
}

.challenge-header {
    background: var(--color-primary);
    color: #fff;
    padding: 16px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4
}

.challenge-header strong {
    font-size: 18px;
    display: block;
    margin-bottom: 5px
}

.challenge-content {
    padding: 10px;
    position: relative;
    background: #f5f5f5
}

.ecg-wrapper {
    background: #000;
    height: 200px;
    position: relative;
    overflow: hidden;
    border: 4px solid #333;
    border-radius: 4px;
    cursor: crosshair;
    box-shadow: inset 0 0 20px #000
}

.btn-shock,
.btn-verify {
    cursor: pointer;
    font-weight: 700
}

.ecg-wrapper::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, .25) 50%);
    background-size: 100% 4px;
    z-index: 10;
    pointer-events: none
}

canvas {
    display: block
}

.heart-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 32px;
    color: #333;
    transition: transform 50ms;
    z-index: 20;
    will-change: transform, color
}

.heart-overlay.beat {
    color: #ff3838;
    transform: scale(1.4);
    text-shadow: 0 0 15px red
}

.controls-area {
    display: flex;
    flex-direction: column;
    padding: 15px 5px 5px;
    gap: 10px
}

.btn-shock {
    background: var(--color-danger);
    color: #fff;
    border: none;
    padding: 14px;
    font-size: 16px;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: 0 4px 0 #b31412;
    transition: transform .1s, box-shadow .1s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    will-change: transform
}

.btn-shock:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #b31412
}

.btn-shock:disabled {
    background: #999;
    box-shadow: 0 4px 0 #666;
    cursor: not-allowed
}

.status-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #222;
    color: var(--color-success);
    padding: 8px 12px;
    border-radius: 2px;
    margin-bottom: 5px
}

.bpm-display {
    font-size: 20px
}

.challenge-footer {
    border-top: 1px solid #e0e0e0;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff
}

.btn-verify {
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 2px;
    font-size: 14px;
    opacity: .5;
    pointer-events: none;
    transition: opacity .3s
}

.btn-verify.active {
    opacity: 1;
    pointer-events: all
}

.info-icon {
    color: #555;
    font-size: 20px;
    cursor: help
}

.shake {
    animation: .5s cubic-bezier(.36, .07, .19, .97) both shake
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0)
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0)
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0)
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0)
    }
}

.flatline-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-error);
    font-size: 24px;
    font-weight: 700;
    background: rgba(0, 0, 0, .85);
    padding: 20px;
    border: 2px solid var(--color-error);
    text-align: center;
    display: none;
    z-index: 100;
    box-shadow: 0 0 30px rgba(255, 0, 0, .3)
}

.restart-hint {
    font-size: 14px;
    color: #fff;
    margin-top: 10px;
    font-weight: 400;
    display: block
}