:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #eef3f8;
  --text: #17202a;
  --muted: #5f6f7d;
  --line: #dce4ec;
  --accent: #135d66;
  --accent-strong: #0d454c;
  --accent-soft: #e3f2f3;
  --result-bg: #102f35;
  --result-soft: #eaf4f5;
  --danger: #9f2d2d;
  --shadow: 0 18px 55px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.intro {
  max-width: 760px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1.02;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.intro p:last-child,
.section-heading p {
  color: var(--muted);
  font-size: 1.02rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 22px;
  align-items: start;
}

.briefing-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.briefing-form {
  padding: 22px;
}

.result-panel {
  position: sticky;
  top: 20px;
  padding: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--result-bg) 0, #17454d 178px, var(--surface) 178px);
  border: 1px solid rgba(16, 47, 53, 0.28);
  border-radius: 8px;
  box-shadow: 0 22px 65px rgba(16, 47, 53, 0.18);
}

.section-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.section-heading span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.field-list {
  display: grid;
  gap: 18px;
}

.field-step {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(260px, 1.02fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(23, 32, 42, 0.045);
}

.field-step:last-child {
  border-bottom: 1px solid var(--line);
}

.field-step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
  opacity: 0.75;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 1.02rem;
}

.field small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cbd7e3;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}

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

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(19, 93, 102, 0.14);
}

.explain-box {
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid rgba(19, 93, 102, 0.1);
}

.explain-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-strong);
}

.explain-box p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.explain-box p:last-child {
  margin-bottom: 0;
}

.tip {
  color: var(--text);
  font-weight: 800;
}

.optional-panel {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.optional-panel summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid #cbd7e3;
  font-weight: 800;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.optional-panel summary:hover,
.optional-panel[open] summary {
  background: var(--accent-soft);
  border-color: rgba(19, 93, 102, 0.35);
}

.optional-panel summary::after {
  content: "+";
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 1.25rem;
  font-weight: 900;
}

.optional-panel[open] summary::after {
  content: "-";
}

.optional-panel summary::-webkit-details-marker {
  display: none;
}

.optional-panel small {
  color: var(--muted);
  font-weight: 600;
}

.optional-fields {
  margin-top: 18px;
}

.result-header {
  min-height: 120px;
  margin: -22px -22px 0;
  padding: 22px;
  color: #fff;
}

.result-header .eyebrow {
  color: #aee2e5;
}

.result-header h2 {
  color: #fff;
}

.result-header .ghost-button {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.result-header .ghost-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.result-header .ghost-button:disabled {
  opacity: 0.72;
}

.result-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.result-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.actions {
  margin-top: 24px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 12px 16px;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.ghost-button:hover {
  background: var(--surface-soft);
}

.status-message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--muted);
}

.status-message.error {
  color: var(--danger);
  font-weight: 700;
}

.empty-state {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #c7dfe2;
  border-radius: 8px;
  background: var(--result-soft);
  color: #315b62;
  font-weight: 650;
}

.empty-state::before {
  content: "Bereit fuer dein Ergebnis";
  display: block;
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 900;
}

.empty-hint {
  margin-top: 10px;
  color: #5d7880;
  font-size: 0.92rem;
  font-weight: 600;
}

.text-button {
  display: inline;
  width: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover {
  background: transparent;
  color: var(--accent);
}

.result-content {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.result-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.result-card p:last-child,
.result-card li:last-child {
  margin-bottom: 0;
}

.result-card ul,
.result-card ol {
  margin: 0;
  padding-left: 20px;
}

.plan-step,
.objection,
.kpi-item {
  margin-bottom: 12px;
}

.plan-step strong,
.objection strong,
.kpi-item strong {
  display: block;
  margin-bottom: 2px;
}

.kpi-item {
  padding: 12px;
  border-radius: 8px;
  background: var(--result-soft);
}

.kpi-item p {
  color: #315b62;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
  padding: 18px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer nav {
  display: flex;
  gap: 16px;
}

a {
  color: var(--accent-strong);
}

.site-footer a,
.back-link {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover,
.back-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-page {
  width: min(820px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.legal-page h1 {
  margin-top: 24px;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.legal-page section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.legal-page p {
  color: var(--muted);
}

.legal-note {
  margin-top: 28px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 24px 0;
  }

  .briefing-form,
  .result-panel {
    padding: 16px;
  }

  .result-header {
    margin: -16px -16px 0;
    padding: 16px;
  }

  .field-step {
    grid-template-columns: 1fr;
  }

  .actions,
  .result-header,
  .result-actions,
  .optional-panel summary,
  .site-footer,
  .site-footer nav {
    align-items: stretch;
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
