/* Umfragen – eigenes Stylesheet, keine externen Abhängigkeiten.
   Richtung: warmes, kühl getöntes Papier + Waldgrün + Mono-Labels. */

:root {
  --ink:        #16241d;
  --paper:      #eceff0;
  --surface:    #ffffff;
  --surface-2:  #f6f8f6;
  --forest:     #1f6f4a;
  --forest-deep:#124d33;
  --forest-soft:#e4f0e9;
  --amber:      #d99a2b;
  --line:       #d7ded8;
  --line-soft:  #e6ebe6;
  --muted:      #5e6d64;
  --danger:     #b23b3b;
  --danger-soft:#f7e6e6;

  --radius:   14px;
  --radius-s: 9px;
  --shadow:   0 1px 2px rgba(20,40,30,.05), 0 8px 24px -12px rgba(20,40,30,.18);
  --shadow-sm:0 1px 2px rgba(20,40,30,.06);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  font-size: 16px;
}

a { color: var(--forest-deep); }

/* --- Eyebrow / Mono-Labels: das durchgehende Signaturelement --- */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: 30px; font-weight: 700; margin: 0 0 6px; }
h2 { font-size: 20px; font-weight: 650; margin: 0 0 4px; }

/* --- Topbar --- */
.topbar {
  background: var(--ink);
  color: #eef2ee;
  border-bottom: 3px solid var(--forest);
}
.topbar-inner {
  max-width: 1040px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; gap: 16px;
}
.brand {
  font-family: var(--mono); font-weight: 600; letter-spacing: .04em;
  color: #eef2ee; text-decoration: none; font-size: 15px;
  display: flex; align-items: center; gap: 9px;
}
.brand .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--forest);
  box-shadow: 0 0 0 3px rgba(31,111,74,.25);
}
.topbar .spacer { flex: 1; }
.topbar a.navlink { color: #c7d3cb; text-decoration: none; font-size: 14px; }
.topbar a.navlink:hover { color: #fff; }

/* --- Layout --- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 30px 22px 80px; }
.wrap-narrow { max-width: 720px; }

.pagehead { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 26px; }
.pagehead .spacer { flex: 1; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 14px; font-weight: 550;
  padding: 10px 16px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; transition: .12s ease;
  white-space: nowrap;
}
.btn:hover { border-color: #c3ccc4; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--forest); border-color: var(--forest); color: #fff;
}
.btn-primary:hover { background: var(--forest-deep); border-color: var(--forest-deep); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { color: var(--danger); border-color: var(--line); }
.btn-danger:hover { background: var(--danger-soft); border-color: #e2b7b7; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* --- Cards --- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px 24px; }

/* --- Dashboard-Liste --- */
.survey-list { display: flex; flex-direction: column; gap: 12px; }
.survey-row {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 22px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  transition: .12s ease;
}
.survey-row:hover { border-color: var(--forest); box-shadow: var(--shadow); }
.survey-row .title { font-weight: 650; font-size: 17px; }
.survey-row .meta { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 3px; }
.survey-row .spacer { flex: 1; }
.stat-pill {
  font-family: var(--mono); font-size: 12px; color: var(--forest-deep);
  background: var(--forest-soft); padding: 5px 11px; border-radius: 20px;
  white-space: nowrap;
}

.badge {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 6px;
}
.badge-open   { background: var(--forest-soft); color: var(--forest-deep); }
.badge-closed { background: #ecebe6; color: #7a756a; }

/* --- Empty state --- */
.empty {
  text-align: center; padding: 64px 24px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.empty h2 { color: var(--ink); }

/* --- Forms --- */
label.field-label { display: block; font-weight: 600; margin-bottom: 6px; }
.req { color: var(--danger); margin-left: 3px; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; font: inherit; color: var(--ink);
  padding: 11px 13px; border: 1px solid var(--line);
  border-radius: var(--radius-s); background: var(--surface);
  transition: .12s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(31,111,74,.14);
}
textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
.help-text { color: var(--muted); font-size: 14px; margin: 4px 0 0; }

/* --- Builder --- */
.builder-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.q-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 18px 20px; position: relative;
}
.q-card .q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.q-type-tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--forest-deep);
  background: var(--forest-soft); padding: 4px 9px; border-radius: 6px;
}
.q-card .q-head .spacer { flex: 1; }
.icon-btn {
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  width: 30px; height: 30px; border-radius: 7px; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.q-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.q-row > * { flex: 1; min-width: 180px; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; flex: 0 0 auto; min-width: 0; }
.checkbox-inline input { width: auto; }
.options-editor { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.option-line { display: flex; gap: 8px; align-items: center; }
.option-line input { flex: 1; }

.add-q-bar {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 16px;
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--surface-2); margin-top: 4px;
}

.sticky-actions {
  position: sticky; bottom: 0; margin-top: 24px;
  background: linear-gradient(to top, var(--paper) 68%, transparent);
  padding: 14px 0 4px; display: flex; gap: 10px; align-items: center;
}
.save-state { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.save-state.saved { color: var(--forest-deep); }

.share-box {
  display: flex; gap: 8px; align-items: center; margin-top: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 8px 8px 8px 12px;
}
.share-box code { font-family: var(--mono); font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Sterne-Rating (Signatur) --- */
.stars { display: inline-flex; gap: 6px; }
.star {
  cursor: pointer; font-size: 30px; line-height: 1; color: #cfd6cf;
  background: none; border: none; padding: 2px; transition: transform .08s ease, color .08s ease;
}
.star:hover { transform: scale(1.12); }
.star.on { color: var(--amber); }
.star:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; border-radius: 4px; }
.rating-scale-labels { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted); max-width: 230px; margin-top: 4px; }

/* --- Öffentliches Formular --- */
.form-hero {
  background: var(--surface); border: 1px solid var(--line);
  border-top: 5px solid var(--forest);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 30px 30px 26px; margin-bottom: 18px;
}
.form-hero .desc { white-space: pre-wrap; color: #2c3a32; margin-top: 10px; }
.privacy-note {
  font-size: 13px; color: var(--muted); margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.q-public {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 22px 26px; margin-bottom: 14px;
}
.q-public.error { border-color: #e2b7b7; box-shadow: 0 0 0 3px var(--danger-soft); }
.q-public h3 { font-size: 17px; margin: 0 0 4px; }
.q-public .q-help { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.field-error { color: var(--danger); font-size: 13px; margin-top: 8px; display: none; }
.q-public.error .field-error { display: block; }
.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 11px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer;
  transition: .1s ease;
}
.choice:hover { background: var(--surface-2); }
.choice.selected { border-color: var(--forest); background: var(--forest-soft); }
.choice input { width: auto; }

.submit-bar { margin-top: 22px; display: flex; align-items: center; gap: 14px; }
.done-screen { text-align: center; padding: 60px 24px; }
.done-screen .big { font-size: 46px; margin-bottom: 8px; }

/* --- Ergebnisse --- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 26px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.kpi .num { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.kpi .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

.result-q { margin-bottom: 16px; }
.result-q .rq-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.result-q .rq-head h3 { font-size: 17px; margin: 0; }
.result-q .rq-avg {
  font-family: var(--mono); font-size: 13px; color: #fff;
  background: var(--forest); padding: 3px 10px; border-radius: 20px; margin-left: auto;
}
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; }
.bar-label { font-family: var(--mono); font-size: 13px; width: 130px; flex: 0 0 130px; color: var(--muted); text-align: right; }
.bar-track { flex: 1; background: var(--surface-2); border-radius: 6px; height: 26px; overflow: hidden; border: 1px solid var(--line-soft); }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--forest), var(--forest-deep)); border-radius: 6px 0 0 6px; min-width: 2px; transition: width .5s ease; }
.bar-fill.amber { background: linear-gradient(90deg, #e7b64e, var(--amber)); }
.bar-count { font-family: var(--mono); font-size: 13px; width: 66px; flex: 0 0 66px; color: var(--ink); }

.text-answers { display: flex; flex-direction: column; gap: 8px; }
.text-answer { padding: 11px 14px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--radius-s); }
.text-answer .ta-time { font-family: var(--mono); font-size: 11px; color: var(--muted); }

table.resp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.resp-table th, table.resp-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); }
table.resp-table th { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

/* --- Login --- */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { text-align: center; }
.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand .dot { display: inline-block; width: 13px; height: 13px; border-radius: 50%; background: var(--forest); box-shadow: 0 0 0 4px rgba(31,111,74,.2); margin-bottom: 12px; }

.alert { padding: 11px 14px; border-radius: var(--radius-s); font-size: 14px; margin-bottom: 14px; }
.alert-error { background: var(--danger-soft); color: #7d2a2a; border: 1px solid #e2b7b7; }

.tabs { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.tab { padding: 9px 14px; font-size: 14px; cursor: pointer; border: none; background: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: inherit; }
.tab.active { color: var(--forest-deep); border-bottom-color: var(--forest); font-weight: 600; }

/* --- Toast --- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #eef2ee; padding: 12px 20px; border-radius: 10px;
  font-size: 14px; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: .2s ease; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  h1 { font-size: 25px; }
  .wrap { padding: 22px 16px 70px; }
  .form-hero { padding: 24px 20px; }
  .q-public { padding: 18px 18px; }
  .bar-label { width: 92px; flex-basis: 92px; }
  .survey-row { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
