/* Anmeldeformular & Adminbereich */
.form-wrapper {
  padding: var(--padding);
  padding-top: 0;
}

.signup-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 2rem;
  max-width: 1000px;
}

.field,
.field-check {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field span,
.field-check span {
  font-size: 16px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field input,
.field select,
.field textarea,
.login-form input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-size: 16px;
  color: #202020;
  background: var(--light-color);
  border: 2px solid transparent;
  border-radius: 8px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.login-form input:focus {
  outline: none;
  border-color: var(--primery-color);
}

.field-check {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
}

.field-check input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--primery-color);
  flex-shrink: 0;
}

.field-check span {
  flex: 1;
}

.field-check small {
  flex-basis: 100%;
}

.has-error input,
.has-error select,
.has-error textarea {
  border-color: #ff6b6b;
}

.has-error small,
.form-message-error p {
  color: #ff8a8a;
  font-size: 14px;
}

.signup-form button,
.login-form button,
.admin-table button {
  border: none;
  cursor: pointer;
  color: #202020;
}

.signup-form button:hover,
.login-form button:hover {
  color: var(--primery-color);
}

.form-message {
  max-width: 1000px;
  margin-bottom: 1.5rem;
}

.form-message-success {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-message-success h3 {
  color: var(--primery-color);
}

/* Honeypot */
.hp {
  position: absolute;
  left: -9999px;
}

@media only screen and (max-width: 940px) {
  .form-wrapper {
    padding: var(--padding-mobile);
    padding-top: 0;
  }

  .signup-form {
    grid-template-columns: 1fr;
  }
}

/* Admin */
.admin-body {
  padding: 2rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.admin-header h2 {
  font-size: 48px;
  text-align: left;
  padding: 0;
}

.admin-header .actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.admin-header .actions button {
  margin: 0;
}

.admin-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.admin-filter + :not(.admin-filter) {
  margin-top: 1.5rem;
}

.admin-filter a {
  font-size: 15px;
  padding: 0.35rem 0.9rem;
  border-radius: 99px;
  border: 1px solid #666;
}

.admin-filter span {
  font-size: 14px;
  color: #aaa;
  min-width: 120px;
  align-self: center;
}

.admin-filter a.active {
  background: var(--primery-color);
  border-color: var(--primery-color);
  color: #202020;
}

.admin-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-stats a {
  background: #202020;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 14px;
  border: 2px solid transparent;
}

.admin-stats a:hover,
.admin-stats a.active {
  border-color: var(--primery-color);
  color: var(--light-color);
}

.admin-stats strong {
  font-size: 22px;
  display: block;
  color: var(--primery-color);
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #202020;
  border-radius: 8px;
}

.admin-table th,
.admin-table td {
  font-size: 14px;
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid #333;
}

.admin-table th {
  color: var(--primery-color);
  white-space: nowrap;
}

.admin-table td small {
  font-size: 13px;
  color: #aaa;
  display: block;
}

.admin-table td.bemerkung {
  max-width: 260px;
  white-space: pre-wrap;
}

.admin-table form {
  display: inline;
}

.admin-table button {
  display: inline-flex;
  height: auto;
  margin: 0 0.25rem 0.25rem 0;
  padding: 0.35rem 0.75rem;
  font-size: 13px;
  border-radius: 99px;
}

.admin-table button.secondary {
  background: #555;
  color: var(--light-color);
}

.admin-table button.danger {
  background: #ff6b6b;
}

.badge {
  font-size: 13px;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  white-space: nowrap;
}

.badge-offen { background: #f5c451; color: #202020; }
.badge-bestaetigt { background: var(--primery-color); color: #202020; }
.badge-abgelehnt { background: #ff6b6b; color: #202020; }

.login-form {
  max-width: 360px;
  margin: 15vh auto 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-form h2 {
  font-size: 48px;
}

/* Turnierbestimmungen */
.rules ul,
.rules ol {
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rules li {
  font-size: 16px;
  line-height: 140%;
}

.rules li ul,
.rules li ol {
  margin-top: 0.5rem;
  gap: 0.3rem;
}

.rules li::marker {
  color: var(--primery-color);
}

.rules p {
  line-height: 140%;
}

.rules-table {
  border-collapse: collapse;
}

.rules-table th,
.rules-table td {
  font-size: 16px;
  text-align: left;
  padding: 0.4rem 2rem 0.4rem 0;
  border-bottom: 1px solid #555;
}

.rules-table th {
  color: var(--primery-color);
  font-weight: 500;
}

.rules-closing {
  margin-top: 2.5rem;
}

.rules > button {
  margin-top: 2.5rem;
}

a.link {
  font-size: inherit;
  color: var(--primery-color);
  text-decoration: underline;
}

/* Admin: Navigation, Hinweise, Mail-Vorlagen */
.admin-nav {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #555;
}

.admin-nav a {
  font-size: 16px;
  padding: 0.5rem 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.admin-nav a.active {
  border-color: var(--primery-color);
  color: var(--primery-color);
}

.flash {
  background: var(--primery-color);
  color: #202020;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 15px;
}

.flash-error {
  background: #ff6b6b;
}

.mail-vorlagen {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: 1000px;
}

.mail-vorlage {
  background: #202020;
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mail-vorlage h3 {
  color: var(--primery-color);
  font-size: 24px;
}

.mail-vorlage .meta {
  font-size: 14px;
  color: #aaa;
}

.mail-vorlage textarea {
  font-family: "Roboto Mono", monospace;
  font-size: 14px;
  line-height: 150%;
}

.mail-vorlage .buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.mail-vorlage .buttons button {
  margin: 0;
}

.mail-vorlage .buttons button.secondary {
  background: #555;
  color: var(--light-color);
}

.mail-vorlage details summary {
  cursor: pointer;
  font-size: 15px;
  color: var(--primery-color);
}

.mail-vorschau {
  margin-top: 0.75rem;
  background: var(--light-color);
  color: #202020;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-size: 14px;
  white-space: pre-wrap;
}

.mail-vorschau strong {
  font-size: 14px;
  display: block;
  margin-bottom: 0.75rem;
}

.platzhalter {
  font-size: 14px;
  color: #ccc;
  line-height: 170%;
}

.platzhalter code {
  font-size: 14px;
  color: var(--primery-color);
}

/* Datenschutz: Einwilligungsformular */
.einwilligung {
  border: 1px solid #666;
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
}

.einwilligung-zeile {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.einwilligung-zeile span,
.einwilligung-check span {
  flex: 1;
  min-width: 200px;
  display: inline-block;
  border-bottom: 1px solid currentColor;
  height: 1.2em;
}

.einwilligung-check {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media print {
  body * {
    visibility: hidden;
  }

  body {
    background: #fff;
  }

  .einwilligung-druck,
  .einwilligung-druck * {
    visibility: visible;
    color: #000 !important;
  }

  .einwilligung-druck {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  }

  .einwilligung-druck h2 {
    font-size: 22px;
    text-align: left;
    padding: 0 0 1rem;
  }

  .einwilligung {
    border: none;
    padding: 0;
    gap: 1.4rem;
  }

  .einwilligung-zeile {
    padding-top: 1rem;
  }
}

/* Admin: Altersklassen */
.altersklassen-table td {
  vertical-align: middle;
}

.altersklassen-table .badge {
  display: inline-block;
  margin-bottom: 0.4rem;
}

.altersklassen-table form {
  display: block;
}

.link-cell {
  min-width: 420px;
}

.link-cell input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  font-size: 13px;
  border-radius: 6px;
  border: none;
  margin-bottom: 0.4rem;
  background: var(--light-color);
  color: #202020;
}

.link-cell form {
  display: inline !important;
}

/* Mobile: Seitenköpfe (Anmeldung, Impressum, Turnierbestimmungen, Datenschutz) */
@media only screen and (max-width: 940px) {
  .impressum-header {
    padding: var(--padding-mobile);
    padding-bottom: 2rem;
    margin-top: 4rem;
  }

  .impressum-header h1 {
    font-size: clamp(2.5rem, 13vw, 80px);
    hyphens: manual;
    overflow-wrap: break-word;
  }

  .impressum-content {
    margin: var(--padding-mobile);
    margin-top: 0;
  }

  .impressum-contact-info {
    padding: var(--padding-mobile);
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  .impressum-contact-info div {
    flex-direction: column;
    gap: 0.25rem;
    padding-bottom: 1.5rem;
  }

  .impressum-contact-info h4 {
    min-width: 0;
  }

  .rules-table th,
  .rules-table td {
    padding-right: 1rem;
  }
}

/* Impressum: Link auf hellem Hintergrund */
.impressum-contact-info a.impressum-mail {
  font-size: inherit;
  color: #202020;
  text-decoration: underline;
}

.impressum-header h1 + p {
  margin-top: 0.75rem;
}

.platzhalter strong {
  font-size: inherit;
  color: var(--light-color);
}
