/* =====================
   Variablen & Basis
   ===================== */

:root {
  --glass-bg:
    radial-gradient(40% 40% at 50% 52%, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.55) 55%, rgba(255,255,255,0) 70%),
    radial-gradient(120% 120% at 30% 30%, #ffffff 0%, #eef7ff 40%, #dbeeff 70%, #cfe6ff 100%);

  --glass-border: 2px solid rgba(70,130,180,0.35);

  --glass-shadow:
    inset 0 2px 8px rgba(255,255,255,0.9),
    inset 0 -10px 20px rgba(70,130,180,0.18),
    0 10px 24px rgba(17,63,102,0.22);

  --text-color: #0f2542;
  --link-color: #0b63ff;
  --link-hover: #084bc5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(to top, #87ceeb 0%, #b0e0e6 50%, #ffffff 100%);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  color: var(--text-color);
}

/* Links */

a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--link-hover);
  text-decoration: underline;
}

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

.site-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 21px 32px 0;
  backdrop-filter: blur(6px);
}

.logo {
  height: 150px;
  flex-shrink: 0;
}

.header-actions {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  padding-left: 230px;
}

.back-link {
  width: 150px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 10px;
  color: #0f2542;
  font-weight: bold;
  font-size: 22px;
  text-decoration: none;
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  text-shadow:
    0 1px 0 rgba(255,255,255,0.7),
    0 0 6px rgba(15,37,66,0.22);
  animation: float 6s ease-in-out infinite;
  transition: transform .15s ease, color .15s ease;
}

.back-link:hover {
  color: #ff4500;
  transform: translateY(-2px);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

/* =====================
   Hauptinhalt
   ===================== */

.page-main {
  padding: 40px 24px;
  flex: 1 0 auto;
}

.content-box {
  max-width: 1000px;
  margin: 20px auto;
  padding: 32px;
  border-radius: 24px;
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  color: var(--text-color);
}

/* Bilder in Content-Box immer flexibel */

.content-box img:not(.no-fluid) {
  display: block;
  max-width: 100%;
  height: auto;
}

/* =====================
   Formular
   ===================== */

.form-glass {
  width: 100%;
}

.form-rows {
  margin: 0;
  padding: 0;
  border: 0;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

.field {
  display: flex;
  flex-direction: column;
}

.span-2 {
  grid-column: 1 / -1;
}

label {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(70,130,180,0.35);
  background: rgba(255,255,255,0.9);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
  font-size: 16px;
  color: var(--text-color);
}

textarea {
  resize: vertical;
}

input::placeholder {
  color: rgba(15,37,66,0.55);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.btn-primary,
.btn-ghost {
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
}

.btn-primary {
  border: 2px solid rgba(70,130,180,0.35);
  background: radial-gradient(100% 100% at 30% 20%, #ffffff 0%, #eef7ff 50%, #dbeeff 100%);
  box-shadow: var(--glass-shadow);
  color: #0f2542;
}

.btn-primary:hover {
  color: #ff4500;
}

.btn-ghost {
  border: 2px dashed rgba(70,130,180,0.35);
  background: rgba(255,255,255,0.6);
  color: #0f2542;
}

.btn-ghost:hover {
  border-style: solid;
}

/* =====================
   Kombi: Date + Alter
   ===================== */

.date-age-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(70,130,180,0.35);
  background: rgba(255,255,255,0.96);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
  min-width: 0;
}

.date-age-wrap input[type="date"] {
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0;
  font-size: 16px;
  line-height: 1;
  color: var(--text-color);
  outline: none;
  flex: 1 1 auto;
  min-width: 0;
}

.age-badge {
  font-weight: 600;
  color: var(--text-color);
  white-space: nowrap;
  flex: 0 0 auto;
}

/* =====================
   Bilder
   ===================== */

img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 0;
}

.img-fluid {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 20px auto;
  border: none;
  opacity: 1;
  transition: opacity 1s ease-in-out;
}

.kursdaten {
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
}

/* =====================
   Date / Number
   ===================== */

input[type="date"],
input[type="number"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(70,130,180,0.35);
  background: rgba(255,255,255,0.9);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
  font-size: 16px;
  color: var(--text-color);
}

.field > input[type="date"],
.field > input[type="number"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(70,130,180,0.35);
  background: rgba(255,255,255,0.9);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
  font-size: 16px;
  color: var(--text-color);
}

/* Geburtsdatum in Kombibox bleibt randlos */

.field.date-age .date-age-wrap input[type="date"] {
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0;
  outline: none;
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
}

/* =====================
   Checkbox + Text
   ===================== */

.checkbox-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  line-height: 1.4;
  text-align: left;
}

.checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}

.field.span-2.checkbox-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
}

.field.span-2.checkbox-row label {
  margin: 0;
  display: block;
  flex: 1 1 0;
  min-width: 0;
  white-space: normal;
  word-break: break-word;
  text-align: left;
}

/* =====================
   Modal
   ===================== */

.doc-modal {
  display: none;
  border: 0;
  padding: 0;
  background: transparent;
}

.doc-modal[open] {
  display: flex;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 2vh;
  z-index: 10000;
  background: transparent;
}

.doc-modal::backdrop {
  background: rgba(0,0,0,.55);
}

.doc-modal[open]::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: -1;
}

.doc-modal-inner {
  aspect-ratio: 210 / 297;
  width: min(90vw, 210mm, calc(90vh * 210 / 297));
  height: auto;
  max-height: 90vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  overflow: hidden;
  position: relative;
  display: block;
}

.doc-image,
.doc-pdf {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border: 0;
}

.doc-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: .65rem 1rem;
  background: #fafafa;
  border-top: 1px solid #eee;
  text-align: center;
  font-size: .95rem;
}

.doc-actions .sep {
  margin: 0 .5rem;
  color: #999;
}

.doc-close {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.85);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

/* =====================
   A11y Helper
   ===================== */

.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
  white-space: nowrap;
}

/* =====================
   Optionale Kleinigkeiten
   ===================== */

.sex-group {
  display: flex;
  gap: 16px;
}

.chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}

/* =====================
   Honeypot / Hidden Fields
   ===================== */

.honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  visibility: hidden;
}

.honeypot,
.honeypot input,
input[name="firma_hp"],
input[name="FormularTitel"],
input[type="hidden"] {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
}

/* =====================
   Kursdaten-Bereich ohne Tabelle
   ===================== */

.kursdaten-box h1 {
  margin-top: 0;
  margin-bottom: 24px;
  color: var(--text-color);
}

.kursstart {
  font-size: clamp(1.05em, 1.4vw, 1.25em);
  font-weight: 500;
  margin: 0 0 26px;
  line-height: 1.45;
  color: var(--text-color);
}

.kurs-info-block {
  margin-top: 28px;
}

.kurs-info-block h2 {
  font-size: clamp(1.05em, 1.3vw, 1.25em);
  font-weight: 800;
  margin: 0 0 14px;
  color: var(--text-color);
}

.kurs-zeile {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: clamp(1em, 1.2vw, 1.15em);
  line-height: 1.5;
  color: var(--text-color);
}

.kurs-name {
  font-weight: 700;
  white-space: nowrap;
}

.kurs-zeit {
  font-weight: 500;
}

.kurs-hinweis {
  margin: 0;
  font-size: clamp(1em, 1.2vw, 1.15em);
  line-height: 1.5;
  color: var(--text-color);
}

/* Mobile-Umbruch optional */

.mobile-break {
  display: none;
}

/* Letzte Content-Box optisch angleichen */

.content-box:last-of-type {
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* =====================
   Responsive
   ===================== */

@media (max-width: 780px) {
  .site-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "logo back";
    padding: 12px 16px 0;
  }

  .logo {
    grid-area: logo;
    height: 70px;
  }

  .header-actions {
    grid-area: back;
    padding-left: 0;
    justify-content: end;
  }

  .back-link {
    width: auto;
    height: auto;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 16px;
    animation: none;
  }
}

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

  .doc-modal[open] {
    padding: 0;
  }

  .doc-modal-inner {
    width: 100vw;
    height: 100vh;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 0;
  }

  .doc-image,
  .doc-pdf {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .doc-close {
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 600px) {
  .page-main {
    padding: 28px 16px;
  }

  .content-box {
    padding: 24px 20px;
    border-radius: 22px;
  }

  .date-age .age-badge {
    display: none;
  }

  .date-age .date-age-wrap {
    gap: 0.25rem;
  }

  .mobile-break {
    display: inline;
  }

  .kursdaten-box h1 {
    font-size: 1.8em;
    margin-bottom: 20px;
  }

  .kursstart {
    font-size: 1.05em;
    margin-bottom: 24px;
  }

  .kurs-info-block {
    margin-top: 24px;
  }

  .kurs-info-block h2 {
    font-size: 1.08em;
    margin-bottom: 12px;
  }

  .kurs-zeile {
    grid-template-columns: 1fr;
    gap: 2px;
    margin-bottom: 16px;
    font-size: 1em;
  }

  .kurs-name {
    font-weight: 800;
  }

  .kurs-zeit {
    padding-left: 0;
  }

  .kurs-hinweis {
    font-size: 1em;
  }
}