:root {
    --bg: #0b1324;
    --bg-2: #111c33;
    --text: #e8edf7;
    --muted: #93a1bc;
    --accent: #22c55e;
    --accent-2: #a3e635;
    --line: #22304d;
    --danger: #f97316;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
    background: radial-gradient(1200px 600px at 50% -10%, #16254a 0%, var(--bg) 60%);
    background-color: var(--bg);
    color: var(--text);
    font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.wrap {
    flex: 1;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 64px 16px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.logo {
    margin: 0;
    line-height: 0.95;
    letter-spacing: -0.04em;
    font-weight: 800;
}

.logo-top {
    display: block;
    font-size: clamp(1.25rem, 5vw, 1.9rem);
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--muted);
}

.logo-bottom {
    display: block;
    font-size: clamp(2.75rem, 12vw, 5rem);
}

.accent {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.meter {
    width: min(320px, 80%);
    height: 6px;
    margin: 28px 0 24px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ef4444, #f59e0b, var(--accent-2), var(--accent));
    position: relative;
    opacity: 0.9;
}

.meter span {
    position: absolute;
    top: 50%;
    left: 82%;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text);
    border: 3px solid var(--bg);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 1px var(--line);
}

.status {
    margin: 0 0 8px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent);
}

.lede {
    margin: 0 0 28px;
    max-width: 440px;
    color: var(--muted);
    line-height: 1.6;
}

.notice {
    margin: 0 0 16px;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-2);
    font-size: 0.95rem;
}

.signup {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 440px;
}

.signup input[type="email"] {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    font: inherit;
    color: var(--text);
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
}

.signup input[type="email"]:focus { border-color: var(--accent); }

.signup button {
    padding: 14px 20px;
    font: inherit;
    font-weight: 700;
    color: #06240f;
    background: var(--accent);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
}

.signup button:hover { background: var(--accent-2); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* The customer bot check's spot (src/turnstile.php): its widget is invisible, so keep it out of the layout */
.bot-check {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.foot {
    padding: 24px 16px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
}

@media (max-width: 420px) {
    .signup { flex-direction: column; }
}

.signup-terms {
    margin: 12px 0 0;
    max-width: 440px;
    font-size: 0.8rem;
    color: var(--muted);
}

/* Footer links */
.foot p { margin: 8px 0 0; }

.foot-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 20px;
}

.foot a, .signup-terms a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.foot a:hover, .signup-terms a:hover { color: var(--text); }

/* Legal pages (/terms, /privacy) */
.legal-top {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px 0;
}

.legal-brand {
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}

.legal {
    flex: 1;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 32px 16px 48px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.legal h1 { margin: 0; font-size: clamp(2rem, 6vw, 2.6rem); letter-spacing: -0.03em; line-height: 1.15; }
.legal h2 { margin: 40px 0 12px; font-size: 1.3rem; letter-spacing: -0.01em; line-height: 1.3; scroll-margin-top: 16px; }
.legal h3 { margin: 24px 0 8px; font-size: 1rem; }
.legal p, .legal li { color: #c9d3e6; }
.legal ul, .legal ol { padding-left: 1.4em; }
.legal li { margin: 6px 0; }
.legal strong { color: var(--text); }
.legal a { color: var(--accent-2); }
.legal section { scroll-margin-top: 16px; }

.legal-meta { margin: 8px 0 24px; color: var(--muted); font-size: 0.9rem; }

.legal-toc {
    margin: 0 0 8px;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-2);
}

.legal-toc-title { margin: 0 0 4px; font-weight: 700; color: var(--text); }
.legal-toc ol { margin: 0; columns: 2 260px; column-gap: 32px; }
.legal-toc li { margin: 4px 0; break-inside: avoid; }

.legal-alpha { list-style-type: lower-alpha; }

.legal-callout {
    margin: 20px 0;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    background: var(--bg-2);
}

.legal-callout.warn { border-left-color: var(--danger); }

.legal-caps { text-transform: uppercase; font-size: 0.9rem; letter-spacing: 0.01em; }

/* Landing page: "Powered by" partner logos */
.powered { margin-top: 48px; }

.powered-title {
    margin: 0 0 14px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.powered-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px 40px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.powered-logos img { display: block; height: 28px; width: auto; }

.foot .foot-legal { max-width: 640px; margin: 8px auto 0; font-size: 0.72rem; line-height: 1.5; opacity: 0.85; }

/* Landing page: semi-hidden PLAYGROUND link and its password dialog */
.playground-entry { margin: 20px 0 0; }

.playground-link {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--muted);
    opacity: 0.35;
    transition: opacity 0.2s, color 0.2s;
}

.playground-link:hover, .playground-link:focus-visible { opacity: 1; color: var(--accent); }

.pg-modal { display: none; }

.pg-modal:target {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.pg-modal.pg-closed { display: none; }

.pg-modal-backdrop { position: absolute; inset: 0; background: rgba(3, 7, 18, 0.75); backdrop-filter: blur(4px); }

.pg-modal-box {
    position: relative;
    width: 100%;
    max-width: 380px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg-2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.pg-modal-box h2 { margin: 0 0 8px; font-size: 0.85rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--accent); }
.pg-modal-text { margin: 0 0 16px; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.pg-modal-error { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: rgba(249, 115, 22, 0.12); color: var(--danger); font-size: 0.9rem; }

.pg-modal-box input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
}

.pg-modal-box input[type="password"]:focus { border-color: var(--accent); }

.pg-modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 16px; }
.pg-modal-cancel { color: var(--muted); font-size: 0.9rem; }

.pg-modal-actions button {
    padding: 10px 18px;
    font: inherit;
    font-weight: 700;
    color: #06240f;
    background: var(--accent);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
}

.pg-modal-actions button:hover { background: var(--accent-2); }
