/*
 * Styles for the optional online registration / self-reported results pages.
 * Loaded only by /spendenlauf-2026/anmeldung/, /spendenlauf-2026/ergebnis/ and
 * /intern/spendenlauf/. The existing static pages are untouched.
 */

.online-page main {
  padding-bottom: 4rem;
}

.online-shell {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: 2rem;
}

.online-shell.wide {
  width: min(1120px, calc(100% - 32px));
}

.online-lead {
  font-size: 1.05rem;
  color: var(--muted);
}

.online-callout {
  border: 2px solid var(--green);
  border-radius: 10px;
  background: rgba(31, 122, 77, 0.06);
  padding: 1rem 1.1rem;
  margin: 1.5rem 0;
}

.online-callout strong {
  display: block;
  font-size: 1.05rem;
}

.online-callout p {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.online-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.online-panel > h2:first-child,
.online-panel > h3:first-child {
  margin-top: 0;
}

.field {
  display: block;
  margin-bottom: 1.1rem;
}

.field > span.label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.field .hint {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

input[aria-invalid="true"] {
  border-color: #a12525;
}

.field-row {
  display: grid;
  gap: 0 1rem;
}

@media (min-width: 620px) {
  .field-row.two {
    grid-template-columns: 1fr 1fr;
  }
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1rem 0.4rem;
  margin: 0 0 1.1rem;
}

legend {
  font-weight: 700;
  padding: 0 0.35rem;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
  line-height: 1.4;
}

.choice input {
  margin-top: 0.2rem;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.choice span small {
  display: block;
  color: var(--muted);
}

/* Honeypot: off-screen, never focusable, never announced. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

button.button {
  cursor: pointer;
  font: inherit;
}

button.button[disabled] {
  opacity: 0.55;
  cursor: progress;
}

.button.danger {
  background: #fff;
  color: #8c1f1f;
  border-color: rgba(140, 31, 31, 0.35);
}

.button.danger:hover {
  background: #fdf1f1;
  border-color: #8c1f1f;
}

.button.small {
  min-height: 38px;
  padding: 0.35rem 0.7rem;
  font-size: 0.9rem;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.status-message {
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  border: 1px solid var(--line);
  background: #fff;
}

.status-message[hidden] {
  display: none;
}

.status-message.error {
  border-color: #a12525;
  background: rgba(161, 37, 37, 0.07);
}

.status-message.success {
  border-color: var(--green);
  background: rgba(31, 122, 77, 0.08);
}

.status-message.info {
  border-color: var(--blue);
  background: rgba(40, 111, 159, 0.08);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid var(--line);
  background: #fff;
}

.badge.pending {
  border-color: var(--gold);
  background: rgba(217, 154, 35, 0.14);
}

.badge.approved {
  border-color: var(--green);
  background: rgba(31, 122, 77, 0.12);
}

.badge.finalized {
  border-color: var(--blue);
  background: rgba(40, 111, 159, 0.14);
}

.badge.rejected {
  border-color: #a12525;
  background: rgba(161, 37, 37, 0.1);
}

.participant-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.participant-list li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 620px) {
  .participant-list li {
    grid-template-columns: 1fr 8rem 7rem auto;
    align-items: center;
  }
}

.participant-list .km {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.totals-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  background: var(--green-dark);
  color: #fff;
  margin: 1.25rem 0;
}

.totals-panel div {
  display: flex;
  flex-direction: column;
}

.totals-panel strong {
  font-size: 1.75rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.totals-panel span {
  font-size: 0.85rem;
  opacity: 0.85;
}

.entry-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.entry-table caption {
  text-align: left;
  font-weight: 700;
  padding-bottom: 0.5rem;
}

.entry-table th,
.entry-table td {
  text-align: left;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.entry-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

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

.admin-entry {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 1rem;
  margin-bottom: 1rem;
}

.admin-entry header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.admin-entry header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.admin-entry dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.2rem 0.8rem;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.admin-entry dt {
  color: var(--muted);
}

.admin-entry dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.admin-edit-panel {
  margin-top: 1rem;
  padding: 0.85rem;
}

.admin-edit-panel > summary {
  cursor: pointer;
}

.admin-edit-form {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.admin-participant-rows {
  display: grid;
  gap: 0.55rem;
}

.admin-participant-row {
  display: grid;
  grid-template-columns: minmax(11rem, 2fr) minmax(9rem, 1fr) auto auto;
  gap: 0.55rem;
  align-items: center;
}

.admin-participant-row.new {
  grid-template-columns: minmax(11rem, 2fr) minmax(6rem, 0.7fr) auto;
  margin-top: 0.75rem;
}

@media (max-width: 760px) {
  .admin-participant-row,
  .admin-participant-row.new {
    grid-template-columns: 1fr;
  }
}

.link-output {
  display: block;
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.entry-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.6rem 0 0.85rem;
}

.entry-summary span {
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  background: #eef4ef;
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
}

.entry-summary small { color: var(--muted); }
.entry-details,
.entry-actions { margin-top: 0.85rem; }
.entry-details > summary,
.entry-actions > summary { cursor: pointer; font-weight: 700; }
.workflow-actions { margin-bottom: 0.75rem; }

.quick-laps-panel {
  margin: 0.75rem 0;
  padding: 0.9rem;
  border: 2px solid #c8d8cc;
  border-radius: 10px;
  background: #f5f8f5;
}

.quick-laps-panel h4 { margin: 0; font-size: 1.05rem; }
.quick-laps-total { margin: 0.35rem 0 0; font-weight: 800; color: var(--green-dark); }
.quick-laps-meta { margin: 0; color: var(--muted); font-size: 0.85rem; }
.cockpit-donations-panel > summary { cursor: pointer; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Event cockpit and public live display. */
.cockpit-kpis { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: .75rem; }
.cockpit-kpis .online-panel { margin: 0; display: grid; gap: .25rem; }
.cockpit-kpis strong { font-size: clamp(1.6rem,4vw,3rem); }
.quick-laps { display: grid; grid-template-columns: minmax(13rem,1fr) minmax(12rem,auto) auto; align-items: end; gap: .75rem; border-bottom: 1px solid #d8e0da; padding: .75rem 0; }
.quick-laps .field { margin: 0; }
.quick-laps input, .quick-laps button { min-height: 48px; }
.live-fundraising { margin-top: 1rem; text-align: center; overflow: hidden; }
.live-donation-value { display: block; color: var(--green-dark); font-size: clamp(2.8rem,8vw,6.5rem); line-height: 1; font-variant-numeric: tabular-nums; }
.live-fundraising .truck-live { max-width: 68rem; margin: 1rem auto 0; text-align: left; }
.live-fundraising .truck-live > strong { font-size: clamp(1.35rem,3vw,2.5rem); }
.live-fundraising #live-progress { font-weight: 800; }
.live-notes > summary { cursor: pointer; font-weight: 700; }
.live-ranking { list-style: none; margin: 0; padding: 0; }
.live-ranking-row {
  display: grid;
  grid-template-columns: 3.2rem minmax(12rem,2fr) repeat(3,minmax(7rem,1fr));
  gap: 0.75rem;
  align-items: center;
  margin: 0.55rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-left: 5px solid transparent;
  border-radius: 10px;
  background: var(--panel);
}
.live-ranking-row.participant-row { grid-template-columns: minmax(12rem,2fr) repeat(3,minmax(7rem,1fr)); }
.live-ranking-row.podium-1 { border-left-color: #d99a23; }
.live-ranking-row.podium-2 { border-left-color: #8a9992; }
.live-ranking-row.podium-3 { border-left-color: #a66838; }
.live-rank { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: #eef4ef; color: var(--green-dark); font-size: 1.2rem; font-weight: 900; }
.live-name { min-width: 0; overflow-wrap: anywhere; }
.live-name strong { display: block; font-size: clamp(1.15rem,2vw,1.65rem); }
.live-name small,
.live-stat small { display: block; color: var(--muted); font-size: 0.78rem; }
.live-stat { text-align: right; font-variant-numeric: tabular-nums; }
.live-stat strong { display: block; color: var(--green-dark); font-size: clamp(1.25rem,2.6vw,2.2rem); }

@media (max-width: 760px) {
  .cockpit-kpis { grid-template-columns: repeat(auto-fit,minmax(100px,1fr)); }
  .cockpit-kpis .online-panel { padding: 0.7rem; }
  .cockpit-kpis strong { font-size: 1.5rem; }
  .cockpit-tools {
    position: sticky;
    z-index: 20;
    top: 0;
    margin: 0 -0.35rem 1rem;
    padding: 0.55rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(251,250,246,0.97);
    box-shadow: 0 5px 16px rgba(17,26,21,0.08);
  }
  .cockpit-tools .field { margin: 0; }
  .cockpit-tools .filter-bar { margin: 0.4rem 0 0; }
  .cockpit-tools #export-csv { display: none; }
  .quick-laps { grid-template-columns: 1fr; }
  /* Name on top, the three figures side by side underneath. */
  .live-ranking-row,
  .live-ranking-row.participant-row {
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 0.4rem 0.6rem;
  }
  .live-ranking-row.team-row { grid-template-columns: 2.5rem repeat(3,minmax(0,1fr)); }
  .team-row .live-name { grid-column: 2 / -1; }
  .team-row .live-stat:nth-child(3) { grid-column: 2; }
  .participant-row .live-name { grid-column: 1 / -1; }
  .live-stat { text-align: left; }
  .live-stat.pledged { grid-column: -2 / -1; }
  .live-stat small { font-size: 0.7rem; }
  .live-stat strong { font-size: 1.1rem; }
  .live-fundraising .truck-road { height: 88px; }
}

/* Live display chrome: compact header and one toolbar for status and pause. */
.live-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.live-header.is-internal {
  background: var(--green-dark);
}

.live-header-inner {
  width: min(1120px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.live-header .brand img {
  width: 56px;
}

.live-header.is-internal .brand,
.live-header.is-internal a {
  color: #fff;
}

.live-header.is-internal .brand img {
  padding: 3px 5px;
  background: #fff;
  border-radius: 6px;
}

.live-page h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.live-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  padding: 0.85rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.live-toolbar p {
  margin: 0;
}

.live-toolbar #live-status {
  font-weight: 800;
  color: var(--green-dark);
}

.live-toolbar .hint {
  color: var(--muted);
  font-size: 0.85rem;
}

#live-stamp {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

#live-content > h2 {
  margin: 2.25rem 0 0.5rem;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
}

.cockpit-kpis .online-panel span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.live-fundraising > span:not(.eyebrow) {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-weight: 700;
}

.live-fundraising .eyebrow {
  display: block;
}

.live-footer-links {
  margin-top: 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.online-shell > h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.online-shell > .eyebrow + h1 {
  margin-top: 0;
}

.online-panel > summary {
  font-weight: 700;
}

.admin-entry {
  box-shadow: var(--shadow-sm, none);
}
