/* ============================================================
   SSRL Anmelde-Tool – App-Ergänzungen
   Baut auf season.css + pages.css des Redesigns auf.
   Nur Elemente, die es dort noch nicht gibt (Formular,
   Serien-/Fahrzeugkarten, Buttons) – im selben Stil.
   ============================================================ */

/* Grundgerüst wie die Redesign-Startseite */
body {
  margin: 0;
  padding: 2rem 1rem;
  background: #f4f4f5;
  font-family: "Poppins", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
}

.app-footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  text-align: center;
  font-size: 13px;
  color: #888;
}

/* --- Schritt-Überschrift (nutzt results-heading-Optik) ------- */
.step-title {
  font-size: 20px;
  font-weight: 600;
  color: #14110f;
  margin: 0 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #d21f24;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

.series-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #555;
  margin: 0 0 1.5rem;
  font-size: 15px;
}
.series-name-line i { color: #d21f24; }

/* --- Serien-Übersicht: dunkle Karten wie result-card -------- */
.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.series-card {
  min-width: 0;
  padding: 1.3rem 1.4rem;
  border-radius: 14px;
  background: #14110f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.series-card.is-disabled { opacity: 0.6; }
.series-card h2 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}
.series-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}
.series-meta i { color: #f2c76b; font-size: 16px; }
.series-status {
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 500;
}

/* --- Fahrzeug-Raster: dunkle Karten ------------------------- */
.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.car-card {
  padding: 0.9rem;
  border-radius: 12px;
  background: #14110f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.car-card img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #0c0a09;
}
.car-card.is-reserved img { opacity: 0.4; filter: grayscale(0.7); }

/* --- Bild vergrössern (Lightbox) ---------------------------- */
.car-card { position: relative; }

.car-card img.js-zoom,
.reg-car-preview img.js-zoom {
  cursor: zoom-in;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.car-card img.js-zoom:hover { transform: scale(1.015); }
.car-card.is-reserved img.js-zoom:hover { opacity: 0.6; }

.car-card img.js-zoom:focus-visible,
.reg-car-preview img.js-zoom:focus-visible {
  outline: 2px solid #f2c76b;
  outline-offset: 3px;
}

/* Kleine Lupe oben rechts auf dem Bild – macht sichtbar,
   dass sich das Bild vergrössern lässt (auch ohne Maus-Hover). */
.car-card::after {
  content: "";
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.55);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 15px 15px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 L20 20'/%3E%3Cpath d='M10.5 8v5M8 10.5h5'/%3E%3C/svg%3E");
  opacity: 0.5;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.car-card:hover::after { opacity: 0.95; }
.car-name {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  color: #fff;
  /* Sicherheitsnetz: bricht auch einen Namen ganz ohne Unterstrich
     oder Bindestrich um, statt ihn über die Karte hinauslaufen zu lassen. */
  overflow-wrap: anywhere;
}
.car-badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  background: rgba(242, 199, 107, 0.12);
  color: #f2c76b;
}
.car-badge-reserved {
  background: rgba(210, 31, 36, 0.15);
  color: #ff6b6f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* --- Anmeldeformular: dunkle Karten ------------------------- */
.reg-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 640px) {
  .reg-layout { grid-template-columns: 1fr; }
}
.reg-car-preview {
  padding: 1rem;
  border-radius: 12px;
  background: #14110f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
  text-align: center;
}
.reg-car-preview img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 0.6rem;
  background: #0c0a09;
}

.reg-form {
  padding: 1.5rem;
  border-radius: 12px;
  background: #14110f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
}
.reg-form label {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 6px;
}
.reg-form label .opt { color: rgba(255, 255, 255, 0.5); font-weight: 400; }
.reg-form input {
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  margin-bottom: 1.1rem;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}
/* Kleiner Hinweis direkt unter einem Formularfeld */
.reg-form .field-hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  /* zieht den Hinweis an das Feld heran (input hat 1.1rem Abstand nach unten) */
  margin: -0.85rem 0 1.1rem;
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.62);
}

.reg-form .field-hint i {
  flex: 0 0 auto;
  margin-top: 1px;
  color: #f2c76b;
  font-size: 15px;
}

.reg-form input::placeholder { color: rgba(255, 255, 255, 0.4); }
.reg-form input:focus {
  outline: none;
  border-color: #d21f24;
  background: rgba(255, 255, 255, 0.07);
}

/* --- Buttons ------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #14110f;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s;
}
.btn:hover { border-color: rgba(242, 199, 107, 0.4); background: #241d19; }
.btn i { color: #f2c76b; font-size: 16px; }

.btn-primary {
  background: #d21f24;
  border-color: #d21f24;
  color: #fff;
}
.btn-primary:hover { background: #b81a1f; border-color: #b81a1f; }
.btn-primary i { color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #d21f24;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 1rem;
}
.back-link:hover { text-decoration: underline; }

/* --- Meldungen ----------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 14px;
}
.alert i { font-size: 20px; flex-shrink: 0; }
.alert p { margin: 0.3rem 0 0; }
.alert-error {
  background: rgba(210, 31, 36, 0.08);
  border-left: 4px solid #d21f24;
  color: #8a1418;
}
.alert-success {
  background: rgba(58, 125, 58, 0.09);
  border-left: 4px solid #3a7d3a;
  color: #2b5c2b;
}
.hint {
  padding: 1.1rem 1.2rem;
  background: #fff;
  border: 1px dashed rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  color: #666;
}
.hint code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: #14110f;
}
.hint a { color: #d21f24; font-weight: 500; }
.hint ul { margin: 0.5rem 0 0.8rem 1.2rem; line-height: 1.7; }

/* --- Info-Box (Hinweis auf der Startseite) ------------------- */
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin: 1.6rem 0 0;
  padding: 1.1rem 1.2rem;
  background: #14110f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid #f2c76b;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}

.info-box-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(242, 199, 107, 0.16);
  color: #f8d08c;
  font-size: 17px;
}

.info-box-body {
  min-width: 0;
  /* Blocksatz mit Silbentrennung, damit keine Löcher entstehen */
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.info-box-lead {
  margin: 0 0 0.6rem;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.45;
  color: #f8d08c;
}

/* Zweite Zeile im Lead – etwas ruhiger als die Aufforderung darüber */
.info-box-lead-sub {
  display: inline-block;
  margin-top: 3px;
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
}

/* Zweite Variante der Box – roter Akzent für Fahrzeug-/Reglementhinweise */
.info-box--fahrzeug {
  margin-top: 1rem;
  border-left-color: #d21f24;
}
.info-box--fahrzeug .info-box-icon {
  background: rgba(210, 31, 36, 0.18);
  color: #ff8a8d;
}
.info-box--fahrzeug .info-box-lead { color: #ff8a8d; }

.info-box-list {
  margin: 0;
  padding-left: 1.1rem;
  list-style: none;
}

.info-box-list li {
  position: relative;
  margin-bottom: 5px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}

.info-box-list li:last-child { margin-bottom: 0; }

.info-box-list li::before {
  content: "";
  position: absolute;
  left: -1.1rem;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d21f24;
}

@media (max-width: 640px) {
  .info-box { padding: 1rem; gap: 0.75rem; }
  .info-box-lead { font-size: 15px; }
  /* Auf schmalen Displays passen zu wenige Wörter in eine Zeile –
     Blocksatz reisst dort grosse Lücken. Darum wieder linksbündig. */
  .info-box-body { text-align: left; }
}

select { font-family: inherit; }

/* --- Admin-Bereich ------------------------------------------ */
.admin-subhead {
  font-size: 16px;
  font-weight: 600;
  color: #14110f;
  margin: 1.5rem 0 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-subhead .num {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #d21f24;
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}

.admin-select {
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
  color: #14110f;
  font-size: 15px;
  font-family: inherit;
  min-width: 300px;
  cursor: pointer;
}
.admin-select:focus { outline: none; border-color: #d21f24; }

.admin-form-row { margin-bottom: 1.5rem; }

/* --- Teilnehmerliste in der Serienkarte (aufklappbar) ------- */
.series-participants {
  margin: 0;
}
.series-participants summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  user-select: none;
  padding: 2px 0;
}
.series-participants summary::-webkit-details-marker { display: none; }
.series-participants summary i { color: #f2c76b; font-size: 16px; }
.series-participants summary .chevron {
  margin-left: 4px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.45);
  transition: transform 0.2s;
}
.series-participants[open] summary .chevron { transform: rotate(180deg); }
.series-participants summary:hover { color: #fff; }

.participant-list {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0.7rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.participant-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  padding: 3px 0;
}
.participant-name { font-weight: 500; }
.participant-nr {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(242, 199, 107, 0.14);
  color: #f2c76b;
  flex-shrink: 0;
}
