/* ============================================================
   ConHelfer - Farben aus dem Event Service Quang Logo
   Mobile first: Basisregeln gelten fuers Handy,
   groessere Bildschirme bekommen Erweiterungen.
   ============================================================ */

:root {
  /* Markenfarben */
  --eq-orange:        #F5623C;
  --eq-orange-dark:   #D94A28;
  --eq-orange-light:  #FF8563;
  --eq-amber:         #FBAF4B;
  --eq-amber-light:   #FDC97A;
  --eq-verlauf:       linear-gradient(135deg, #FBAF4B 0%, #F5623C 100%);

  /* Neutral (aus dem Schriftzug) */
  --eq-text:          #333333;
  --eq-text-weich:    #5F5F5F;
  --eq-text-leise:    #8A8A8A;
  --eq-linie:         #E4E4E7;
  --eq-flaeche:       #FFFFFF;
  --eq-hintergrund:   #FAFAFA;

  /* Status - bewusst entsaettigt, damit sie nicht
     mit dem Orange der Marke konkurrieren */
  --eq-ok:            #2E9E5B;
  --eq-warn:          #E0A02A;
  --eq-fehler:        #D14343;
  --eq-info:          #3B7DD8;

  /* Abstaende */
  --eq-r:             10px;   /* Eckenradius */
  --eq-r-klein:       6px;
  --eq-schatten:      0 1px 3px rgba(0,0,0,.08);
  --eq-schatten-hoch: 0 4px 14px rgba(0,0,0,.12);

  /* Mindestgroesse fuer Tippziele am Handy */
  --eq-tippziel:      44px;

  --eq-schrift: -apple-system, BlinkMacSystemFont, "Segoe UI",
                Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --eq-text:        #ECECEC;
    --eq-text-weich:  #B4B4B4;
    --eq-text-leise:  #8A8A8A;
    --eq-linie:       #3A3A3E;
    --eq-flaeche:     #1E1E22;
    --eq-hintergrund: #141417;
    --eq-schatten:      0 1px 3px rgba(0,0,0,.4);
    --eq-schatten-hoch: 0 4px 14px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }

html {
  /* Verhindert, dass iOS beim Drehen die Schrift vergroessert */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--eq-schrift);
  font-size: 16px;          /* unter 16px zoomt iOS beim Fokus in Felder */
  line-height: 1.55;
  color: var(--eq-text);
  background: var(--eq-hintergrund);
  -webkit-font-smoothing: antialiased;
}

/* Rand fuer Geraete mit Notch */
.eq-seite {
  padding: 16px;
  padding-left:  max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  max-width: 1200px;
  margin: 0 auto;
}

/* Fuer Formulare und Textinhalte. Volle Breite ist nur bei
   Tabellen und Schichtplaenen sinnvoll - ein Eingabefeld ueber
   die ganze Bildschirmbreite liest sich schlecht. */
.eq-seite--schmal { max-width: 460px; }
.eq-seite--mittel { max-width: 760px; }

/* Kopfleisteninhalt an der Seitenbreite ausrichten */
.eq-kopf__inhalt {
  width: 100%;
  max-width: var(--eq-breite, 1200px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- Kopfleiste ---------- */
.eq-kopf {
  background: var(--eq-verlauf);
  color: #fff;
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--eq-schatten);
}

.eq-kopf h1 { font-size: 1.05rem; margin: 0; font-weight: 600; }

/* ---------- Flaechen ---------- */
.eq-karte {
  background: var(--eq-flaeche);
  border: 1px solid var(--eq-linie);
  border-radius: var(--eq-r);
  padding: 16px;
  box-shadow: var(--eq-schatten);
}

/* ---------- Schaltflaechen ---------- */
.eq-knopf {
  text-decoration: none;   /* auch wenn der Knopf ein <a> ist */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--eq-tippziel);
  padding: 0 18px;
  border: none;
  border-radius: var(--eq-r-klein);
  background: var(--eq-orange);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  /* Verhindert blaues Aufblitzen beim Antippen auf Android */
  -webkit-tap-highlight-color: transparent;
  transition: background .15s ease, transform .05s ease;
}
.eq-knopf:hover  { background: var(--eq-orange-dark); }
.eq-knopf:active { transform: scale(.985); }
.eq-knopf:focus-visible {
  outline: 3px solid var(--eq-amber);
  outline-offset: 2px;
}
.eq-knopf[disabled] { opacity: .5; cursor: not-allowed; }

.eq-knopf--zweit {
  background: transparent;
  color: var(--eq-orange);
  border: 1.5px solid var(--eq-orange);
}
.eq-knopf--zweit:hover { background: rgba(245,98,60,.08); }

.eq-knopf--breit { width: 100%; }

/* ---------- Formulare ---------- */
.eq-feld {
  width: 100%;
  min-height: var(--eq-tippziel);
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;              /* nicht kleiner, sonst zoomt iOS */
  color: var(--eq-text);
  background: var(--eq-flaeche);
  border: 1px solid var(--eq-linie);
  border-radius: var(--eq-r-klein);
}
.eq-feld:focus {
  outline: none;
  border-color: var(--eq-orange);
  box-shadow: 0 0 0 3px rgba(245,98,60,.18);
}

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

/* ---------- Statusanzeigen ---------- */
.eq-marke {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
}
.eq-marke--ok    { background: rgba(46,158,91,.12);  color: var(--eq-ok); }
.eq-marke--warn  { background: rgba(224,160,42,.14); color: #9A6D0F; }
.eq-marke--fehler{ background: rgba(209,67,67,.12);  color: var(--eq-fehler); }
.eq-marke--info  { background: rgba(59,125,216,.12); color: var(--eq-info); }
.eq-marke--offen { background: rgba(245,98,60,.12);  color: var(--eq-orange-dark); }

/* ---------- Tabellen werden am Handy zu Karten ---------- */
.eq-tabelle { width: 100%; border-collapse: collapse; }
.eq-tabelle th {
  text-align: left;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--eq-text-leise);
  padding: 10px 12px;
  border-bottom: 1px solid var(--eq-linie);
}
.eq-tabelle td {
  padding: 12px;
  border-bottom: 1px solid var(--eq-linie);
}

@media (max-width: 640px) {
  .eq-tabelle thead { display: none; }
  .eq-tabelle tr {
    display: block;
    margin-bottom: 12px;
    background: var(--eq-flaeche);
    border: 1px solid var(--eq-linie);
    border-radius: var(--eq-r);
    padding: 4px 0;
  }
  .eq-tabelle td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border: none;
    padding: 8px 14px;
  }
  /* Spaltenname kommt aus data-label */
  .eq-tabelle td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--eq-text-leise);
    font-size: .82rem;
  }
}

/* ---------- Ladezustaende ---------- */
.eq-laden {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(245,98,60,.25);
  border-top-color: var(--eq-orange);
  border-radius: 50%;
  animation: eq-dreh .7s linear infinite;
}
@keyframes eq-dreh { to { transform: rotate(360deg); } }

.eq-skelett {
  background: linear-gradient(90deg,
    var(--eq-linie) 25%, rgba(255,255,255,.5) 50%, var(--eq-linie) 75%);
  background-size: 200% 100%;
  animation: eq-schimmer 1.4s ease-in-out infinite;
  border-radius: var(--eq-r-klein);
  min-height: 1em;
}
@keyframes eq-schimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Nutzer, die Animationen reduziert haben wollen */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Meldungen ---------- */
.eq-meldung {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--eq-r-klein);
  border-left: 4px solid;
  font-size: .92rem;
}
.eq-meldung--fehler { background: rgba(209,67,67,.07);  border-color: var(--eq-fehler); }
.eq-meldung--ok     { background: rgba(46,158,91,.07);  border-color: var(--eq-ok); }
.eq-meldung--warn   { background: rgba(224,160,42,.09); border-color: var(--eq-warn); }
.eq-meldung--info   { background: rgba(59,125,216,.07); border-color: var(--eq-info); }

/* ---------- Untere Navigation (nur Handy) ---------- */
.eq-navunten {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--eq-flaeche);
  border-top: 1px solid var(--eq-linie);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 60;
}
.eq-navunten a {
  flex: 1;
  min-height: var(--eq-tippziel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: .7rem;
  color: var(--eq-text-leise);
  text-decoration: none;
}
.eq-navunten a[aria-current="page"] { color: var(--eq-orange); }

@media (min-width: 768px) {
  .eq-navunten { display: none; }
}


/* ============================================================
   Navigation und Statusanzeige
   ============================================================ */

.eq-kopf__marke {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
}

.eq-nav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.eq-nav::-webkit-scrollbar { display: none; }

.eq-nav a {
  padding: 7px 12px;
  border-radius: var(--eq-r-klein);
  color: rgba(255,255,255,.9);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.eq-nav a:hover            { background: rgba(255,255,255,.16); }
.eq-nav a[aria-current="page"] { background: rgba(255,255,255,.24); }

/* Benutzeranzeige rechts */
.eq-konto {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  white-space: nowrap;
}

.eq-konto__name {
  font-size: .85rem;
  color: rgba(255,255,255,.95);
  font-weight: 500;
}

.eq-konto__rolle {
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  color: #fff;
  font-weight: 600;
}

.eq-konto__abmelden {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: .85rem;
  padding: 6px 10px;
  border-radius: var(--eq-r-klein);
}
.eq-konto__abmelden:hover { background: rgba(255,255,255,.16); }

/* Am Handy nur das Nötigste im Kopf */
@media (max-width: 640px) {
  .eq-konto__name   { display: none; }
  .eq-nav           { display: none; }
}

/* ---------- Veranstaltungskarten ---------- */
.eq-liste {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .eq-liste { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

.eq-eventkarte {
  background: var(--eq-flaeche);
  border: 1px solid var(--eq-linie);
  border-radius: var(--eq-r);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color .15s ease, transform .05s ease;
}
.eq-eventkarte:hover  { border-color: var(--eq-orange); }
.eq-eventkarte:active { transform: scale(.995); }

.eq-eventkarte__kopf {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.eq-eventkarte__titel { font-weight: 600; font-size: 1.02rem; }
.eq-eventkarte__meta  { font-size: .85rem; color: var(--eq-text-weich); }
.eq-eventkarte__zahlen {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--eq-linie);
  font-size: .82rem;
  color: var(--eq-text-leise);
}

/* ---------- Dialog ---------- */
.eq-dialog-hg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 0;
}
@media (min-width: 640px) {
  .eq-dialog-hg { align-items: center; padding: 20px; }
}

.eq-dialog {
  background: var(--eq-flaeche);
  border-radius: var(--eq-r) var(--eq-r) 0 0;
  padding: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}
@media (min-width: 640px) {
  .eq-dialog { border-radius: var(--eq-r); }
}

.eq-dialog__knoepfe {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.eq-dialog__knoepfe .eq-knopf { flex: 1; }

.eq-leer {
  text-align: center;
  padding: 40px 20px;
  color: var(--eq-text-leise);
}
