<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width,initial-scale=1" />
        <meta name="robots" content="noindex" />
        <title>Verify</title>
        <style>
            :root {
                --bg: #f5f5f5;
                --text: #111;
                --surface: #e2e2e2;
                --border: #bbb;
                --muted: #777;
                --link: #555;
                --error: #c00;
                --accent: {{ACCENT_COLOR}};
            }
            @media (prefers-color-scheme: dark) {
                :root {
                    --bg: #0a0a0a;
                    --text: #e0e0e0;
                    --surface: #1a1a1a;
                    --border: #333;
                    --muted: #555;
                    --link: #777;
                    --error: #f55;
                }
            }
            * {
                margin: 0;
                padding: 0;
                box-sizing: border-box;
            }
            body {
                font-family: system-ui, sans-serif;
                display: flex;
                justify-content: center;
                align-items: center;
                min-height: 100vh;
                background: var(--bg);
                color: var(--text);
            }
            .box {
                text-align: center;
                max-width: 520px;
                width: 100%;
                padding: 2rem;
            }
            h2 {
                margin-bottom: 0.4rem;
                font-weight: 500;
            }
            .prompt {
                margin-bottom: 1.2rem;
                font-size: 1.1rem;
                color: var(--muted);
            }
            .grid {
                display: grid;
                grid-template-columns: repeat(3, 1fr);
                gap: 8px;
                margin-bottom: 1.2rem;
                max-width: 340px;
                margin-left: auto;
                margin-right: auto;
            }
            .grid label {
                position: relative;
                cursor: pointer;
                display: block;
            }
            .grid input[type="checkbox"] {
                position: absolute;
                opacity: 0;
                width: 0;
                height: 0;
            }
            .grid img {
                display: block;
                width: 100%;
                border-radius: 4px;
                border: 3px solid transparent;
                transition: border-color 0.15s;
            }
            .grid input[type="checkbox"]:checked + img {
                border-color: var(--accent);
            }
            .grid label:hover img {
                border-color: var(--border);
            }
            .grid input[type="checkbox"]:checked + img {
                border-color: var(--accent);
            }
            .check-mark {
                display: none;
                position: absolute;
                top: 4px;
                right: 4px;
                width: 20px;
                height: 20px;
                background: var(--accent);
                border-radius: 50%;
                line-height: 20px;
                font-size: 12px;
                color: #111;
                font-weight: 700;
            }
            .grid input[type="checkbox"]:checked ~ .check-mark {
                display: block;
            }
            button[type="submit"] {
                width: 100%;
                max-width: 340px;
                padding: 0.6rem;
                background: var(--accent);
                color: #111;
                border: none;
                border-radius: 4px;
                font-size: 1rem;
                font-weight: 600;
                cursor: pointer;
            }
            button[type="submit"]:hover {
                filter: brightness(0.85);
            }
            .branding {
                margin-top: 1.5rem;
                font-size: 0.7rem;
                color: var(--muted);
            }
            .branding a {
                color: var(--link);
                text-decoration: none;
            }
            .branding a:hover {
                text-decoration: underline;
            }
            .error {
                color: var(--error);
                font-size: 0.85rem;
                margin-bottom: 0.8rem;
            }
            .reload-btn {
                display: inline-block;
                margin-bottom: 0.8rem;
                background: var(--surface);
                border: 1px solid var(--border);
                border-radius: 4px;
                padding: 0.3rem 0.8rem;
                font-size: 0.85rem;
                color: var(--text);
                text-decoration: none;
                cursor: pointer;
            }
            .reload-btn:hover {
                background: var(--border);
            }
        </style>
    </head>
    <body>
        <div class="box">
            <h2>Select all images of</h2>
            <p class="prompt">{{category}}</p>
            <a class="reload-btn" href="{{redirect}}">New challenge</a>
            {{ERROR}}
            <form method="POST" action="{{verifyPath}}">
                <input type="hidden" name="id" value="{{id}}" />
                <input type="hidden" name="redirect" value="{{redirect}}" />
                <div class="grid">
                    <label>
                        <input type="checkbox" name="nonce" value="0" />
                        <img src="{{grid_0}}" alt="Image 1" />
                        <span class="check-mark">&#10003;</span>
                    </label>
                    <label>
                        <input type="checkbox" name="nonce" value="1" />
                        <img src="{{grid_1}}" alt="Image 2" />
                        <span class="check-mark">&#10003;</span>
                    </label>
                    <label>
                        <input type="checkbox" name="nonce" value="2" />
                        <img src="{{grid_2}}" alt="Image 3" />
                        <span class="check-mark">&#10003;</span>
                    </label>
                    <label>
                        <input type="checkbox" name="nonce" value="3" />
                        <img src="{{grid_3}}" alt="Image 4" />
                        <span class="check-mark">&#10003;</span>
                    </label>
                    <label>
                        <input type="checkbox" name="nonce" value="4" />
                        <img src="{{grid_4}}" alt="Image 5" />
                        <span class="check-mark">&#10003;</span>
                    </label>
                    <label>
                        <input type="checkbox" name="nonce" value="5" />
                        <img src="{{grid_5}}" alt="Image 6" />
                        <span class="check-mark">&#10003;</span>
                    </label>
                    <label>
                        <input type="checkbox" name="nonce" value="6" />
                        <img src="{{grid_6}}" alt="Image 7" />
                        <span class="check-mark">&#10003;</span>
                    </label>
                    <label>
                        <input type="checkbox" name="nonce" value="7" />
                        <img src="{{grid_7}}" alt="Image 8" />
                        <span class="check-mark">&#10003;</span>
                    </label>
                    <label>
                        <input type="checkbox" name="nonce" value="8" />
                        <img src="{{grid_8}}" alt="Image 9" />
                        <span class="check-mark">&#10003;</span>
                    </label>
                </div>
                <button type="submit">Verify</button>
            </form>
            {{BRANDING}}
        </div>
    </body>
</html>
