/* Client Feedback Forms (by CxLEVER) - the house components, built on the suite palette in suite.css.
   Taken from the LeadGen Engine dashboard (cxlever-leadgen-performance.html) and the Log answer page
   (cxlever-log-answer.html), 30.10.2026: buttons, fields, field errors, branded dropdowns, toast, edges.
   Tim, 30.10.2026: "Übernehme bitte komplett Corporate Style, wie das bei Dashboard gemacht wurde". */
:root {
  /* older names used in the page styles, mapped onto the suite palette (so day/night switches everything) */
  --ink: var(--fg);
  --faint: var(--muted);
  --line: var(--grid);
  --line-strong: var(--border);
  --bg-soft: var(--tile);
}
/* the dashboard's thin edge: every lime surface gets ONE light thin black edge in day mode, none at night */
html:not([data-theme="dark"]) { --edge: rgba(0,0,0,.35); }
html[data-theme="dark"] { --edge: transparent; }

* { box-sizing: border-box; margin: 0; padding: 0; }
/* the reset above also took the browser's margin:auto from <dialog>, which is what centres it (30.10.2026: the
   start window opened in the top left corner). Any dialog left gets its centring back. */
dialog { margin: auto; }
html, body { overscroll-behavior-y: none; }
/* the footer always at the very bottom, as in the dashboard and the Intake */
body {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg); font-family: var(--font);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 16px; color: var(--fg); }
svg { display: block; }

/* ── Buttons (the dashboard's .btn and .btn.primary) ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--accent-ink); background: var(--accent); color: var(--on-accent);
  border-radius: 8px; padding: 10px 16px; font-size: 14px; font-weight: 650; line-height: 1.2;
  text-decoration: none; white-space: nowrap; cursor: pointer; font-family: var(--font);
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: transparent; color: var(--accent-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { background: var(--accent); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.btn-ghost:disabled:hover { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-sm { padding: 7px 11px; font-size: 13px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-sm svg { width: 15px; height: 15px; }
a.btn, a.btn:hover { text-decoration: none; }
.linkish { border: 0; background: transparent; padding: 0; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--accent-ink); }

/* small tool buttons next to an answer (Dictate, Forward, Ask the assistant): the dashboard's plain .btn */
.tool {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: transparent;
  color: var(--fg); border-radius: 8px; padding: 8px 12px; font-size: 13px; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; transition: border-color .15s, color .15s;
}
.tool:hover, .tool.on { border-color: var(--accent-ink); color: var(--accent-ink); }
.tool svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tool.rec { color: var(--bad); border-color: var(--bad); }

/* ── Fields (the Log answer page: thin border, the ink border on focus, no thick ring) ── */
.input, .textarea {
  width: 100%; background: var(--soft); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; font-size: 16px; line-height: 1.45; color: var(--fg); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus { border-color: var(--accent-ink); box-shadow: 0 0 0 1px rgba(234,251,14,.45); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 1; }
.field { margin: 0 0 18px; min-width: 0; }
.field > label, .field > .lbl { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--fg); }
.field .opt-lbl { font-weight: 500; color: var(--muted); }
.field .hint { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
/* errors in our own style, never the browser's bubble (forms carry novalidate) */
.field .err { display: none; margin: 6px 0 0; font-size: 12.5px; font-weight: 600; color: var(--bad); }
.field.bad .err { display: block; }
.field.bad .input, .field.bad .textarea, .field.bad .bsel-field { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }

/* ── Selects and the branded dropdown (the dashboard's .select + "Branded dropdowns", 08.10.2026) ── */
.select, .bsel-field {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  border: 1px solid var(--border); background-color: var(--soft); color: var(--fg); border-radius: 8px;
  padding: 9px 34px 9px 12px; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.3; cursor: pointer; color-scheme: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23EAFB0E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
html:not([data-theme="dark"]) .select, html:not([data-theme="dark"]) .bsel-field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232E2E2E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
.select:focus { outline: none; border-color: var(--accent-ink); box-shadow: 0 0 0 1px rgba(234,251,14,.45); }
.bsel { position: relative; display: inline-block; vertical-align: middle; max-width: 100%; }
.bsel.hidden { display: none !important; }
.bsel > select { visibility: hidden; pointer-events: none; }
.bsel > .bsel-field { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsel > .bsel-field:hover { border-color: var(--accent-ink); }
.bsel > .bsel-field[aria-expanded="true"] { outline: none; border-color: var(--accent-ink); box-shadow: 0 0 0 1px rgba(234,251,14,.45);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23EAFB0E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 15 12 9 18 15'/%3E%3C/svg%3E"); }
html:not([data-theme="dark"]) .bsel > .bsel-field[aria-expanded="true"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232E2E2E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 15 12 9 18 15'/%3E%3C/svg%3E"); }
.bsel-menu, .pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 90; min-width: 100%; width: max-content;
  max-width: min(560px, calc(100vw - 16px)); max-height: 320px; overflow: auto;
  background: var(--soft); border: 1px solid var(--border); border-radius: 10px; padding: 6px;
  box-shadow: 0 14px 34px rgba(0,0,0,.18); box-sizing: border-box; text-align: left;
}
html[data-theme="dark"] .bsel-menu, html[data-theme="dark"] .pop { box-shadow: 0 14px 34px rgba(0,0,0,.45); }
.bsel-menu.up { top: auto; bottom: calc(100% + 6px); }
.bsel-menu.right, .pop.right { left: auto; right: 0; }
.bsel-menu[hidden], .pop[hidden] { display: none; }
.bsel-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: transparent; color: var(--fg);
  border: 1px solid transparent; border-radius: 7px; padding: 8px 11px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; line-height: 1.35;
}
.bsel-item:hover, .bsel-item.act { background: rgba(234,251,14,.12); color: var(--accent-ink); }
html:not([data-theme="dark"]) .bsel-item:hover, html:not([data-theme="dark"]) .bsel-item.act { background: rgba(234,251,14,.55); color: #2E2E2E; }
.bsel-item.on { color: var(--accent-ink); }
.bsel-item.on::after { content: "\2713"; margin-left: auto; padding-left: 14px; font-weight: 800; }
.bsel-lbl { min-width: 0; flex: 1; }
.bsel-sub { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--muted); }
.bsel-item:hover .bsel-sub, .bsel-item.act .bsel-sub { color: inherit; opacity: .75; }
.bsel-group { padding: 8px 11px 4px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }

/* ── Notes with the straight side bar, and the toast (the dashboard, 08.10.2026) ── */
.note { position: relative; background: var(--soft); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px 12px 24px; font-size: 14px; color: var(--muted); line-height: 1.55; }
.note b { color: var(--fg); }
.note::before, .toast::before { content: ""; position: absolute; left: 9px; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--bar, var(--accent)); box-shadow: 0 0 0 1px var(--edge); pointer-events: none; }
.note.err, .toast.err { --bar: var(--bad); }
.note.err { color: var(--fg); }
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(18px);
  background: var(--soft); border: 1px solid var(--border); color: var(--fg); padding: 11px 16px 11px 25px;
  border-radius: 10px; font-size: 13.5px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.18);
  opacity: 0; transition: .25s; z-index: 200; pointer-events: none; max-width: min(520px, 90vw);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── The Listen button (reads the question aloud). 30.10.2026, Tim: "more friendly, with focus on listening and not
   emoji" - a speaker with sound waves, the outer wave breathing softly; while it plays, moving sound bars. ── */
.avatar-wrap { position: relative; z-index: 2; float: right; display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0 0 8px 16px; }
.avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--accent); color: var(--on-accent); position: relative; display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px var(--edge), 0 4px 14px rgba(21,25,29,.10); transition: transform .15s ease; }
.avatar:hover { transform: scale(1.06); }
.avatar .spk { width: 28px; height: 28px; margin-left: 2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.avatar .spk .body { fill: currentColor; }
.avatar .spk .w2 { animation: lfWave 2.6s ease-in-out infinite; }
@keyframes lfWave { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.avatar .eq { display: none; align-items: center; gap: 3px; height: 24px; }
.avatar .eq i { display: block; width: 4px; height: 100%; border-radius: 2px; background: currentColor; transform: scaleY(.35); animation: lfEq .9s ease-in-out infinite; }
.avatar .eq i:nth-child(2) { animation-delay: -.45s; } .avatar .eq i:nth-child(3) { animation-delay: -.2s; } .avatar .eq i:nth-child(4) { animation-delay: -.7s; }
@keyframes lfEq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.avatar.speaking .spk { display: none; }
.avatar.speaking .eq { display: flex; }
.avatar .ring { position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; pointer-events: none; }
.avatar.speaking .ring { animation: lfRing 1.6s ease-out infinite; }
@keyframes lfRing { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.3); } }
.avatar-cap { font-size: 12px; font-weight: 600; color: var(--muted); max-width: 96px; text-align: center; line-height: 1.3; }
body.no-voice .avatar-wrap, body.no-voice .av3d-dock { display: none !important; }
@media (prefers-reduced-motion: reduce) { .avatar .spk .w2, .avatar .eq i, .avatar.speaking .ring, .dict-live.fallback.hearing .dict-wave i { animation: none; } .avatar .eq i { transform: scaleY(.7); } }

/* ── Inline panels (no pop-up windows): forward, e-mail, the dictation consent ── */
.inline-box { margin-top: 16px; border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px 6px; background: var(--soft); }
.inline-box h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.inline-box .lead2 { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; line-height: 1.55; }
.row-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 2px 0 12px; }
.row-actions .note { width: 100%; }

/* ── Dictation: while it listens, a red bar with a wave that follows the microphone ── */
.dict-live { display: flex; align-items: center; gap: 12px; margin: 10px 0 0; padding: 9px 14px; border: 1px solid var(--bad); border-radius: 8px; background: color-mix(in srgb, var(--bad) 6%, var(--soft)); }
.dict-live[hidden] { display: none; }
.dict-wave { display: flex; align-items: center; gap: 3px; height: 24px; color: var(--bad); flex: none; }
.dict-wave i { display: block; width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform: scaleY(.12); transition: transform .07s linear; }
.dict-live.fallback.hearing .dict-wave i { animation: lfEq .9s ease-in-out infinite; }
.dict-live.fallback.hearing .dict-wave i:nth-child(odd) { animation-delay: -.45s; } .dict-live.fallback.hearing .dict-wave i:nth-child(3n) { animation-delay: -.2s; }
.dict-msg { flex: 1; font-size: 13px; font-weight: 600; color: var(--fg); }

/* ── Small helpers ── */
.ico { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.faint { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }
.suite-name .by { font-weight: 500; color: var(--muted); }
/* a divider between the product name and the form or page name in the header (Tim, 31.10.2026: "otherwise it melts together") */
.suite-brand .suite-client:not(:empty) { position: relative; padding-left: 13px; }
.suite-brand .suite-client:not(:empty)::before { content: ""; position: absolute; left: 0; top: 50%; width: 1px; height: 16px; margin-top: -8px; background: var(--border); }
/* keyboard focus visibility (a11y), the dashboard's rule */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
html:not([data-theme="dark"]) :focus-visible { outline-color: #2E2E2E; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
