/* flowwerk — Werkai-Branding: dark-mode, blau→violett-Gradient, Outfit-Display */

:root {
    /* Werk-Palette */
    --primary: #0066FF;
    --primary-dark: #0050CC;
    --primary-soft: rgba(0, 102, 255, 0.12);
    --accent: #00D4FF;
    --accent-soft: rgba(0, 212, 255, 0.12);
    --violet: #7B2FFF;
    --amber: #FFB300;
    --amber-soft: rgba(255, 179, 0, 0.14);

    /* Dark canvas */
    --bg: #080C14;
    --bg2: #0D1421;
    --card: #111827;
    --card-glass: rgba(17, 24, 39, 0.65);
    --line: #1E293B;
    --line-soft: #1a2332;

    /* Text */
    --ink: #E2E8F0;
    --ink-soft: #B0BDD0;
    --muted: #94A3B8;

    /* Status */
    --ok: #3ECF8E;
    --ok-soft: rgba(62, 207, 142, 0.14);
    --warn: #FFB300;
    --warn-soft: rgba(255, 179, 0, 0.14);
    --err: #EF4444;

    /* Form */
    --radius: 22px;
    --radius-sm: 14px;
    --radius-xs: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 8px 32px rgba(0,0,0,0.35);
    --shadow-glow: 0 0 0 1px rgba(0, 102, 255, 0.35), 0 8px 32px rgba(0, 102, 255, 0.15);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* Subtiles Grid-Pattern im Hintergrund — Werkai-Look */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 102, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 102, 255, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    background-position: center;
    pointer-events: none;
    z-index: 0;
}
main, header, footer { position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: rgba(0,212,255,0.5); }

h1, h2, h3 {
    font-family: Outfit, Inter, system-ui, sans-serif;
    letter-spacing: -0.015em;
    color: var(--ink);
}

/* TOPBAR */
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    background: var(--card-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 36px; width: auto; display: block; }
.brand-name {
    font-family: Outfit, Inter, sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--ink);
    letter-spacing: -0.5px;
}

.premium-banner {
    flex: 1;
    min-width: 280px;
    background: var(--amber-soft);
    color: var(--ink);
    border: 1px solid rgba(255, 179, 0, 0.3);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.45;
}
.premium-banner strong { color: var(--amber); margin-right: 6px; }
.premium-banner.admin-banner {
    background: var(--primary-soft);
    border-color: rgba(0, 102, 255, 0.3);
}
.premium-banner.admin-banner strong { color: var(--accent); }
.premium-banner.admin-banner a { color: var(--ink-soft); }
.premium-banner.admin-banner a:hover { color: var(--accent); }
.premium-banner.admin-banner a.nav-active {
    color: var(--accent);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* LAYOUT */
.wrap {
    max-width: 760px;
    margin: 32px auto;
    padding: 0 20px 80px;
}
.wrap.wide { max-width: 920px; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px 32px;
    margin-bottom: 22px;
}
.card.slim { padding: 26px 32px; }
.card.flash {
    padding: 14px 20px;
    border-left: 4px solid var(--ok);
    background: var(--ok-soft);
    color: var(--ok);
    font-weight: 500;
    border-color: var(--ok);
}
.card.flash.err {
    border-left-color: var(--err);
    background: rgba(239, 68, 68, 0.12);
    color: var(--err);
    border-color: rgba(239, 68, 68, 0.3);
}

h1 { font-size: 30px; margin: 0 0 12px; font-weight: 700; }
h2 { font-size: 23px; margin: 6px 0 14px; font-weight: 600; }
h3 { font-size: 17px; margin: 4px 0 8px; font-weight: 600; }

.lead { font-size: 17px; color: var(--ink-soft); margin: 6px 0 18px; }
.micro { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.muted { color: var(--muted); font-weight: 400; }
.error {
    color: var(--err);
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.3);
    padding: 10px 14px;
    border-radius: 10px;
}

/* INPUTS */
.name-form { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.name-form label {
    display: flex; flex-direction: column; gap: 6px;
    font-weight: 500; color: var(--ink-soft); font-size: 14px;
}
.name-form input[type=text], .name-form input[type=password] {
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: inherit;
    background: var(--bg2);
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.name-form input::placeholder { color: var(--muted); }
.name-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.25);
}

/* PROGRESS */
.progress {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 26px;
}
.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    width: var(--p, 11%);
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 999px;
    transition: width 0.3s ease;
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.5);
}
.progress-text {
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

/* QUESTION */
.section-label {
    display: inline-block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
    font-weight: 700;
    font-family: Outfit, Inter, sans-serif;
}
.hint { color: var(--muted); margin: -4px 0 16px; font-size: 14px; }

.resume-note {
    background: var(--amber-soft);
    border-left: 3px solid var(--amber);
    padding: 12px 16px;
    margin: 12px 0 16px;
    border-radius: var(--radius-xs);
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.5;
}
.resume-note strong { color: var(--amber); }

/* CHIPS */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 22px; }
.chip {
    appearance: none;
    border: 1.5px solid var(--line);
    background: var(--bg2);
    color: var(--ink-soft);
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.12s ease;
    user-select: none;
}
.chip:hover {
    border-color: var(--primary);
    color: var(--ink);
    background: var(--primary-soft);
}
.chip.selected {
    background: linear-gradient(135deg, var(--primary), var(--violet));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 16px rgba(0, 102, 255, 0.35);
}
.chip.selected:hover { filter: brightness(1.08); }
.chips.read .chip { cursor: default; }
.chips.read .chip.selected:hover { filter: none; }

/* FREETEXT */
.freetext label {
    display: flex; flex-direction: column; gap: 6px;
    font-size: 14px; color: var(--ink-soft); font-weight: 500;
}
.freetext textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    background: var(--bg2);
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.freetext textarea::placeholder { color: var(--muted); }
.freetext textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.25);
}

/* VOICE */
.voice-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.btn.voice {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg2);
    color: var(--ink-soft);
    border: 1.5px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}
.btn.voice:hover { border-color: var(--accent); color: var(--accent); }
.btn.voice .dot { width: 10px; height: 10px; background: var(--accent); border-radius: 999px; display: inline-block; }
.btn.voice[data-state="recording"] {
    background: rgba(239,68,68,0.14);
    border-color: var(--err);
    color: #FCA5A5;
}
.btn.voice[data-state="recording"] .dot { background: var(--err); animation: pulse 1.1s infinite; }
.btn.voice[data-state="processing"] { border-color: var(--primary); color: var(--accent); }
.btn.voice[data-state="processing"] .dot { background: var(--primary); animation: pulse 1.4s infinite; }
@keyframes pulse {
    0%   { transform: scale(1);   opacity: 1; }
    50%  { transform: scale(1.5); opacity: 0.4; }
    100% { transform: scale(1);   opacity: 1; }
}
.voice-status { font-size: 13px; color: var(--muted); }
.voice-status.err { color: var(--err); }

/* BUTTONS */
.btn {
    appearance: none;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    padding: 12px 22px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--violet));
    color: #fff;
    box-shadow: 0 0 0 1px rgba(0, 102, 255, 0.25), 0 8px 20px rgba(0, 102, 255, 0.25);
}
.btn.primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 0 0 1px rgba(0, 102, 255, 0.35), 0 10px 28px rgba(0, 102, 255, 0.35);
}
.btn.ghost {
    background: var(--bg2);
    color: var(--ink-soft);
    border-color: var(--line);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.ghost.small { padding: 7px 14px; font-size: 13px; }
.btn.ghost.small.danger { border-color: rgba(239,68,68,0.4); color: #FCA5A5; }
.btn.ghost.small.danger:hover { border-color: var(--err); background: rgba(239,68,68,0.12); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.actions {
    display: flex; justify-content: space-between; gap: 12px;
    margin-top: 28px; padding-top: 20px;
    border-top: 1px solid var(--line);
}

/* DONE / THANKYOU */
.question.done { text-align: center; padding: 20px 0; }
.question.done h2 { font-size: 28px; }

/* ADMIN TABLE */
.datatable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
    font-size: 14px;
}
.datatable th, .datatable td {
    text-align: left;
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.datatable th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-weight: 700;
    font-family: Outfit, Inter, sans-serif;
}
.datatable tr:hover td { background: var(--bg2); }
.datatable small { color: var(--muted); }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge.ok   { background: var(--ok-soft);   color: var(--ok); }
.badge.wip  { background: var(--warn-soft); color: var(--warn); }
.badge.source-walkin { background: rgba(123, 47, 255, 0.18); color: #C4B5FD; }

/* MINI-PROGRESS */
.mini-progress { display: flex; align-items: center; gap: 10px; min-width: 110px; }
.mini-bar {
    flex: 1; height: 6px; background: var(--line);
    border-radius: 999px; position: relative; overflow: hidden;
}
.mini-bar::after {
    content: ''; position: absolute; inset: 0;
    width: var(--p, 0%);
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 999px;
}
.mini-text {
    font-size: 12px; color: var(--muted);
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.section-label-inline {
    display: inline-block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 9px;
    border-radius: 999px;
    font-weight: 700;
    font-family: Outfit, Inter, sans-serif;
}

/* DETAIL VIEW */
.detail .answer { padding: 18px 0; border-bottom: 1px solid var(--line); }
.detail .answer:last-child { border-bottom: none; }
.detail blockquote {
    background: var(--bg2);
    border-left: 3px solid var(--primary);
    padding: 12px 16px;
    margin: 10px 0 0;
    border-radius: var(--radius-xs);
    color: var(--ink);
    white-space: pre-wrap;
}
.detail code {
    background: var(--bg2);
    border: 1px solid var(--line);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--accent);
}

/* LINK-GENERATOR */
.linkgen { max-width: 480px; }
.link-result {
    margin-top: 22px;
    padding: 18px 20px;
    background: var(--primary-soft);
    border: 1px solid rgba(0, 102, 255, 0.3);
    border-radius: var(--radius-sm);
}
.link-result .micro { margin: 0 0 8px; color: var(--ink-soft); font-size: 13px; }
.link-result .micro:last-child { margin: 10px 0 0; color: var(--muted); }
.link-row { display: flex; gap: 8px; align-items: stretch; }
.link-row input {
    flex: 1;
    padding: 11px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg2);
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 13px;
    color: var(--ink);
}
.link-row input:focus { outline: none; border-color: var(--accent); }
.link-row .btn { white-space: nowrap; padding: 11px 18px; }

/* INVITE LIST */
.invite-list { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.invite {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    background: var(--bg2);
}
.invite-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.invite-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.invite-name strong { font-size: 15px; color: var(--ink); }
.invite-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.invite-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* FRAGEN-EDITOR */
.qcard {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 20px 22px;
    margin: 16px 0;
    background: var(--bg2);
}
.qcard-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; gap: 8px; flex-wrap: wrap;
}
.qcard-num {
    font-weight: 700;
    color: var(--accent);
    font-size: 13px;
    background: var(--accent-soft);
    padding: 4px 12px;
    border-radius: 999px;
    font-family: Outfit, Inter, sans-serif;
    letter-spacing: 0.04em;
}
.qcard-tools { display: flex; gap: 6px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-weight: 700;
    font-family: Outfit, Inter, sans-serif;
}
.field input[type=text],
.field textarea {
    padding: 10px 13px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-family: inherit;
    background: var(--card);
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.2);
}
.editor-actions {
    display: flex; justify-content: space-between; gap: 12px;
    margin-top: 20px; padding-top: 18px;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
}

/* FOOTER */
.foot { text-align: center; color: var(--muted); padding: 24px; font-size: 12px; }
.foot .admin-link {
    color: var(--muted);
    text-decoration: none;
    opacity: 0.55;
}
.foot .admin-link:hover {
    opacity: 1;
    color: var(--accent);
}

/* RESPONSIVE */
@media (max-width: 600px) {
    .wrap { margin: 20px auto; padding: 0 12px 60px; }
    .card { padding: 22px 18px; border-radius: 18px; }
    .topbar { padding: 12px 16px; }
    .premium-banner { min-width: 0; width: 100%; font-size: 13px; }
    h1 { font-size: 25px; }
    h2 { font-size: 20px; }
    .btn { padding: 11px 18px; font-size: 14px; }
    .actions { flex-direction: row; }
    .link-row { flex-direction: column; }
    .qcard { padding: 16px 14px; }
}
