:root {
    --navy: #071f46;
    --navy-2: #0b2f66;
    --blue: #1268d8;
    --cyan: #13b8c9;
    --cyan-2: #86edf2;
    --ink: #111827;
    --muted: #607089;
    --line: #dbe5f2;
    --bg: #f4f8fc;
    --card: #ffffff;
    --soft: #eef6ff;
    --success: #18a86b;
    --gold: #e3a61b;
    --shadow: 0 24px 70px rgba(8, 31, 70, 0.13);
    --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at top left, rgba(19, 184, 201, .18), transparent 35%), linear-gradient(135deg, #f8fbff 0%, #eef5fb 100%);
    line-height: 1.45;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }

.public-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(135deg, rgba(7,31,70,.08), transparent 35%),
        radial-gradient(circle at 80% 20%, rgba(18,104,216,.10), transparent 30%);
}

.start-shell, .quiz-shell, .result-shell {
    width: min(1120px, calc(100vw - 32px));
    margin: 0 auto;
}
.start-shell { min-height: 100vh; display: grid; place-items: center; padding: 48px 0; }
.quiz-shell { padding: 56px 0; }
.result-shell { padding: 42px 0 70px; }

.hero-card, .quiz-card, .panel, .result-hero {
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(219,229,242,.95);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.hero-card {
    width: min(840px, 100%);
    padding: clamp(32px, 5vw, 64px);
    position: relative;
    overflow: hidden;
}
.hero-card::after {
    content: "";
    position: absolute;
    right: -130px;
    top: -160px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(19,184,201,.28), rgba(18,104,216,.05) 65%, transparent 70%);
}
.eyebrow {
    color: var(--cyan);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .78rem;
    margin-bottom: 10px;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
    color: var(--navy);
    font-size: clamp(2.2rem, 5vw, 4.6rem);
    line-height: .98;
    letter-spacing: -0.055em;
    margin-bottom: 18px;
}
.quiz-card h1 { font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -0.025em; margin: 0; }
.quiz-card h2 { font-size: clamp(1.55rem, 4vw, 2.55rem); color: var(--navy); line-height: 1.1; letter-spacing: -0.035em; margin: 30px 0; }
.lead { font-size: clamp(1.2rem, 2vw, 1.55rem); color: var(--navy-2); font-weight: 700; margin-bottom: 16px; }
.hero-card p { color: var(--muted); max-width: 700px; font-size: 1.06rem; }
.privacy-note { font-size: .92rem !important; margin: 18px 0 0; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 999px;
    padding: 13px 22px;
    font-weight: 850;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    color: white;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 14px 30px rgba(18,104,216,.25);
}
.btn-secondary { color: var(--navy); background: #e9f4ff; border: 1px solid var(--line); }
.btn-danger { color: white; background: linear-gradient(135deg, #a20f2d, #e34a56); }
.btn-large { padding: 16px 30px; font-size: 1.05rem; }
.start-actions { margin-top: 30px; }

.notice {
    border-radius: 16px;
    padding: 14px 16px;
    margin-top: 18px;
    border: 1px solid var(--line);
    background: #f7fbff;
}
.notice-danger { border-color: #f2bdc6; background: #fff1f3; color: #8f1630; }
.notice-success { border-color: #bdebd6; background: #effcf6; color: #0d6b46; }

.quiz-card { padding: clamp(24px, 4vw, 44px); }
.quiz-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.progress { height: 10px; background: #e5edf7; border-radius: 999px; overflow: hidden; margin: 22px 0 0; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: inherit; }
.answers { display: grid; gap: 14px; }
.answer-option {
    display: grid;
    grid-template-columns: auto 44px 1fr;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    background: #fff;
    padding: 18px;
    border-radius: 18px;
    transition: border .16s ease, box-shadow .16s ease, transform .16s ease;
}
.answer-option:hover { border-color: rgba(18,104,216,.55); box-shadow: 0 10px 24px rgba(8,31,70,.08); transform: translateY(-1px); }
.answer-option input { width: 20px; height: 20px; accent-color: var(--blue); }
.answer-key {
    width: 36px; height: 36px; display: grid; place-items: center;
    background: var(--navy); color: white; border-radius: 50%; font-weight: 900;
}
.answer-text { font-weight: 650; color: var(--ink); }
.form-footer { display: flex; justify-content: flex-end; align-items: center; gap: 20px; margin-top: 26px; }

.result-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 30px;
    padding: clamp(26px, 4vw, 46px);
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(236,248,255,.92));
}
.score-ring {
    width: 154px;
    height: 154px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    align-content: center;
    background: conic-gradient(var(--cyan) 0 var(--score-percent, 76%), #dfeaf6 var(--score-percent, 76%));
    box-shadow: inset 0 0 0 14px #fff, 0 18px 38px rgba(8,31,70,.14);
    color: var(--navy);
}
.score-ring span { font-size: 3.6rem; font-weight: 950; line-height: 1; }
.score-ring small { color: var(--muted); font-weight: 850; }
.result-hero h1 { font-size: clamp(2rem, 4vw, 3.3rem); margin-bottom: 12px; }
.result-hero p { color: var(--muted); max-width: 760px; font-size: 1.02rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.panel { padding: clamp(22px, 3vw, 34px); margin-bottom: 24px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.panel-header h2 { color: var(--navy); margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -0.025em; }
.panel-header span { color: var(--muted); font-weight: 750; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric-grid.compact { margin-bottom: 24px; }
.metric-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #fff, #f7fbff);
}
.metric-card span { display: block; color: var(--muted); font-size: .85rem; font-weight: 750; margin-bottom: 8px; }
.metric-card strong { display: block; color: var(--navy); font-size: 2rem; line-height: 1; letter-spacing: -0.04em; }

.mini-chart, .history-bars { display: grid; gap: 9px; }
.chart-row, .history-row {
    display: grid;
    grid-template-columns: 54px 1fr 48px;
    align-items: center;
    gap: 12px;
    color: var(--navy);
    font-weight: 700;
}
.chart-bar-track, .history-track { height: 18px; background: #e7eef8; border-radius: 999px; overflow: hidden; }
.chart-bar, .history-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--cyan)); min-width: 2px; }
.history-row { grid-template-columns: 88px 1fr 64px; }
.positive-note { color: var(--navy-2); background: #edf8fb; border: 1px solid #caedf4; border-radius: 16px; padding: 14px 16px; margin-bottom: 0; }

.ampel-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.ampel-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    background: white;
    min-height: 190px;
}
.ampel-dot { width: 18px; height: 18px; border-radius: 50%; margin-bottom: 14px; }
.ampel-card h3 { color: var(--navy); margin-bottom: 8px; font-size: 1rem; }
.ampel-card strong { display: block; margin-bottom: 8px; }
.ampel-card p { color: var(--muted); margin: 0; font-size: .92rem; }
.level-start { background: linear-gradient(180deg, #fffdfa, #fff7e8); }
.level-start .ampel-dot { background: var(--gold); }
.level-start strong { color: #966a00; }
.level-solid { background: linear-gradient(180deg, #fbfdff, #edf8ff); }
.level-solid .ampel-dot { background: var(--cyan); }
.level-solid strong { color: #087b89; }
.level-strong { background: linear-gradient(180deg, #fbfffd, #ebfbf4); }
.level-strong .ampel-dot { background: var(--success); }
.level-strong strong { color: #0b784e; }

.admin-page {
    background: #f3f7fb;
}
.admin-shell { width: min(1280px, calc(100vw - 32px)); margin: 0 auto; padding: 34px 0 70px; }
.admin-header {
    background: linear-gradient(135deg, var(--navy), var(--navy-2));
    border-radius: 26px;
    color: white;
    padding: clamp(26px, 4vw, 42px);
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}
.admin-header h1 { color: white; margin-bottom: 10px; }
.admin-header p { color: #cfe8ff; margin: 0; }
.admin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.admin-card, .chart-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 12px 28px rgba(8,31,70,.07);
}
.admin-card span { display: block; color: var(--muted); font-size: .85rem; font-weight: 800; margin-bottom: 10px; }
.admin-card strong { color: var(--navy); font-size: 2rem; letter-spacing: -.04em; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.chart-card h2 { color: var(--navy); margin-bottom: 18px; }
.bar-table { display: grid; gap: 10px; }
.bar-line { display: grid; grid-template-columns: minmax(110px, 170px) 1fr 48px; align-items: center; gap: 12px; }
.bar-label { color: var(--navy); font-weight: 800; font-size: .92rem; }
.bar-track { height: 22px; border-radius: 999px; background: #e8eef7; overflow: hidden; }
.bar-fill { height: 100%; min-width: 2px; background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: inherit; }
.bar-value { color: var(--muted); font-weight: 800; text-align: right; }
.question-bars { display: grid; gap: 18px; }
.q-block { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: #fbfdff; }
.q-block h3 { color: var(--navy); margin-bottom: 12px; }
.stacked { display: flex; height: 26px; border-radius: 999px; overflow: hidden; background: #e8eef7; }
.stacked span { display: block; height: 100%; min-width: 2px; }
.stack-a { background: #94a3b8; }
.stack-b { background: var(--cyan); }
.stack-c { background: var(--success); }
.stack-legend { display: flex; gap: 14px; color: var(--muted); font-weight: 750; font-size: .85rem; margin-top: 10px; flex-wrap: wrap; }
.insights-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.reset-panel { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.reset-panel p { color: var(--muted); margin: 0; }

code { background: rgba(7,31,70,.08); padding: 2px 6px; border-radius: 8px; }

@media (max-width: 980px) {
    .metric-grid, .admin-grid, .chart-grid, .insights-grid { grid-template-columns: repeat(2, 1fr); }
    .ampel-grid { grid-template-columns: repeat(2, 1fr); }
    .result-hero { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    .metric-grid, .admin-grid, .chart-grid, .insights-grid, .ampel-grid { grid-template-columns: 1fr; }
    .answer-option { grid-template-columns: auto 38px 1fr; }
    .form-footer { flex-direction: column; align-items: stretch; }
    .chart-row, .history-row { grid-template-columns: 48px 1fr 42px; }
    .bar-line { grid-template-columns: 1fr; gap: 6px; }
    .bar-value { text-align: left; }
    .reset-panel { flex-direction: column; align-items: flex-start; }
}
