/* ==========================================================================
   Fragebogen (Führungskräftefeedback) – modernes, responsives Design
   Alle Klassen mit fb- Präfix, um Kollisionen mit Bootstrap/Blazorise zu vermeiden.
   Markenfarben: FSV-Blau #013466 (Primary), #005ea9 (Secondary).
   ========================================================================== */

:root {
    --fb-primary: #013466;
    --fb-primary-rgb: 1, 52, 102;
    --fb-secondary: #005ea9;
    --fb-secondary-rgb: 0, 94, 169;
    --fb-accent: #00a0e3;
    --fb-success: #2e7d32;
    --fb-bg: #f4f7fb;
    --fb-surface: #ffffff;
    --fb-border: #e2e8f0;
    --fb-text: #1f2a37;
    --fb-text-muted: #64748b;
    --fb-radius: 16px;
    --fb-radius-sm: 10px;
    --fb-shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 2px 8px rgba(15, 23, 42, .05);
    --fb-shadow-md: 0 6px 18px rgba(var(--fb-primary-rgb), .10), 0 2px 6px rgba(15, 23, 42, .06);
    --fb-shadow-lg: 0 18px 40px rgba(var(--fb-primary-rgb), .16);
}

/* ---------- Grundgerüst ------------------------------------------------ */
.fb-page {
    --fb-maxw: 900px;
    color: var(--fb-text);
    padding-bottom: 6.5rem; /* Platz für die klebende Fußleiste */
    animation: fb-fade-in .4s ease both;
}

.fb-shell {
    max-width: var(--fb-maxw);
    margin-inline: auto;
    padding-inline: clamp(.75rem, 3vw, 1.25rem);
}

@keyframes fb-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Klebender Kopf mit Fortschritt ---------------------------- */
.fb-progress-bar-wrap {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--fb-border);
    box-shadow: var(--fb-shadow-sm);
}

.fb-progress-inner {
    max-width: var(--fb-maxw);
    margin-inline: auto;
    padding: .6rem clamp(.75rem, 3vw, 1.25rem);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.fb-progress-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.fb-progress-title {
    font-weight: 700;
    font-size: .95rem;
    color: var(--fb-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fb-progress-sub {
    font-size: .78rem;
    color: var(--fb-text-muted);
}

.fb-progress-track {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: #e6edf6;
    overflow: hidden;
    margin-top: .35rem;
}

.fb-progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--fb-secondary), var(--fb-accent));
    transition: width .45s cubic-bezier(.4, 0, .2, 1);
}

.fb-progress-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: baseline;
    gap: .2rem;
    font-weight: 800;
    color: var(--fb-primary);
    font-variant-numeric: tabular-nums;
}

.fb-progress-badge .fb-pct { font-size: 1.35rem; line-height: 1; }
.fb-progress-badge .fb-pct-sign { font-size: .85rem; color: var(--fb-text-muted); }

/* ---------- Hero / Willkommensbereich --------------------------------- */
.fb-hero {
    margin-top: 1.25rem;
    background: linear-gradient(135deg, var(--fb-primary) 0%, var(--fb-secondary) 100%);
    color: #fff;
    border-radius: var(--fb-radius);
    padding: clamp(1.25rem, 3vw, 2rem);
    box-shadow: var(--fb-shadow-md);
    position: relative;
    overflow: hidden;
}

.fb-hero::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle at center, rgba(255,255,255,.18), transparent 70%);
    pointer-events: none;
}

.fb-hero-title {
    font-size: clamp(1.35rem, 3vw, 1.9rem);
    font-weight: 800;
    margin: 0 0 .4rem;
    letter-spacing: -.01em;
}

.fb-hero-text {
    margin: 0;
    font-size: .95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .92);
    max-width: 60ch;
}

/* ---------- Info-Hinweis ---------------------------------------------- */
.fb-note {
    margin-top: 1rem;
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    background: #eaf4ff;
    border: 1px solid #cfe4fb;
    border-left: 4px solid var(--fb-secondary);
    border-radius: var(--fb-radius-sm);
    padding: .9rem 1.1rem;
    color: #0b3a63;
}

.fb-note-icon {
    flex: 0 0 auto;
    font-size: 1.1rem;
    color: var(--fb-secondary);
    margin-top: .1rem;
}

.fb-note-title { font-weight: 700; margin: 0 0 .15rem; font-size: .95rem; }
.fb-note-text  { margin: 0; font-size: .85rem; line-height: 1.5; }

/* ---------- Gruppen-Card ---------------------------------------------- */
.fb-group {
    background: var(--fb-surface);
    border: 1px solid var(--fb-border);
    border-radius: var(--fb-radius);
    box-shadow: var(--fb-shadow-sm);
    margin-top: 1.25rem;
    overflow: hidden;
    transition: box-shadow .25s ease, transform .25s ease;
}

.fb-group:hover { box-shadow: var(--fb-shadow-md); }

.fb-group-head {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    padding: 1.1rem 1.25rem;
    background: linear-gradient(180deg, rgba(var(--fb-primary-rgb), .045), rgba(var(--fb-primary-rgb), 0));
    border-bottom: 1px solid var(--fb-border);
}

.fb-group-num {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fb-primary), var(--fb-secondary));
    color: #fff;
    font-weight: 800;
    font-size: 1.15rem;
    box-shadow: 0 4px 10px rgba(var(--fb-primary-rgb), .28);
}

.fb-group-heads { min-width: 0; }

.fb-group-title {
    margin: 0;
    color: var(--fb-primary);
    font-weight: 700;
    font-size: 1.08rem;
    line-height: 1.35;
}

.fb-group-sub {
    margin: .2rem 0 0;
    color: var(--fb-text-muted);
    font-size: .86rem;
    line-height: 1.5;
}

.fb-group-body { padding: .5rem 1.25rem 1.25rem; }

/* ---------- Frage-Block ------------------------------------------------
   Jede Frage als eigenständige Karte mit farbigem Akzentstreifen, damit klar
   erkennbar ist, welche Antwortmöglichkeiten zu welcher Frage gehören.
   ---------------------------------------------------------------------- */
.fb-question {
    padding: 1.05rem 1.15rem;
    margin-bottom: 1rem;
    background: #f6f9fc;
    border: 1px solid var(--fb-border);
    border-left: 5px solid var(--fb-secondary);
    border-radius: var(--fb-radius-sm);
    transition: box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

.fb-question:last-child { margin-bottom: 0; }

.fb-question:hover {
    background: #fff;
    border-left-color: var(--fb-primary);
    box-shadow: var(--fb-shadow-sm);
}

.fb-question-head {
    display: flex;
    gap: .55rem;
    align-items: baseline;
    margin-bottom: .9rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid #d7e2ef;
}

.fb-question-key {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.9rem;
    padding: .1rem .45rem;
    border-radius: 7px;
    background: #fff;
    border: 1.5px solid var(--fb-secondary);
    color: var(--fb-secondary);
    font-weight: 800;
    font-size: .8rem;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}

.fb-question-text {
    margin: 0;
    font-weight: 700;
    font-size: 1.06rem;
    line-height: 1.5;
    color: var(--fb-primary);
}

.fb-question-sub {
    margin: .15rem 0 0;
    font-size: .82rem;
    color: var(--fb-text-muted);
}

/* ---------- Segmented-Pills (Skala) ----------------------------------- */
.fb-scale {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.fb-pill {
    --fb-pill-bd: var(--fb-border);
    flex: 1 1 auto;
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    text-align: center;
    padding: .7rem .85rem;
    border: 1.5px solid var(--fb-pill-bd);
    border-radius: 12px;
    background: #fff;
    color: var(--fb-text);
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    user-select: none;
    transition: all .18s ease;
    -webkit-tap-highlight-color: transparent;
}

.fb-pill:hover {
    border-color: var(--fb-secondary);
    background: #f2f8ff;
    transform: translateY(-1px);
}

.fb-pill:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--fb-secondary-rgb), .35);
    border-color: var(--fb-secondary);
}

.fb-pill.is-selected {
    border-color: var(--fb-primary);
    background: linear-gradient(135deg, var(--fb-primary), var(--fb-secondary));
    color: #fff;
    box-shadow: var(--fb-shadow-md);
}

.fb-pill.is-selected .fb-pill-dot { background: #fff; border-color: #fff; }

/* Grüner Haken im weißen Kreis der ausgewählten Antwort */
.fb-pill.is-selected .fb-pill-dot::after {
    content: "";
    display: block;
    width: 5px;
    height: 9px;
    margin-top: -1px;
    border: solid var(--fb-success);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.fb-pill-dot {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--fb-text-muted);
    background: #fff;
    transition: all .18s ease;
}

/* Zahlenskalen (kurze Labels) kompakter darstellen */
.fb-scale.fb-scale-compact .fb-pill { min-width: 56px; flex: 0 1 auto; }

/* ---------- Textfeld --------------------------------------------------- */
.fb-textarea {
    width: 100%;
    min-height: 120px;
    border: 1.5px solid var(--fb-border);
    border-radius: 12px;
    padding: .85rem 1rem;
    font-size: .95rem;
    line-height: 1.55;
    color: var(--fb-text);
    background: #fff;
    resize: vertical;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.fb-textarea:hover { border-color: #cbd5e1; }

.fb-textarea:focus {
    outline: none;
    border-color: var(--fb-secondary);
    box-shadow: 0 0 0 3px rgba(var(--fb-secondary-rgb), .18);
}

/* ---------- Dropdown --------------------------------------------------- */
.fb-select-wrap { max-width: 420px; }

.fb-select-wrap select,
.fb-select-wrap .form-control,
.fb-select-wrap .custom-select {
    border-radius: 12px !important;
    border: 1.5px solid var(--fb-border) !important;
    min-height: 46px;
    font-size: .95rem;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.fb-select-wrap select:focus,
.fb-select-wrap .form-control:focus,
.fb-select-wrap .custom-select:focus {
    border-color: var(--fb-secondary) !important;
    box-shadow: 0 0 0 3px rgba(var(--fb-secondary-rgb), .18) !important;
}

/* ---------- Klebende Fußleiste (Abschluss) ---------------------------- */
.fb-actionbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-top: 1px solid var(--fb-border);
    box-shadow: 0 -6px 20px rgba(15, 23, 42, .08);
}

.fb-actionbar-inner {
    max-width: var(--fb-maxw);
    margin-inline: auto;
    padding: .75rem clamp(.75rem, 3vw, 1.25rem);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.fb-actionbar-status {
    flex: 1 1 auto;
    min-width: 0;
    font-size: .84rem;
    color: var(--fb-text-muted);
}

.fb-actionbar-status strong { color: var(--fb-primary); }

.fb-submit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    border: 0;
    border-radius: 12px;
    padding: .8rem 1.6rem;
    font-weight: 700;
    font-size: .98rem;
    color: #fff;
    background: linear-gradient(135deg, var(--fb-success), #43a047);
    box-shadow: 0 6px 16px rgba(46, 125, 50, .28);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.fb-submit:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(46, 125, 50, .35); }
.fb-submit:active { transform: translateY(0); }
.fb-submit:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Bestätigungs-Dialog (Abschluss) --------------------------- */
.fb-confirm {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
}

.fb-confirm-count {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: .4rem;
    font-size: 1.05rem;
    color: var(--fb-text);
}

.fb-confirm-num {
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--fb-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.fb-confirm-of { color: var(--fb-text-muted); }

.fb-confirm-open {
    margin: 0;
    color: #8a5a00;
    font-size: .92rem;
}

.fb-confirm-warning {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    text-align: left;
    background: #fff8e6;
    border: 1px solid #ffe6a8;
    border-left: 4px solid #f0ad4e;
    border-radius: var(--fb-radius-sm);
    padding: .85rem 1rem;
    color: #6b4e00;
    font-size: .92rem;
    line-height: 1.5;
}

.fb-confirm-warning i {
    flex: 0 0 auto;
    color: #f0ad4e;
    font-size: 1.15rem;
    margin-top: .1rem;
}

/* ---------- Responsiv -------------------------------------------------- */
@media (max-width: 640px) {
    .fb-scale .fb-pill { min-width: 100%; }
    .fb-scale.fb-scale-compact .fb-pill { min-width: 48px; }
    .fb-progress-title { font-size: .86rem; }
    .fb-progress-badge .fb-pct { font-size: 1.15rem; }
    .fb-hero { margin-top: 1rem; }
    .fb-actionbar-status { display: none; }
    .fb-submit { flex: 1 1 auto; justify-content: center; }
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
    .fb-page, .fb-progress-fill, .fb-pill, .fb-submit, .fb-group { animation: none !important; transition: none !important; }
}
