@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

:root {
    --bg-1: #0f1024;
    --bg-2: #1b1450;
    --bg-3: #0d3b4a;
    --card-bg: rgba(255, 255, 255, 0.07);
    --card-border: rgba(255, 255, 255, 0.14);
    --text: #f3f4fb;
    --text-dim: #b8bad4;
    --accent: #7c6cf6;
    --accent-2: #34d1c5;
    --danger: #ff6b81;
}

* { box-sizing: border-box; }

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

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--text);
    background: radial-gradient(120% 120% at 15% 10%, var(--bg-2) 0%, var(--bg-1) 55%, var(--bg-3) 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

#bg-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    opacity: 0.55;
}

.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(1.25rem, 4vw, 3rem) 1rem 3rem;
}

.site-header {
    max-width: 720px;
    text-align: center;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.site-header h1 {
    font-size: clamp(1.5rem, 3.4vw, 2.35rem);
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 0.75rem;
    background: linear-gradient(90deg, #ffffff, var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.site-header .subtitle {
    font-size: clamp(0.85rem, 1.6vw, 1rem);
    line-height: 1.6;
    color: var(--text-dim);
    margin: 0;
}

.content {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: clamp(1.25rem, 4vw, 2.25rem);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.progress {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.progress span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.progress span.done { background: var(--accent-2); }
.progress span.current {
    background: var(--accent);
    transform: scale(1.35);
}

.question h2 {
    font-size: clamp(1.15rem, 2.6vw, 1.5rem);
    font-weight: 700;
    margin: 0 0 1.5rem;
    line-height: 1.4;
    text-align: center;
}

.choices {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
}

@media (min-width: 480px) {
    .choices.choices-grid { grid-template-columns: 1fr 1fr; }
}

.choice {
    display: block;
}

.choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice label {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    font-size: 0.98rem;
}

.choice label::before {
    content: '';
    width: 18px;
    height: 18px;
    flex: none;
    border-radius: 50%;
    border: 2px solid var(--text-dim);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.choice input:checked + label {
    background: rgba(124, 108, 246, 0.22);
    border-color: var(--accent);
}

.choice input:checked + label::before {
    border-color: var(--accent-2);
    background: radial-gradient(var(--accent-2) 45%, transparent 50%);
}

.choice label:hover {
    background: rgba(255, 255, 255, 0.09);
    transform: translateY(-1px);
}

.choice label:has(input:focus-visible) {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: #10102a;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.15s ease;
    box-shadow: 0 10px 25px rgba(124, 108, 246, 0.35);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn:not(:disabled):active { transform: translateY(0); }

.error-msg {
    color: var(--danger);
    font-size: 0.9rem;
    text-align: center;
    margin: -0.75rem 0 1.25rem;
}

.thanks-page {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1.25rem;
}

.thanks-page h1 {
    font-size: clamp(2rem, 6vw, 3.25rem);
    font-weight: 800;
    margin: 0;
    background: linear-gradient(90deg, #ffffff, var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.results-link {
    color: var(--accent-2);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.results-link:hover { border-color: var(--accent-2); }

.results-heading {
    text-align: center;
    font-size: clamp(1.2rem, 2.8vw, 1.6rem);
    font-weight: 700;
    margin: 0 0 2rem;
}

.charts {
    width: 100%;
    max-width: 980px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 760px) {
    .charts { grid-template-columns: 1fr 1fr; }
}

.chart-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.chart-card h3 {
    text-align: center;
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.chart-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 1rem;
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    color: #ffffff;
}

.chart-legend li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    line-height: 1.3;
}

.legend-swatch {
    width: 11px;
    height: 11px;
    border-radius: 3px;
    flex: none;
}

.content > .results-link {
    margin-top: 2rem;
}
