/* =========================================================
   Anamnesebogen – Praxis Dr. Scheunchen
   WordPress-safe, scoped CSS
   Stand: cleaned / consolidated
   ========================================================= */

/* =========================================================
   Base container / design tokens
   ========================================================= */

.anamnese-app {
  /* Markengrün der Website (Theme kieferorthopaedie-nuertingen: a, .btn-primary, h1). */
  --c-green: #85b233;
  /* Dunklere Ableitung derselben Farbe für Text auf Weiß und Hover-Zustände. */
  --c-green-dark: #5c7b23;
  /* Heller Ton, identisch mit der Füllfarbe im Bericht (anamnese-pdf.php). */
  --c-green-light: #eef6e2;
  --c-text: #1f2a24;
  --c-muted: #6b7770;
  --c-border: #d6dcd7;
  --c-bg: #ffffff;
  --c-bg-alt: #f7f9f7;
  --c-error: #c0392b;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-strong: 0 4px 16px rgba(0, 0, 0, 0.08);
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;

  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.5;
  border-radius: var(--radius);
  box-shadow: var(--shadow-strong);
  -webkit-font-smoothing: antialiased;
}

.anamnese-app,
.anamnese-app * {
  box-sizing: border-box;
}

@media (max-width: 599px) {
  .anamnese-app {
    max-width: 100%;
    padding: 18px;
    border-radius: 0;
    box-shadow: none;
  }
}

/* =========================================================
   Header / intro
   ========================================================= */

.anamnese-app .anamnese-header {
  border-bottom: 3px solid var(--c-green);
  padding-bottom: 12px;
  margin-bottom: 24px;
}

.anamnese-app .anamnese-header h1 {
  margin: 0;
  color: var(--c-green-dark);
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.anamnese-app .anamnese-subtitle {
  margin: 6px 0 0;
  color: var(--c-muted);
  font-size: 16px;
  line-height: 1.4;
}

.anamnese-app .anamnese-intro {
  margin-bottom: 24px;
  padding: 16px 18px;
  background: var(--c-green-light);
  border-left: 4px solid var(--c-green);
  border-radius: var(--radius);
  font-size: 16px;
  line-height: 1.6;
}

/* Ab Schritt 2 blendet anamnese-form.js die Begrüßung aus.
   Explizite Regel, damit ein Theme mit eigener p-Regel das nicht überstimmt. */
.anamnese-app .anamnese-intro[hidden] {
  display: none;
}

@media (max-width: 599px) {
  .anamnese-app .anamnese-header h1 {
    font-size: 28px;
  }

  .anamnese-app .anamnese-subtitle,
  .anamnese-app .anamnese-intro {
    font-size: 15px;
  }
}

/* =========================================================
   Progress
   ========================================================= */

.anamnese-app .anamnese-progress {
  margin-bottom: 24px;
}

.anamnese-app .anamnese-progress-bar {
  height: 8px;
  background: var(--c-border);
  border-radius: 999px;
  overflow: hidden;
}

.anamnese-app .anamnese-progress-bar > span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--c-green);
  transition: width 0.3s ease;
}

.anamnese-app .anamnese-progress-steps {
  display: none;
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  justify-content: space-between;
  counter-reset: step;
}

.anamnese-app .anamnese-progress-steps li {
  flex: 1;
  position: relative;
  padding-top: 28px;
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.25;
  text-align: center;
}

.anamnese-app .anamnese-progress-steps li::before {
  content: counter(step);
  counter-increment: step;
  position: absolute;
  top: 0;
  left: 50%;
  width: 22px;
  height: 22px;
  line-height: 22px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--c-border);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.anamnese-app .anamnese-progress-steps li.active {
  color: var(--c-green-dark);
  font-weight: 700;
}

.anamnese-app .anamnese-progress-steps li.active::before {
  background: var(--c-green);
}

.anamnese-app .anamnese-progress-steps li.done::before {
  background: var(--c-green-dark);
}

@media (min-width: 600px) {
  .anamnese-app .anamnese-progress-steps {
    display: flex;
  }
}

/* =========================================================
   Steps
   ========================================================= */

.anamnese-app .step {
  display: none;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.anamnese-app .step.active {
  display: block;
  animation: anamneseFade 0.2s ease;
}

.anamnese-app .step > legend {
  width: 100%;
  margin-bottom: 18px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-green-dark);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
}

.anamnese-app .step h3 {
  margin: 28px 0 12px;
  color: var(--c-green-dark);
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
}

.anamnese-app .step h3 small {
  color: var(--c-muted);
  font-size: 14px;
  font-weight: 400;
}

@media (max-width: 599px) {
  .anamnese-app .step > legend {
    font-size: 24px;
  }

  .anamnese-app .step h3 {
    font-size: 18px;
  }
}

@keyframes anamneseFade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* =========================================================
   Fields
   ========================================================= */

.anamnese-app label {
  display: block;
  margin-bottom: 12px;
  color: var(--c-text);
  font-size: 16px;
  line-height: 1.4;
}

.anamnese-app label small {
  display: block;
  margin-top: 2px;
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.4;
}

.anamnese-app input[type="text"],
.anamnese-app input[type="email"],
.anamnese-app input[type="tel"],
.anamnese-app input[type="date"],
.anamnese-app input[type="number"],
.anamnese-app select,
.anamnese-app textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--c-text);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.anamnese-app textarea {
  min-height: 110px;
  resize: vertical;
}

.anamnese-app input:focus,
.anamnese-app select:focus,
.anamnese-app textarea:focus {
  outline: none;
  border-color: var(--c-green);
  box-shadow: 0 0 0 3px rgba(133, 178, 51, 0.28);
}

.anamnese-app input.error,
.anamnese-app select.error,
.anamnese-app textarea.error {
  border-color: var(--c-error);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

/* Native radio/checkbox controls stay native.
   No appearance:none here, to avoid theme/browser glitches. */
.anamnese-app input[type="radio"],
.anamnese-app input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--c-green);
  vertical-align: middle;
}

/* =========================================================
   Grid layouts
   ========================================================= */

.anamnese-app .grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

@media (min-width: 600px) {
  .anamnese-app .grid-2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .anamnese-app .grid-3-1 {
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  }
}

/* =========================================================
   Yes/no groups
   ========================================================= */

.anamnese-app .yes-no {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--c-bg-alt);
  border-radius: var(--radius);
}

.anamnese-app .yes-no-label {
  flex: 1 1 100%;
  font-size: 16px;
  line-height: 1.4;
}

.anamnese-app .yes-no label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  line-height: 1.3;
  cursor: pointer;
}

@media (min-width: 600px) {
  .anamnese-app .yes-no-label {
    flex: 1 1 auto;
  }
}

/* =========================================================
   Radio groups
   ========================================================= */

.anamnese-app .radio-group {
  margin: 0 0 12px;
  padding: 12px 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}

.anamnese-app .radio-group legend {
  padding: 0 8px;
  color: var(--c-text);
  font-size: 16px;
  line-height: 1.4;
  font-weight: 500;
}

.anamnese-app .radio-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  line-height: 1.4;
  cursor: pointer;
}

.anamnese-app .radio-group label:last-child {
  margin-bottom: 0;
}

/* =========================================================
   Checkbox rows and checkbox cards
   ========================================================= */

/* Container for short checkbox cards such as "Daumen gelutscht". */
.anamnese-app .check-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (min-width: 600px) {
  .anamnese-app .check-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Default checkbox card.
   Uses grid so the checkbox and text are always aligned.
   Works with direct label text and with <span class="checkbox-text">. */
.anamnese-app label.checkbox {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  min-height: 52px;
  margin: 0 0 12px;
  padding: 12px 16px;
  background: var(--c-bg-alt);
  border-radius: var(--radius);
  color: var(--c-text);
  font-size: 16px;
  line-height: 1.4;
  cursor: pointer;
}

.anamnese-app .check-row label.checkbox {
  width: 100%;
  margin-bottom: 0;
}

.anamnese-app label.checkbox.required {
  background: var(--c-green-light);
}

.anamnese-app label.checkbox input[type="checkbox"] {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  position: static;
  transform: none;
}

.anamnese-app label.checkbox .checkbox-text,
.anamnese-app label.checkbox > span {
  grid-column: 2;
  display: block;
  min-width: 0;
  line-height: 1.45;
}

.anamnese-app label.checkbox strong {
  font-weight: 700;
}

.anamnese-app label.checkbox a {
  color: var(--c-green-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Long consent checkboxes: checkbox at the top, text flows next to it. */
.anamnese-app label.checkbox.checkbox-long {
  align-items: start;
  padding: 14px 16px;
}

.anamnese-app label.checkbox.checkbox-long input[type="checkbox"] {
  align-self: start;
  margin-top: 3px;
}

.anamnese-app label.checkbox.checkbox-long .checkbox-text {
  line-height: 1.5;
}

.anamnese-app .required-marker {
  color: var(--c-error);
  font-weight: 700;
}

/* =========================================================
   Conditional reveal
   ========================================================= */

.anamnese-app .conditional {
  display: none;
  margin-bottom: 12px;
  padding: 12px;
  border-left: 3px solid var(--c-green);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--c-green-light);
}

.anamnese-app .conditional.visible {
  display: block;
  animation: anamneseFade 0.15s ease;
}

/* =========================================================
   Info / hints
   ========================================================= */

.anamnese-app .info-box {
  margin-bottom: 12px;
  padding: 12px 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-bg-alt);
  font-size: 14px;
  line-height: 1.5;
}

.anamnese-app .info-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--c-green-dark);
}

.anamnese-app .info-box ul {
  margin: 0;
  padding-left: 1.2em;
}

.anamnese-app .info-box li {
  margin-bottom: 4px;
}

/* Einzelner Punkt einer Info-Box, der besonders auffallen soll.
   Nicht über <strong> gelöst, weil .info-box strong der Kastentitel ist
   (display:block, grün) und den Punkt aus dem Fluss reißen würde. */
.anamnese-app .info-box li.emphasis {
  color: var(--c-text);
  font-weight: 700;
}

.anamnese-app .hint {
  margin: 0 0 8px;
  color: var(--c-muted);
  font-size: 14px;
  line-height: 1.5;
}

.anamnese-app hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--c-border);
}

/* =========================================================
   Signature
   ========================================================= */

.anamnese-app .signature-block {
  margin-bottom: 16px;
}

.anamnese-app .signature-label {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.4;
}

.anamnese-app .signature-label small {
  color: var(--c-muted);
}

.anamnese-app #signaturePad {
  display: block;
  width: 100%;
  height: 220px;
  background: #fff;
  border: 2px dashed var(--c-border);
  border-radius: var(--radius);
  touch-action: none;
  cursor: crosshair;
}

.anamnese-app #signaturePad.active {
  border-color: var(--c-green);
  border-style: solid;
}

.anamnese-app .signature-actions {
  margin-top: 4px;
  text-align: right;
}

/* =========================================================
   Buttons / form navigation
   ========================================================= */
.anamnese-app .btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 160px;
  width: 160px;
  height: 52px;
  min-height: 52px;

  padding: 0 22px;
  border: 0;
  border-radius: var(--radius);

  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;

  text-align: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.anamnese-app .btn:active {
  transform: translateY(1px);
}

.anamnese-app .btn-primary {
  background: var(--c-green);
  color: #fff;
}

.anamnese-app .btn-primary:hover {
  background: var(--c-green-dark);
}

.anamnese-app .btn-secondary {
  border: 1px solid var(--c-border);
  background: var(--c-bg-alt);
  color: var(--c-text);
}

.anamnese-app .btn-secondary:hover {
  background: var(--c-border);
}

.anamnese-app .btn-link {
  min-height: 0;
  padding: 4px 8px;
  background: transparent;
  color: var(--c-muted);
  font-size: 14px;
}

.anamnese-app .btn-link:hover {
  color: var(--c-error);
}

.anamnese-app .btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.anamnese-app .anamnese-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--c-border);
}

.anamnese-app .anamnese-nav .btn {
  flex: 0 0 160px;
}

@media (min-width: 600px) {
  .anamnese-app .anamnese-nav .btn {
    flex: 0 0 160px;
    min-width: 160px;
  }
}

/* =========================================================
   Status / success
   ========================================================= */

.anamnese-app .form-status {
  min-height: 1.2em;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.anamnese-app .form-status.error {
  color: var(--c-error);
}

.anamnese-app .form-status.success {
  color: var(--c-green-dark);
}

.anamnese-app .success-screen {
  padding: 32px 16px;
  text-align: center;
}

.anamnese-app .success-screen h2 {
  margin: 0 0 12px;
  color: var(--c-green-dark);
  font-size: 30px;
  line-height: 1.2;
}

/* =========================================================
   Honeypot
   ========================================================= */

.anamnese-app .anamnese-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* =========================================================
   Print
   ========================================================= */

@media print {
  .anamnese-app {
    box-shadow: none;
  }

  .anamnese-app .anamnese-nav,
  .anamnese-app .anamnese-progress,
  .anamnese-app .signature-actions {
    display: none;
  }

  .anamnese-app .step {
    display: block !important;
    page-break-inside: avoid;
  }

  .anamnese-app .conditional {
    display: block !important;
  }

  /* Im Ausdruck gehört die Anrede wieder aufs Blatt. */
  .anamnese-app .anamnese-intro[hidden] {
    display: block !important;
  }
}

/* ---------- Signature canvas interaction fix ---------- */

.anamnese-app #signaturePad {
  display: block;
  width: 100%;
  height: 220px;
  background: #ffffff !important;
  border: 2px dashed var(--c-border);
  border-radius: var(--radius);
  touch-action: none;
  pointer-events: auto;
  cursor: crosshair;
}

.anamnese-app #signaturePad.active {
  border-color: var(--c-green);
  border-style: solid;
}

/* ---------- Final nav button alignment fix ---------- */

.anamnese-app .anamnese-nav {
  align-items: center;
}

.anamnese-app .anamnese-nav .btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 160px;
  height: 52px;
  min-width: 160px;
  min-height: 52px;
  max-height: 52px;

  padding: 0 22px;
  margin: 0;

  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;

  appearance: none;
  -webkit-appearance: none;
}

.anamnese-app .anamnese-nav .btn-primary {
  border: 1px solid var(--c-green-dark);
  background: var(--c-green);
  color: #fff;
}

.anamnese-app .anamnese-nav .btn-secondary {
  border: 1px solid var(--c-border);
  background: var(--c-bg-alt);
  color: var(--c-text);
}
