:root {
  --bg: #f4efe6;
  --bg-accent: #ead9b2;
  --surface: rgba(255, 251, 245, 0.78);
  --surface-strong: rgba(255, 248, 235, 0.92);
  --text: #1f2933;
  --muted: #5d6a72;
  --line: rgba(31, 41, 51, 0.12);
  --highlight: #b35c2e;
  --highlight-soft: rgba(179, 92, 46, 0.12);
  --shadow: 0 22px 50px rgba(68, 47, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  background:
    radial-gradient(circle at top left, rgba(179, 92, 46, 0.18), transparent 28%),
    radial-gradient(circle at right 20%, rgba(91, 121, 103, 0.16), transparent 24%),
    linear-gradient(180deg, #f8f3ec 0%, var(--bg) 52%, #efe5d4 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body), sans-serif;
}

p,
dt,
dd {
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-heading), serif;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4rem 0 5rem;
}

.gate-shell {
  display: grid;
  align-items: center;
  min-height: 100vh;
  padding-top: 2rem;
}

.gate-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 1.25rem;
  align-items: stretch;
}

.gate-panel,
.gate-side-panel,
.gate-config-status {
  background: var(--surface-strong);
}

.gate-panel {
  padding: 1.8rem;
}

.gate-copy {
  max-width: 38rem;
}

.gate-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.gate-label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.gate-note-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.gate-note {
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.gate-note h2 {
  font-size: 1.15rem;
}

.gate-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.gate-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 0.96;
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 1.5rem;
  align-items: end;
}

.hero h1 {
  font-size: clamp(3rem, 7vw, 5.8rem);
  line-height: 0.94;
  max-width: 12ch;
}

.eyebrow {
  margin-bottom: 0.75rem;
  color: var(--highlight);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lead {
  margin-top: 1.25rem;
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.65;
}

.hero-metrics,
.panel,
.subtest-item {
  backdrop-filter: blur(16px);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.hero-metrics div,
.panel,
.subtest-item {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-metrics div {
  padding: 1.15rem;
}

.hero-metrics dt {
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-metrics dd {
  margin-top: 0.45rem;
  font-size: 2rem;
  font-weight: 700;
}

.grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  padding: 1.4rem;
  background: var(--surface-strong);
}

.panel h2 {
  font-size: 1.7rem;
}

.panel-copy {
  margin-top: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
}

.subtest-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.subtest-item {
  padding: 1rem 1.05rem;
  background: white;
}

.subtest-item h3 {
  font-size: 1.2rem;
}

.subtest-item p + p {
  margin-top: 0.35rem;
}

.subtest-order {
  margin-bottom: 0.45rem;
  color: var(--highlight);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.compact h3 {
  margin-bottom: 0.55rem;
}

.evaluation-panel {
  border: 1px solid rgba(179, 92, 46, 0.3);
}

.evaluation-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.field-grid label,
.raw-card {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.68rem 0.75rem;
  background: white;
  color: var(--text);
  font: inherit;
}

input:focus {
  outline: 2px solid var(--highlight-soft);
  border-color: rgba(179, 92, 46, 0.5);
}

.raw-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.raw-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.86);
}

.raw-card span {
  color: var(--text);
}

.action-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 999px;
  background: var(--highlight);
  color: white;
  padding: 0.72rem 1.2rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

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

button.ghost {
  background: transparent;
  color: var(--highlight);
  border: 1px solid rgba(179, 92, 46, 0.4);
}

button.ghost:hover {
  background: rgba(179, 92, 46, 0.08);
}

.status {
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.status.error {
  background: rgba(174, 55, 55, 0.12);
  color: #7d1f1f;
}

.status.success {
  background: rgba(45, 122, 85, 0.14);
  color: #1f6d49;
}

.result-sheet-wrap {
  border: 1px solid rgba(111, 134, 148, 0.35);
}

.result-sheet {
  margin-top: 1rem;
  border: 1px solid #a3adb4;
  background: #fff;
  border-radius: 0;
  padding: 1rem;
  box-shadow: inset 0 0 0 1px rgba(163, 173, 180, 0.18);
}

.sheet-header {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
  border: 1px solid #aeb5bb;
  padding: 0.8rem;
  background: linear-gradient(180deg, #f7fafc 0%, #ecf2f5 100%);
}

.sheet-header h3 {
  font-size: 1.45rem;
}

.sheet-header p {
  margin-top: 0.25rem;
  color: #4f5b63;
}

.sheet-therapist {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2f3b44;
}

.sheet-header dl {
  display: grid;
  gap: 0.35rem;
}

.sheet-header dl div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0.45rem;
  border: 1px solid #c7cfd4;
  background: #fff;
  padding: 0.32rem 0.45rem;
  font-size: 0.9rem;
}

.sheet-header dt {
  color: #5c6770;
  font-weight: 700;
}

.sheet-section {
  margin-top: 1rem;
  border: 1px solid #aeb5bb;
  background: #e8edf1;
  padding: 0.42rem 0.6rem;
  font-size: 0.98rem;
  font-family: var(--font-body), sans-serif;
  letter-spacing: 0.01em;
}

.sheet-table-scroll {
  overflow-x: auto;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
  background: #fff;
}

.sheet-table th,
.sheet-table td {
  border: 1px solid #b8c1c7;
  padding: 0.42rem 0.46rem;
  font-size: 0.84rem;
}

.sheet-table thead th {
  background: #dfe7ed;
  text-align: center;
  font-weight: 700;
}

.sheet-table tbody td:first-child {
  min-width: 240px;
}

.sheet-table tbody td:not(:first-child) {
  text-align: center;
}

.sum-row {
  background: #eef3f6;
  font-weight: 700;
}

.sheet-charts {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.sheet-charts figure {
  margin: 0;
  border: 1px solid #b5bec5;
  background: #f7fafb;
  padding: 0.4rem;
}

.sheet-charts figcaption {
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: #4f5b63;
  text-transform: uppercase;
  font-weight: 700;
}

.sheet-chart {
  width: 100%;
  height: auto;
  border: 1px solid #cad2d8;
  background: #fff;
}

@media (max-width: 900px) {
  .gate-grid,
  .hero,
  .two-up,
  .sheet-header,
  .sheet-charts {
    grid-template-columns: 1fr;
  }

  .gate-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .hero h1 {
    max-width: 10ch;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 1.2rem, 1120px);
    padding-top: 2.5rem;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .panel,
  .subtest-item,
  .hero-metrics div {
    border-radius: 20px;
  }

  .gate-panel,
  .gate-side-panel {
    padding: 1.2rem;
  }

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

/* Muster B (18.10.2026): angemeldete E-Mail neben "Abmelden" */
.logout-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logout-form .panel-copy {
  margin: 0;
}
