/* ====================================================================
   FARBEN & GRUNDEINSTELLUNGEN
   Hier kannst du ganz oben die Hauptfarbe der Seite ändern.
   ==================================================================== */
:root {
  --color-primary: #0a6cb8;      /* Hauptfarbe (Schwimmbad-Blau) */
  --color-primary-dark: #07517f;
  --color-bg: #eef4f8;
  --color-card: #ffffff;
  --color-text: #1d2b36;
  --color-text-light: #5b6b76;
  --color-border: #d7e2e8;
  --color-danger: #d1495b;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  /* Verhindert, dass iOS/Android Texte beim Drehen eigenmächtig vergrößert */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Bedienung per Finger: keine grauen Blitzer beim Antippen, und Felder
   mit mindestens 16px Schrift, damit iOS beim Hineintippen nicht zoomt. */
button, label, select, input[type="checkbox"], input[type="radio"] {
  -webkit-tap-highlight-color: rgba(10,108,184,0.12);
}

input, select, textarea, button {
  font-size: max(1rem, 16px);
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* ====================================================================
   KOPFBEREICH / LOGOS
   ==================================================================== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.header-text {
  flex: 1;
  text-align: center;
}

.header-text h1 {
  font-size: 1.4rem;
  margin: 0 0 6px;
  color: var(--color-primary-dark);
}

.header-text p {
  margin: 0;
  color: var(--color-text-light);
  font-size: 0.95rem;
}

.logo {
  height: 60px;
  max-width: 110px;
  object-fit: contain;
}

/* Das rechte Logo (logo.png) etwas größer anzeigen, damit Details erkennbar sind */
.logo-right {
  height: 90px;
  max-width: 160px;
}

/* ====================================================================
   HINWEIS-BOX
   ==================================================================== */
.notice-box {
  background: #fff8e1;
  border: 1px solid #f0d68a;
  border-left: 5px solid #d9a324;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 24px;
}

.notice-title {
  font-size: 14pt;
  font-weight: 700;
  text-decoration: underline;
  margin: 0 0 10px;
  color: var(--color-text);
}

.notice-text {
  margin: 0 0 10px;
  line-height: 1.5;
  color: var(--color-text);
  font-size: 10pt;
  text-align: justify;
}

.notice-text:last-child {
  margin-bottom: 0;
}

.notice-text-warning {
  color: var(--color-danger);
  font-weight: 700;
}

/* ====================================================================
   KARTEN / ABSCHNITTE
   ==================================================================== */
.card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.card h2 {
  font-size: 1.1rem;
  color: var(--color-primary-dark);
  margin: 0 0 16px;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 8px;
}

.hint {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-top: -8px;
  margin-bottom: 14px;
}

/* ====================================================================
   FORMULARFELDER
   ==================================================================== */
.field {
  margin-bottom: 16px;
  flex: 1;
}

.field-small {
  flex: 0 0 140px;
}

.field-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--color-text);
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
  color: var(--color-text);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(10,108,184,0.15);
}

.locked-field {
  padding: 10px 12px;
  background: #f0f4f6;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary-dark);
}

/* ====================================================================
   RADIO-OPTIONEN
   ==================================================================== */
.radio-option {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

.radio-option:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.radio-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
}

.radio-label input[type="radio"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.conditional-field {
  display: none;
  margin-top: 12px;
  margin-left: 28px;
  padding: 14px;
  background: #f5f9fb;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.conditional-field.active {
  display: block;
}

/* ====================================================================
   WETTKAMPF-TABELLE
   ==================================================================== */
.wettkampf-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}

.wettkampf-table th {
  text-align: left;
  font-size: 0.85rem;
  color: var(--color-text-light);
  padding: 4px 6px;
}

.wettkampf-table td {
  padding: 4px 6px;
}

.btn-remove {
  background: none;
  border: none;
  color: var(--color-danger);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}

.btn-remove:hover {
  color: #a1303f;
}

.btn-add {
  background: none;
  border: 1px dashed var(--color-primary);
  color: var(--color-primary);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-add:hover {
  background: rgba(10,108,184,0.08);
}

/* ====================================================================
   SPORTLER-MELDUNGEN (informative Liste)
   ==================================================================== */
.meldungen-liste {
  list-style: none;
  margin: 0;
  padding: 0;
}

.meldungen-liste li {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
}

.meldungen-liste li:last-child {
  border-bottom: none;
}

.meldungen-liste .wk-nummer {
  display: inline-block;
  min-width: 28px;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.meldungen-liste .wk-abschnitt {
  color: var(--color-text-light);
  font-size: 0.85rem;
}

/* Lauf-/Bahnzuteilung aus der LENEX-Startliste */
.wk-bahn {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 8px;
  border-radius: 10px;
  background: #e7f1f8;
  border: 1px solid #bcd9ec;
  color: var(--color-primary-dark);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ====================================================================
   WETTKAMPF-CHECKBOX-LISTE (Abmeldung einzelner Wettkämpfe)
   ==================================================================== */
.wettkampf-checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
}

.wettkampf-checkbox-item:last-child {
  border-bottom: none;
}

.wettkampf-checkbox-item input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.wettkampf-checkbox-item label {
  margin: 0;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.95rem;
}

.wettkampf-checkbox-item .wk-abschnitt-tag {
  color: var(--color-text-light);
  font-size: 0.85rem;
  font-weight: 400;
}

/* ====================================================================
   ABSENDEN-BEREICH
   ==================================================================== */
.submit-row {
  text-align: center;
  margin-top: 10px;
}

.btn-submit {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 14px 36px;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-submit:hover {
  background: var(--color-primary-dark);
}

.btn-submit:disabled {
  background: #9aa9b1;
  cursor: not-allowed;
}

.status-msg {
  margin-top: 14px;
  font-weight: 600;
}

.status-msg.success {
  color: #1c7a3e;
}

.status-msg.error {
  color: var(--color-danger);
}

.footer {
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.8rem;
  margin-top: 30px;
}

/* ====================================================================
   BESTÄTIGUNGS-POP-UP
   ==================================================================== */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.45);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.overlay.active {
  display: flex;
}

.overlay-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}

.overlay-box-wide {
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.overlay-icon {
  width: 56px;
  height: 56px;
  line-height: 56px;
  border-radius: 50%;
  background: #1c7a3e;
  color: #fff;
  font-size: 1.6rem;
  margin: 0 auto 16px;
}

.overlay-box h3 {
  margin: 0 0 12px;
  color: var(--color-primary-dark);
}

.overlay-box p {
  margin: 0 0 22px;
  line-height: 1.5;
  color: var(--color-text);
}

.overlay-box .btn-submit {
  width: 100%;
}

.stichprobe-warnung {
  background: #fdeef0;
  border: 1px solid #f2c2c9;
  border-left: 4px solid var(--color-danger);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 18px;
  text-align: left;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--color-text);
}

.stichprobe-warnung strong {
  color: var(--color-danger);
}

/* ====================================================================
   ZUGANGSDATEN MERKEN (Zugangsfenster)
   ==================================================================== */
.merken-box {
  text-align: left;
  background: #f5f9fb;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.merken-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0;
  cursor: pointer;
}

.merken-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--color-primary);
  flex: 0 0 auto;
  cursor: pointer;
}

.merken-hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--color-text-light);
}

.merken-loeschen {
  margin-top: 10px;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--color-danger);
  text-decoration: underline;
  cursor: pointer;
}

/* ====================================================================
   RESPONSIVE – Tablet und Smartphone
   ==================================================================== */

/* Tablet (Hochformat) und kleine Laptops */
@media (max-width: 900px) {
  .page {
    padding: 18px 14px 48px;
  }
  .logo {
    height: 58px;
    max-width: 100px;
  }
  .logo-right {
    height: 92px;
    max-width: 150px;
  }
  .header {
    padding: 16px 18px;
  }
  .header-text h1 {
    font-size: 1.25rem;
  }
}

/* Smartphone */
@media (max-width: 600px) {
  .page {
    padding: 12px 12px 40px;
    /* Rand bei Geräten mit Aussparung/Notch */
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  /* Titel in eigener Zeile, darunter beide Logos nebeneinander -
     so bleibt der Kopfbereich flach und das Formular schnell erreichbar. */
  .header {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
  }
  .header-text {
    order: -1;
    flex: 1 0 100%;
  }
  .logo {
    height: 44px;
    max-width: 40%;
  }
  .logo-right {
    height: 56px;
  }
  .header-text h1 {
    font-size: 1.1rem;
  }
  .header-text p {
    font-size: 0.88rem;
  }

  .card {
    padding: 16px 14px;
    margin-bottom: 14px;
  }
  .card h2 {
    font-size: 1rem;
  }
  .notice-box {
    padding: 14px 16px;
    margin-bottom: 16px;
  }
  .notice-title {
    font-size: 12.5pt;
  }
  .notice-text {
    font-size: 0.92rem;
  }
  .notice-text-small,
  .notice-text-warning {
    font-size: 0.86rem;
  }

  .field-row {
    flex-direction: column;
    gap: 0;
  }
  .field-small {
    flex: 1;
  }

  /* Größere Tippflächen für Auswahlfelder */
  .radio-label input[type="radio"],
  .wettkampf-checkbox-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
  }
  .radio-label,
  .wettkampf-checkbox-item label {
    font-size: 0.95rem;
  }
  .radio-option {
    margin-bottom: 12px;
    padding-bottom: 12px;
  }
  .wettkampf-checkbox-item {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .conditional-field {
    margin-left: 0;
    padding: 12px 10px;
  }

  .meldungen-liste li {
    font-size: 0.9rem;
  }
  .wk-bahn {
    display: inline-block;
    margin-left: 0;
    margin-top: 4px;
  }

  .btn-submit {
    width: 100%;
    padding: 15px 20px;
  }

  /* Dialoge füllen den Bildschirm besser aus */
  .overlay {
    padding: 10px;
    align-items: flex-start;
  }
  .overlay-box {
    padding: 22px 18px;
    margin-top: 10px;
  }
  .overlay-box-wide {
    max-height: calc(100vh - 20px);
  }
  .overlay-icon {
    width: 48px;
    height: 48px;
    line-height: 48px;
    font-size: 1.4rem;
  }

  .scrollbanner {
    font-size: 0.88rem;
  }
}

/* Sehr schmale Geräte */
@media (max-width: 360px) {
  .header-text h1 { font-size: 1rem; }
  .logo-right { height: 54px; }
}

/* ====================================================================
   SCROLLBANNER (Laufschrift, im Admin unter "Texte" konfigurierbar)
   ==================================================================== */
.scrollbanner {
  overflow: hidden;
  white-space: nowrap;
  padding: 10px 0;
  margin-bottom: 18px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
}

.scrollbanner-inner {
  display: inline-block;
  padding-left: 100%;
  animation-name: scrollbanner;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* Beim Drüberfahren anhalten, damit man in Ruhe lesen kann */
.scrollbanner:hover .scrollbanner-inner {
  animation-play-state: paused;
}

@keyframes scrollbanner {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Farbvarianten */
.scrollbanner-info {
  background: #e7f1f8;
  color: var(--color-primary-dark);
  border: 1px solid #bcd9ec;
}
.scrollbanner-warnung {
  background: #fff8e1;
  color: #7a5a00;
  border: 1px solid #f0d68a;
}
.scrollbanner-wichtig {
  background: #fdeef0;
  color: var(--color-danger);
  border: 1px solid #f2c2c9;
}

/* Wer Animationen reduziert haben möchte, bekommt statischen Text */
@media (prefers-reduced-motion: reduce) {
  .scrollbanner {
    white-space: normal;
    padding: 10px 16px;
  }
  .scrollbanner-inner {
    display: block;
    padding-left: 0;
    animation: none;
  }
}
