/* ═══════════════════════════════════════════════════════════════════════
   CHAT UND HINWEIS
   ───────────────────────────────────────────────────────────────────────
   Zwei Bauteile, die auf jeder Seite liegen: die Sprechblase unten rechts
   und der Datenschutzhinweis unten links.

   Bewusst ohne Abhängigkeit von styles.css oder landing.css — diese Datei
   läuft auch auf den Magazinen, also auf fremden Seiten mit unbekanntem
   CSS. Alle Werte stehen deshalb ausgeschrieben, alle Klassen tragen das
   Präfix `msc-`, und jede Regel setzt zurück, was eine fremde Seite
   vererben könnte.
   ═══════════════════════════════════════════════════════════════════════ */

.msc,
.msc *,
.msc *::before,
.msc *::after {
    box-sizing: border-box;
}

.msc {
    --msc-blau: #1a5fa8;
    --msc-blau-dunkel: #14487f;
    --msc-blau-tint: #e8f0fb;
    --msc-tiefe: #0c1e33;
    --msc-tinte: #131d29;
    --msc-grau: #5c6879;
    --msc-linie: #dde5ee;
    --msc-weiss: #ffffff;

    position: fixed;
    z-index: 2147483000;   /* über allem, auch über fremden Kopfleisten */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--msc-tinte);
    text-align: left;
    letter-spacing: normal;
    -webkit-font-smoothing: antialiased;
}

/* `:where()` nimmt diesem Zurücksetzen die Spezifität. Ohne das schlägt
   `.msc button` (Klasse + Element) jede spätere Klassenregel und erzwingt
   `color: inherit` — die Sprechblase bekam dadurch dunkle Schrift auf
   blauem Grund statt der vorgesehenen weißen. */
.msc :where(button, input, textarea) {
    font: inherit;
    color: inherit;
    margin: 0;
}

/* ── Sprechblase ─────────────────────────────────────────────────────── */
.msc-blase {
    right: 20px;
    bottom: 20px;
}

.msc-blase__knopf {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px 14px 17px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    background: var(--msc-blau);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 6px 24px rgba(12, 30, 51, .26);
    transition: background .2s ease, transform .16s ease, box-shadow .2s ease;
}
.msc-blase__knopf:hover {
    background: var(--msc-blau-dunkel);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(12, 30, 51, .32);
}
.msc-blase__knopf:focus-visible {
    outline: 3px solid rgba(58, 138, 222, .55);
    outline-offset: 3px;
}
.msc-blase__knopf svg { width: 22px; height: 22px; flex: none; }

/* Auf schmalen Geräten nur das Zeichen — der Text nimmt sonst die halbe
   Breite und steht über dem Inhalt. */
@media (max-width: 560px) {
    .msc-blase__text { display: none; }
    .msc-blase__knopf { padding: 15px; }
}

/* Der kleine Punkt, der Aufmerksamkeit holt, ohne zu blinken. */
.msc-blase__punkt {
    position: absolute;
    top: 8px; right: 12px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #e0313e;
    border: 2px solid #fff;
}
.msc-blase--offen .msc-blase__punkt { display: none; }

/* ── Fenster ─────────────────────────────────────────────────────────── */
.msc-fenster {
    right: 20px;
    bottom: 20px;
    width: min(380px, calc(100vw - 32px));
    max-height: min(620px, calc(100vh - 40px));
    display: flex;
    flex-direction: column;
    background: var(--msc-weiss);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(12, 30, 51, .3);
    overflow: hidden;
    opacity: 0;
    transform: translateY(14px) scale(.98);
    pointer-events: none;
    transition: opacity .24s ease, transform .24s ease;
}
.msc-fenster--offen {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.msc-kopf {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 16px 18px;
    background: var(--msc-tiefe);
    color: #fff;
    flex: none;
}
.msc-kopf__kreis {
    width: 38px; height: 38px; flex: none;
    border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, .12);
    font-weight: 700; font-size: 14px;
    overflow: hidden;
}
.msc-kopf__kreis--bild { background: none; }
.msc-kopf__kreis img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    border-radius: 50%;
}
.msc-kopf__wer { flex: 1; min-width: 0; }
.msc-kopf__name {
    font-weight: 650; font-size: 14.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Bewusst kein grüner „online“-Punkt: Es sitzt niemand rund um die Uhr
   im Chat, und ein Statuslicht, das etwas anderes behauptet, ist die
   erste Enttäuschung noch vor der ersten Nachricht. */
.msc-kopf__lage {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: rgba(232, 240, 251, .72); margin-top: 1px;
    /* Bei 380px Fensterbreite bricht eine zweite Zeile hier immer unschön —
       lieber kürzen als umbrechen. */
    white-space: nowrap; overflow: hidden;
}
.msc-kopf__lage::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%;
    background: #3a8ade; flex: none;
}
.msc-kopf__zu {
    width: 32px; height: 32px; flex: none;
    border: 0; border-radius: 8px; cursor: pointer;
    background: transparent; color: rgba(255, 255, 255, .75);
    display: grid; place-items: center;
    transition: background .2s ease, color .2s ease;
}
.msc-kopf__zu:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.msc-kopf__zu svg { width: 18px; height: 18px; }

/* ── Verlauf ─────────────────────────────────────────────────────────── */
.msc-verlauf {
    flex: 1;
    min-height: 120px;
    overflow-y: auto;
    padding: 20px 18px 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f7fafd;
    scroll-behavior: smooth;
}

.msc-zeile { display: flex; }
.msc-zeile--du { justify-content: flex-end; }

.msc-sprech {
    max-width: 84%;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 14.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    animation: msc-auf .3s ease both;
}
.msc-sprech--wir {
    background: var(--msc-weiss);
    border: 1px solid var(--msc-linie);
    border-bottom-left-radius: 4px;
    color: var(--msc-tinte);
}
.msc-sprech--du {
    background: var(--msc-blau);
    color: #fff;
    border-bottom-right-radius: 4px;
}

@keyframes msc-auf {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* Die drei Punkte, während „jemand schreibt“. */
.msc-tippt {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 14px 16px;
    background: var(--msc-weiss);
    border: 1px solid var(--msc-linie);
    border-radius: 14px; border-bottom-left-radius: 4px;
}
.msc-tippt i {
    width: 7px; height: 7px; border-radius: 50%;
    background: #b6c2d1;
    animation: msc-huepf 1.3s infinite ease-in-out;
}
.msc-tippt i:nth-child(2) { animation-delay: .18s; }
.msc-tippt i:nth-child(3) { animation-delay: .36s; }

@keyframes msc-huepf {
    0%, 62%, 100% { transform: none; opacity: .45; }
    32%           { transform: translateY(-5px); opacity: 1; }
}

/* ── Eingabe ─────────────────────────────────────────────────────────── */
.msc-eingabe {
    flex: none;
    padding: 14px 16px 16px;
    border-top: 1px solid var(--msc-linie);
    background: var(--msc-weiss);
}

.msc-feld + .msc-feld { margin-top: 10px; }
.msc-feld label {
    display: block;
    font-size: 11.5px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--msc-grau); margin-bottom: 5px;
}
.msc-feld input,
.msc-feld textarea {
    display: block;
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--msc-linie);
    border-radius: 9px;
    background: var(--msc-weiss);
    font-size: 15px;   /* unter 16px zoomt iOS beim Fokus hinein */
    resize: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.msc-feld textarea { min-height: 76px; line-height: 1.5; }
.msc-feld input:focus,
.msc-feld textarea:focus {
    outline: none;
    border-color: var(--msc-blau);
    box-shadow: 0 0 0 3px rgba(26, 95, 168, .14);
}
.msc-feld input::placeholder,
.msc-feld textarea::placeholder { color: #9aa7b6; }
.msc-feld--fehler input,
.msc-feld--fehler textarea { border-color: #e0313e; }

.msc-paar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.msc-paar .msc-feld + .msc-feld { margin-top: 0; }

/* Einwilligung — nicht vorangekreuzt, § 7 UWG. */
.msc-haken {
    display: flex; gap: 9px; align-items: flex-start;
    margin-top: 12px;
    font-size: 12.5px; line-height: 1.5; color: var(--msc-grau);
    cursor: pointer;
}
.msc-haken input {
    width: 17px; height: 17px; flex: none; margin-top: 1px;
    accent-color: var(--msc-blau); cursor: pointer;
}
.msc-haken a { color: var(--msc-blau); }

.msc-senden {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; margin-top: 12px;
    padding: 13px 18px;
    border: 0; border-radius: 9px; cursor: pointer;
    background: var(--msc-blau); color: #fff;
    font-size: 15px; font-weight: 650;
    transition: background .2s ease, opacity .2s ease;
}
.msc-senden:hover:not(:disabled) { background: var(--msc-blau-dunkel); }
.msc-senden:disabled { opacity: .55; cursor: default; }

.msc-fehler {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fdeaec;
    color: #a81825;
    font-size: 13px;
    line-height: 1.5;
}

.msc-fuss {
    margin-top: 11px;
    font-size: 11.5px;
    color: #9aa7b6;
    text-align: center;
}
.msc-fuss a { color: #7e8b9b; }

/* Honeypot: für Menschen unsichtbar, für Bots ein Feld wie jedes andere.
   Kein `display:none` — manche Bots überspringen versteckte Felder. */
.msc-falle {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important; height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ── Datenschutzhinweis unten links ──────────────────────────────────── */
/* Bewusst flach und schmal. Ein hoher Kasten unten links liegt auf fast
   jeder Seite genau über dem wichtigsten Knopf — und ein Hinweis, der die
   Handlung verdeckt, kostet mehr, als er nützt. Text und Knopf stehen
   deshalb nebeneinander statt untereinander. */
.msc-hinweis {
    left: 20px;
    bottom: 20px;
    width: min(430px, calc(100vw - 32px));
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px 12px 16px;
    background: var(--msc-weiss);
    border: 1px solid var(--msc-linie);
    border-radius: 10px;
    box-shadow: 0 10px 32px rgba(12, 30, 51, .16);
    animation: msc-auf .4s .5s ease both;
}
.msc-hinweis__text {
    flex: 1;
    font-size: 12.5px; line-height: 1.5; color: var(--msc-grau); margin: 0;
}
.msc-hinweis__text a { color: var(--msc-blau); }
.msc-hinweis__knopf {
    flex: none;
    padding: 9px 16px;
    border: 0; border-radius: 7px; cursor: pointer;
    background: var(--msc-blau); color: #fff;
    font-size: 13.5px; font-weight: 650;
    transition: background .2s ease;
}
.msc-hinweis__knopf:hover { background: var(--msc-blau-dunkel); }

/* Auf schmalen Geräten stünden Hinweis und Sprechblase übereinander.
   Der Hinweis rutscht dann über die volle Breite und lässt unten Platz. */
@media (max-width: 640px) {
    .msc-hinweis {
        left: 12px; right: 12px; bottom: 92px;
        width: auto;
    }
    .msc-blase { right: 12px; bottom: 12px; }
    .msc-fenster { right: 12px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .msc-sprech, .msc-hinweis { animation: none; }
    .msc-tippt i { animation: none; opacity: .6; }
    .msc-fenster { transition: none; }
    .msc-blase__knopf:hover { transform: none; }
}
