/* ==============================================================
   HP-Matrix · Mobile-first Stylesheet
   Bewährte CSS-Variablen aus dem Original-Dark-Theme, aber
   konsistent, responsiv und ohne Bootstrap-Abhängigkeit.
   ============================================================== */

:root {
    --bg-dark:       #0f172a;
    --bg-soft:       #1e293b;
    --bg-softer:     #273449;
    --border:        #334155;
    --text:          #f1f5f9;
    --text-muted:    #94a3b8;
    --accent:        #38bdf8;
    --accent-strong: #0ea5e9;
    --green:         #10b981;
    --red:           #ef4444;
    --amber:         #f59e0b;
    --violet:        #8b5cf6;
    --radius:        14px;
    --radius-lg:     22px;
    --shadow:        0 10px 30px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-dark);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

h1, h2, h3, h4 { margin: 0 0 .6rem; font-weight: 700; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; color: var(--accent); }
p  { margin: 0 0 1rem; line-height: 1.5; }
.muted { color: var(--text-muted); }

/* --------- Layout --------- */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 12px 120px; /* Platz für sticky CTA */
}

.hero {
    text-align: center;
    padding: 40px 16px 30px;
}
.hero h1 {
    font-size: 2rem;
    background: linear-gradient(90deg, var(--accent), #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* --------- Navigation --------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(15,23,42,0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar a.brand { display: flex; align-items: center; }
.brand-logo { height: 40px; width: auto; display: block; }
.topbar nav { display: flex; gap: 12px; align-items: center; }
.topbar nav a, .topbar nav button {
    color: var(--text-muted);
    font-weight: 500;
    background: transparent;
    border: 1px solid transparent;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: .9rem;
    cursor: pointer;
}
.topbar nav a:hover, .topbar nav button:hover {
    color: var(--text); border-color: var(--border);
}

/* --------- Cards / Boxes --------- */
.card {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}

.focus-box {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
}
.focus-box h3 {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    letter-spacing: .3px;
}

/* --------- Buttons --------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 22px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: var(--bg-softer);
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .08s, background .15s;
    text-decoration: none;
    min-height: 48px;
}
.btn:active { transform: scale(.98); }
.btn-block { width: 100%; }
.btn-primary {
    background: linear-gradient(90deg, var(--accent), #6366f1);
    color: #0f172a;
    border-color: transparent;
}
.btn-success { background: var(--green); color: #fff; }
.btn-danger  { background: var(--red); color: #fff; }
.btn-neutral { background: var(--bg-softer); color: var(--text-muted); }
.btn-ghost   { background: transparent; border-color: var(--border); color: var(--text); }
.btn-lg      { padding: 18px 24px; font-size: 1.1rem; border-radius: 14px; }

/* --------- Segmented Control --------- */
.segmented {
    display: grid;
    grid-template-columns: repeat(var(--segments, 3), 1fr);
    gap: 6px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    padding: 4px;
    border-radius: 12px;
}
.segmented input { display: none; }
.segmented label {
    padding: 12px 8px;
    border-radius: 9px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    font-size: .92rem;
    transition: background .15s, color .15s;
}
.segmented input:checked + label {
    background: var(--accent);
    color: #0f172a;
}

/* --------- Chips (Multi-Select) --------- */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.chips input { display: none; }
.chips label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-muted);
    font-size: .9rem;
    cursor: pointer;
    user-select: none;
    transition: background .15s, color .15s, border-color .15s;
    min-height: 40px;
}
.chips label:hover { color: var(--text); }
.chips input:checked + label {
    background: rgba(56,189,248,.15);
    color: var(--accent);
    border-color: var(--accent);
}

/* --------- Form Inputs --------- */
.field {
    display: block;
    margin-bottom: 14px;
}
.field label.lbl {
    display: block;
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: .3px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
    width: 100%;
    padding: 14px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    min-height: 48px;
}
.field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56,189,248,.15);
}

.checkbox-row {
    display: flex;
    align-items: start;
    gap: 10px;
    padding: 10px 0;
    cursor: pointer;
}
.checkbox-row input { margin-top: 4px; }
.checkbox-row span { font-size: .92rem; color: var(--text); }

/* --------- Flash Messages --------- */
.flash-list {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
}
.flash {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: .92rem;
    border: 1px solid var(--border);
}
.flash-success { background: rgba(16,185,129,.1); color: #6ee7b7; border-color: #10b98166; }
.flash-danger  { background: rgba(239,68,68,.1);  color: #fca5a5; border-color: #ef444466; }
.flash-warning { background: rgba(245,158,11,.1); color: #fcd34d; border-color: #f59e0b66; }
.flash-info    { background: rgba(56,189,248,.1); color: #7dd3fc; border-color: #38bdf866; }

/* --------- Progress Bar (Befragung) --------- */
.progress-wrap {
    height: 6px;
    background: var(--bg-soft);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 20px;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #6366f1);
    transition: width .4s ease-in-out;
}

/* --------- Ranking --------- */
.ranking-item { margin-bottom: 12px; }
.ranking-head {
    display: flex; justify-content: space-between; font-size: .9rem;
    margin-bottom: 4px;
}
.ranking-bar {
    height: 6px; background: var(--bg-dark);
    border-radius: 999px; overflow: hidden;
}
.ranking-bar > span {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--accent), #818cf8);
}
.ranking-container { padding: 16px; border: 1px dashed var(--border); border-radius: 16px; }

/* --------- Sticky CTA --------- */
.sticky-cta {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg-dark) 75%, rgba(15,23,42,0));
    z-index: 5;
}
.sticky-cta .btn { width: 100%; }

/* --------- Disclaimer Banner --------- */
.disclaimer {
    font-size: .82rem;
    color: var(--text-muted);
    background: rgba(245,158,11,.08);
    border: 1px solid #f59e0b55;
    padding: 12px 14px;
    border-radius: 10px;
    margin: 14px 0;
}

/* --------- Utilities --------- */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* --------- Desktop Fein-Tuning --------- */
@media (min-width: 900px) {
    .container { padding: 30px 20px 40px; }
    .sticky-cta {
        position: static;
        padding: 0;
        background: none;
        margin-top: 20px;
        text-align: center;
    }
    .sticky-cta .btn {
        width: auto;
        min-width: 260px;
        padding: 16px 48px;
    }
}

/* --------- Hidden mobile utility --------- */
@media (max-width: 899px) {
    .hidden-mobile { display: none !important; }
}
