/* =========================================================
   DSGVO Einwilligungsformular – modernes responsives Design
   Datei: /assets/css/einwilligung.css
   ========================================================= */

:root {
  --ds-bg: #f4f7fb;
  --ds-bg-soft: #eef3f8;
  --ds-card: rgba(255, 255, 255, 0.92);
  --ds-card-solid: #ffffff;

  --ds-text: #172033;
  --ds-muted: #667085;
  --ds-soft-text: #475467;

  --ds-primary: #14532d;
  --ds-primary-dark: #0f3f22;
  --ds-primary-soft: #e8f5ee;

  --ds-accent: #f59e0b;
  --ds-accent-soft: #fff7e6;

  --ds-danger: #b42318;
  --ds-danger-soft: #fff1f0;

  --ds-border: #d9e2ec;
  --ds-border-strong: #b8c4d1;

  --ds-radius-sm: 0.65rem;
  --ds-radius: 1rem;
  --ds-radius-lg: 1.35rem;

  --ds-shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.06);
  --ds-shadow: 0 18px 50px rgba(15, 23, 42, 0.10);

  --ds-max: 1120px;

  --ds-focus: 0 0 0 4px rgba(20, 83, 45, 0.16);
}

/* Grundlayout
   --------------------------------------------------------- */

body {
  background:
    radial-gradient(circle at top left, rgba(20, 83, 45, 0.12), transparent 32rem),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 30rem),
    var(--ds-bg);
  color: var(--ds-text);
}

main {
  width: min(var(--ds-max), calc(100% - 2rem));
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 3.5rem) 0;
}

/* Hero
   --------------------------------------------------------- */

.ds-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  padding: clamp(1.75rem, 5vw, 4rem);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: clamp(1.25rem, 3vw, 2rem);
  background:
    linear-gradient(135deg, rgba(20, 83, 45, 0.94), rgba(15, 63, 34, 0.96)),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.22), transparent 24rem);
  color: #fff;
  box-shadow: var(--ds-shadow);
}

.ds-hero::before {
  content: "";
  position: absolute;
  inset: auto -8rem -10rem auto;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  pointer-events: none;
}

.ds-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  margin: 0 0 1rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ds-hero h1 {
  max-width: 880px;
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 6vw, 4.35rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.ds-hero p:not(.ds-kicker) {
  max-width: 760px;
  margin: clamp(1rem, 2vw, 1.4rem) 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1rem, 2.1vw, 1.2rem);
  line-height: 1.7;
}

/* Karten
   --------------------------------------------------------- */

.ds-card {
  position: relative;
  margin: 0 0 clamp(1rem, 2.5vw, 1.5rem);
  padding: clamp(1.15rem, 3vw, 2rem);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg);
  background: var(--ds-card);
  box-shadow: var(--ds-shadow-sm);
  backdrop-filter: blur(14px);
}

.ds-card h2 {
  margin: 0 0 1rem;
  color: var(--ds-text);
  font-size: clamp(1.25rem, 2.8vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.ds-card h3 {
  margin: 1.5rem 0 0.75rem;
  color: var(--ds-text);
  font-size: 1.05rem;
  line-height: 1.3;
}

.ds-card p {
  color: var(--ds-soft-text);
  line-height: 1.65;
}

.ds-warning {
  border-color: rgba(245, 158, 11, 0.38);
  background:
    linear-gradient(135deg, rgba(255, 247, 230, 0.96), rgba(255, 255, 255, 0.94));
}

.ds-warning::before {
  content: "!";
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--ds-accent);
  color: #fff;
  font-weight: 900;
}

.ds-help {
  margin-top: -0.35rem;
  margin-bottom: 1.2rem;
  color: var(--ds-muted);
  font-size: 0.96rem;
}

/* Formularraster
   --------------------------------------------------------- */

.ds-form {
  display: block;
}

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

.ds-full {
  grid-column: 1 / -1;
}

/* Labels und Felder
   --------------------------------------------------------- */

.ds-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--ds-text);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}

.ds-form input,
.ds-form select,
.ds-form textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-sm);
  background: #fff;
  color: var(--ds-text);
  font: inherit;
  font-weight: 500;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    transform 0.18s ease;
}

.ds-form textarea {
  min-height: 7rem;
  resize: vertical;
  line-height: 1.55;
}

.ds-form select {
  cursor: pointer;
}

.ds-form input::placeholder,
.ds-form textarea::placeholder {
  color: #98a2b3;
}

.ds-form input:focus,
.ds-form select:focus,
.ds-form textarea:focus {
  border-color: var(--ds-primary);
  box-shadow: var(--ds-focus);
}

.ds-form input:hover,
.ds-form select:hover,
.ds-form textarea:hover {
  border-color: var(--ds-border-strong);
}

/* Checkbox-Kacheln
   --------------------------------------------------------- */

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

.ds-check-grid label,
.ds-single-check,
.ds-confirmations label {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-height: 3.2rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-sm);
  background: #fff;
  color: var(--ds-text);
  font-weight: 650;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.ds-check-grid label:hover,
.ds-single-check:hover,
.ds-confirmations label:hover {
  border-color: rgba(20, 83, 45, 0.42);
  background: var(--ds-primary-soft);
  transform: translateY(-1px);
}

.ds-check-grid input[type="checkbox"],
.ds-single-check input[type="checkbox"],
.ds-confirmations input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  min-height: auto;
  margin-top: 0.1rem;
  accent-color: var(--ds-primary);
  cursor: pointer;
}

.ds-check-grid label:has(input:checked),
.ds-single-check:has(input:checked),
.ds-confirmations label:has(input:checked) {
  border-color: rgba(20, 83, 45, 0.55);
  background: var(--ds-primary-soft);
  box-shadow: 0 8px 22px rgba(20, 83, 45, 0.08);
}

/* Info-Boxen
   --------------------------------------------------------- */

.ds-info-box {
  margin: 1.2rem 0;
  padding: 1.1rem;
  border: 1px solid rgba(20, 83, 45, 0.16);
  border-radius: var(--ds-radius);
  background:
    linear-gradient(135deg, rgba(232, 245, 238, 0.92), rgba(255, 255, 255, 0.95));
}

.ds-info-box h3:first-child {
  margin-top: 0;
}

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

/* Bestätigungen
   --------------------------------------------------------- */

.ds-confirmations {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.ds-confirmations label {
  border-color: rgba(20, 83, 45, 0.2);
}

/* Rollenblöcke
   --------------------------------------------------------- */

.ds-role-block {
  border-left: 5px solid var(--ds-primary);
}

.ds-role-block[hidden],
#parent2Block[hidden],
#soleCustodyBlock[hidden] {
  display: none !important;
}

#parent2Block,
#soleCustodyBlock {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px dashed var(--ds-border-strong);
  border-radius: var(--ds-radius);
  background: rgba(244, 247, 251, 0.76);
}

/* Aktionen
   --------------------------------------------------------- */

.ds-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg) var(--ds-radius-lg) 0 0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 -12px 34px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(16px);
}

.ds-actions button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ds-primary), var(--ds-primary-dark));
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  letter-spacing: -0.01em;
  padding: 0.95rem 1.35rem;
  min-height: 3rem;
  box-shadow: 0 12px 24px rgba(20, 83, 45, 0.22);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.ds-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(20, 83, 45, 0.28);
  filter: saturate(1.04);
}

.ds-actions button:focus-visible {
  outline: none;
  box-shadow: var(--ds-focus), 0 16px 30px rgba(20, 83, 45, 0.28);
}

.ds-secondary-link {
  color: var(--ds-danger);
  font-weight: 800;
  text-decoration: none;
}

.ds-secondary-link:hover {
  text-decoration: underline;
}

/* Validierung / Browser-Feedback
   --------------------------------------------------------- */

.ds-form input:required:invalid:not(:placeholder-shown),
.ds-form select:required:invalid,
.ds-form textarea:required:invalid:not(:placeholder-shown) {
  border-color: rgba(180, 35, 24, 0.55);
}

.ds-form input:disabled {
  background: #f2f4f7;
  color: #667085;
  cursor: not-allowed;
}

/* Responsive
   --------------------------------------------------------- */

@media (max-width: 860px) {
  main {
    width: min(100% - 1rem, var(--ds-max));
    padding-top: 1rem;
  }

  .ds-grid,
  .ds-check-grid {
    grid-template-columns: 1fr;
  }

  .ds-card {
    border-radius: 1.1rem;
  }

  .ds-warning::before {
    display: none;
  }

  .ds-actions {
    align-items: stretch;
    flex-direction: column;
    border-radius: 1rem 1rem 0 0;
  }

  .ds-actions button,
  .ds-secondary-link {
    width: 100%;
    text-align: center;
  }

  .ds-secondary-link {
    padding: 0.65rem 1rem;
  }
}

@media (max-width: 520px) {
  main {
    width: min(100% - 0.75rem, var(--ds-max));
  }

  .ds-hero {
    padding: 1.35rem;
    border-radius: 1.1rem;
  }

  .ds-hero h1 {
    font-size: clamp(1.85rem, 10vw, 2.65rem);
  }

  .ds-card {
    padding: 1rem;
  }

  .ds-check-grid label,
  .ds-single-check,
  .ds-confirmations label {
    padding: 0.85rem;
  }
}

/* Druckansicht
   --------------------------------------------------------- */

@media print {
  body {
    background: #fff;
  }

  main {
    width: 100%;
    padding: 0;
  }

  .ds-hero,
  .ds-card,
  .ds-actions {
    box-shadow: none;
    backdrop-filter: none;
  }

  .ds-actions {
    position: static;
  }

  .ds-actions button,
  .ds-secondary-link {
    display: none;
  }
}