/* ==========================================================================
   Onboarding Formular – Styling (nur für onboarding.html)
   Apple-inspiriertes Design: hell, ruhig, ein blauer Akzent.
   ========================================================================== */

:root {
    --bg: #f5f5f7;
    --card: #ffffff;
    --ink: #1d1d1f;
    --muted: #6e6e73;
    --hairline: #d2d2d7;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --error: #ff3b30;
    --radius: 18px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    padding: 48px 20px;
    overflow-x: hidden;
}

.form-wrap {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

/* --- Fortschritt --- */
.progress {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    padding: 0 4px;
}

.progress-track {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--hairline);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 14.3%;
    border-radius: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
}

/* --- Formular-Karte --- */
#Formular {
    background: var(--card);
    width: 100%;
    padding: 44px 40px;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 12px 40px rgba(0, 0, 0, 0.05);
}

/* --- Seiten (Steps) --- */
.seite {
    display: none;
    animation: fadeIn 0.35s ease;
}

.aktiv {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .seite {
        animation: none;
    }
}

/* --- Überschriften --- */
.seite h1 {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-bottom: 10px;
}

.frage-hinweis {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--muted);
    margin-bottom: 24px;
}

/* --- Eingabefelder --- */
input[type="text"],
textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    background: var(--card);
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

textarea {
    min-height: 130px;
    resize: vertical;
}

/* Feld mit Fehler */
.feld-fehler {
    border-color: var(--error) !important;
}

.fehler {
    display: none;
    font-size: 0.85rem;
    color: var(--error);
    margin-top: 8px;
}

.fehler.sichtbar {
    display: block;
}

/* --- Datei-Upload --- */
.datei-feld {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 26px 16px;
    border: 1.5px dashed var(--hairline);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.datei-feld:hover {
    border-color: var(--accent);
    background: rgba(0, 113, 227, 0.04);
}

.datei-feld input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.datei-feld:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

.datei-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--accent);
    text-align: center;
    overflow-wrap: anywhere;
}

/* --- „oder"-Trenner + Option „Avatar von KI Company" --- */
.oder-trenner {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.oder-trenner::before,
.oder-trenner::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--hairline);
}

.option-karte {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    border: 1.5px solid var(--hairline);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.option-karte:hover {
    border-color: var(--accent);
}

.option-karte:has(input:checked) {
    border-color: var(--accent);
    background: rgba(0, 113, 227, 0.05);
}

.option-karte input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.option-text {
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--muted);
}

.option-text strong {
    display: block;
    color: var(--ink);
    font-weight: 600;
    margin-bottom: 2px;
}

/* Upload-Feld ausgegraut, wenn „von KI Company erstellen" gewählt ist */
.datei-feld.deaktiviert {
    opacity: 0.45;
    pointer-events: none;
}

/* --- Gestapelte Eingabefelder (Gesprächseinleitungen) --- */
.eingabe-stapel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- Farbauswahl --- */
.farb-zeile {
    display: flex;
    align-items: center;
    gap: 16px;
}

input[type="color"] {
    width: 72px;
    height: 48px;
    padding: 3px;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    background: var(--card);
    cursor: pointer;
}

input[type="color"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

.hex-eingabe {
    width: 130px;
    padding: 12px 14px;
    font-size: 1rem;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-variant-numeric: tabular-nums;
    text-transform: uppercase;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hex-eingabe:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

/* --- Vorschau-Screenshot --- */
.vorschau {
    margin-top: 26px;
    border: 1px solid var(--hairline);
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg);
}

.vorschau figcaption {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 10px 16px;
    border-bottom: 1px solid var(--hairline);
    background: var(--card);
}

.vorschau img {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    padding: 16px;
}

.vorschau-titel {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 10px 16px;
    border-bottom: 1px solid var(--hairline);
    background: var(--card);
}

/* --- Chat-Mockup (Live-Vorschau der Akzentfarbe) --- */
.chat-mock {
    margin: 16px;
    border: 1px solid var(--hairline);
    border-radius: 16px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.07);
}

.chat-kopf {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--hairline);
}

.chat-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg);
    font-size: 1rem;
    flex-shrink: 0;
}

.chat-name {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-x {
    color: var(--muted);
    font-size: 0.85rem;
}

.chat-verlauf {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 14px;
    min-height: 150px;
}

.bot-blase,
.user-blase {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.bot-blase {
    align-self: flex-start;
    background: #f2f2f7;
    color: var(--ink);
    border-bottom-left-radius: 5px;
}

.user-blase {
    align-self: flex-end;
    background: #0071e3;
    color: #ffffff;
    border-bottom-right-radius: 5px;
    transition: background 0.15s ease, color 0.15s ease;
}

.chat-starter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.chat-starter span {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 7px 14px;
    border: 1px solid var(--hairline);
    border-radius: 980px;
    color: var(--ink);
    background: #ffffff;
}

.chat-eingabe {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 14px 14px;
    padding: 10px 14px;
    border: 1px solid var(--hairline);
    border-radius: 980px;
}

.chat-eingabe-text {
    font-size: 0.88rem;
    color: var(--muted);
}

.chat-senden {
    font-size: 0.9rem;
    color: #0071e3;
    transition: color 0.15s ease;
}

/* --- Buttons --- */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 30px;
}

.nav-buttons .btnWeiter:only-child {
    margin-left: auto;
}

button {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 30px;
    border: none;
    border-radius: 980px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

button:active {
    transform: translateY(1px);
}

button:focus-visible {
    outline: 3px solid rgba(0, 113, 227, 0.4);
    outline-offset: 2px;
}

.btnWeiter,
button[type="submit"] {
    background: var(--accent);
    color: #ffffff;
}

.btnWeiter:hover,
button[type="submit"]:hover {
    background: var(--accent-hover);
}

.btnBack {
    background: transparent;
    color: var(--accent);
}

.btnBack:hover {
    background: rgba(0, 113, 227, 0.08);
}

/* --- Responsive --- */
@media (max-width: 540px) {
    body {
        padding: 24px 14px;
    }

    #Formular {
        padding: 30px 22px;
    }

    .seite h1 {
        font-size: 1.3rem;
    }
}
