/* Gestaltung der Aufgabenhilfe.
   Zuerst fuer das Handy entworfen, der grosse Bildschirm ist der Sonderfall.
   Kein Aufbauwerkzeug, keine Schriftart aus dem Netz: die Seite darf nichts
   nachladen, was ausserhalb der Hochschule liegt.
   Die Akzentfarbe ist das Blau der Wortmarke der PH Vorarlberg. */

:root {
  --grund: #ffffff;
  --flaeche: #f4f6f9;
  --rand: #d9dfe8;
  --schrift: #1a2230;
  --schrift-leise: #545f71;
  --akzent: #254287;          /* PH-Blau, Kontrast 9,7:1 auf Weiss */
  --akzent-stark: #1b3369;
  --akzent-leise: #e7ecf6;
  --warnung: #8a2723;
  --warnung-leise: #fbecea;
  --fokus: #b4530a;
  --logo-filter: none;
  --schatten: 0 1px 2px rgba(26, 34, 48, .07), 0 4px 14px rgba(26, 34, 48, .05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #131922;
    --flaeche: #1b232e;
    --rand: #2d3845;
    --schrift: #e9eef5;
    --schrift-leise: #a4b0bf;
    --akzent: #9db6e8;        /* helle Fassung des PH-Blaus, Kontrast 7,4:1 */
    --akzent-stark: #c3d3f3;
    --akzent-leise: #1e2b41;
    --warnung: #f2a9a2;
    --warnung-leise: #2e1d1c;
    --fokus: #ffb057;
    /* Die dunkelblaue Wortmarke waere hier nicht mehr lesbar. */
    --logo-filter: brightness(0) invert(1);
    --schatten: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--schrift);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

/* --- Tastaturbedienung ------------------------------------------------- */

.sprungmarke {
  position: absolute;
  left: 8px;
  top: -4rem;
  z-index: 10;
  padding: .7rem 1.1rem;
  background: var(--akzent);
  color: var(--grund);
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top .15s ease-out;
}

.sprungmarke:focus { top: 0; }

:focus-visible {
  outline: 3px solid var(--fokus);
  outline-offset: 2px;
  border-radius: 3px;
}

.inhalt:focus { outline: none; }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* --- Kopf und Fuss ------------------------------------------------------ */

.kopf {
  border-bottom: 1px solid var(--rand);
  background: var(--grund);
}

.kopf-innen, .fuss-innen {
  margin: 0 auto;
  max-width: 48rem;
  padding: .8rem 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.marke {
  display: flex;
  align-items: center;
  gap: .8rem;
  color: inherit;
  text-decoration: none;
}

.marke-logo {
  width: 84px;
  height: auto;
  filter: var(--logo-filter);
}

.marke-text { display: flex; flex-direction: column; line-height: 1.25; }
.marke-name { font-weight: 700; letter-spacing: -.01em; }
.marke-zusatz { color: var(--schrift-leise); font-size: .8rem; }

.inhalt {
  margin: 0 auto;
  max-width: 48rem;
  padding: 2rem 16px 3.5rem;
}

.fuss {
  border-top: 1px solid var(--rand);
  background: var(--flaeche);
  color: var(--schrift-leise);
  font-size: .88rem;
}

.fuss-innen {
  flex-direction: column;
  align-items: flex-start;
  padding: 1.6rem 16px 2.4rem;
}

.fuss-zusage { margin: 0; max-width: 42rem; }

.fuss-wege {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.2rem;
  align-items: center;
}

.fuss-wege a, .knopf-als-weg {
  color: var(--akzent);
  text-decoration: underline;
  text-underline-offset: 2px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.abmelden { margin: 0; }

.knopf-als-weg {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.fuss-foerderung { margin-top: .4rem; }

.fuss-foerderung img {
  width: 232px;
  height: auto;
  display: block;
}

@media (prefers-color-scheme: dark) {
  /* Das Emblem der Union darf nicht umgefaerbt werden. Es bekommt deshalb
     eine helle Flaeche, damit der dunkelblaue Schriftzug lesbar bleibt. */
  .fuss-foerderung {
    background: #ffffff;
    padding: .6rem .8rem;
    border-radius: 8px;
    display: inline-block;
  }
}

/* --- Ueberschriften und Text ------------------------------------------- */

h1 {
  margin: 0 0 1rem;
  font-size: 1.65rem;
  line-height: 1.25;
  letter-spacing: -.02em;
}

h2 { margin: 2.2rem 0 .8rem; font-size: 1.18rem; letter-spacing: -.01em; }
h3 { margin: 1.4rem 0 .5rem; font-size: 1rem; }
.hero h1 { margin-top: .5rem; }
.lead { margin: 0; color: var(--schrift-leise); }
a { color: var(--akzent); text-underline-offset: 2px; }

/* --- Formulare ---------------------------------------------------------- */

.feld { margin: 0 0 1.3rem; }

.feld label, .feld legend {
  display: block;
  margin-bottom: .2rem;
  font-weight: 600;
}

.feld-zusatz { font-weight: 400; color: var(--schrift-leise); }

.feld-hilfe {
  margin: 0 0 .45rem;
  color: var(--schrift-leise);
  font-size: .88rem;
}

input[type="text"], input[type="password"], textarea {
  width: 100%;
  min-height: 44px;
  padding: .6rem .75rem;
  border: 1px solid var(--rand);
  border-radius: 8px;
  background: var(--grund);
  color: var(--schrift);
  font: inherit;
}

textarea { min-height: 8rem; resize: vertical; }

input:focus, textarea:focus { border-color: var(--akzent); }

fieldset { margin: 0 0 1.3rem; padding: 0; border: 0; }

.wahl {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 44px;
}

.wahl input { width: 1.25rem; height: 1.25rem; accent-color: var(--akzent); }
.wahl label { margin: 0; font-weight: 400; }

.code-eingabe {
  font-size: 1.9rem;
  letter-spacing: .3em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding: .5rem;
}

.code-formular { max-width: 22rem; }

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .7rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--akzent);
  color: var(--grund);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

@media (prefers-color-scheme: dark) {
  .knopf { color: #10182a; }
}

.knopf:hover { background: var(--akzent-stark); }
.knopf[disabled] { opacity: .55; cursor: progress; }
.knopf-gross { width: 100%; font-size: 1.05rem; padding: .9rem 1.4rem; }
.knopf-warnung { background: var(--warnung); color: #ffffff; }
.knopf-hilfe { margin: .5rem 0 0; color: var(--schrift-leise); font-size: .88rem; }

/* --- Meldungen und Karten ---------------------------------------------- */

.meldung {
  margin: 0 0 1.2rem;
  padding: .8rem 1rem;
  border-radius: 8px;
  border-left: 4px solid;
}

.meldung-fehler {
  background: var(--warnung-leise);
  border-left-color: var(--warnung);
  color: var(--schrift);
}

.karte {
  margin: 1.2rem 0 2rem;
  padding: 1.3rem;
  border: 1px solid var(--rand);
  border-radius: 12px;
  background: var(--flaeche);
  box-shadow: var(--schatten);
}

.karte h2 { margin-top: 0; }
.karte-warnung { border-color: var(--warnung); }
.leerhinweis { color: var(--schrift-leise); }

.hervorgehoben {
  padding: .8rem 1rem;
  border-radius: 8px;
  background: var(--akzent-leise);
}

/* --- Stufenliste auf der Startseite ------------------------------------ */

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

.stufenliste li {
  display: flex;
  gap: .85rem;
  align-items: baseline;
  padding: .7rem 0;
  border-bottom: 1px solid var(--rand);
}

.stufenliste li:last-child { border-bottom: 0; }

.stufe-nr {
  flex: 0 0 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--akzent-leise);
  color: var(--akzent);
  font-weight: 700;
  font-size: .9rem;
  line-height: 1.85rem;
  text-align: center;
}

.stufe-text { flex: 1; }
.quelle { margin: 1rem 0 0; color: var(--schrift-leise); font-size: .88rem; }

/* --- Seite der Lehrperson ---------------------------------------------- */

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

.sitzungsliste li {
  padding: .7rem 0;
  border-bottom: 1px solid var(--rand);
}

.sitzungsliste a {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  min-height: 44px;
  text-decoration: none;
}

.listen-code {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: .08em;
}

.listen-titel {
  color: var(--schrift);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.listen-zusatz { display: block; color: var(--schrift-leise); font-size: .85rem; }

.leinwand {
  margin: 1.2rem 0 2rem;
  padding: 1.4rem;
  border: 1px solid var(--rand);
  border-radius: 14px;
  background: var(--flaeche);
}

.leinwand-gitter {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.code-vorspann, .code-nachspann {
  margin: 0;
  color: var(--schrift-leise);
  font-size: .95rem;
}

.code-gross {
  margin: .2rem 0;
  font-size: clamp(3rem, 16vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  color: var(--akzent);
}

.qr-kachel img {
  width: clamp(180px, 42vw, 260px);
  height: auto;
  background: #ffffff;
  padding: .6rem;
  border-radius: 10px;
  display: block;
}

.leinwand-adresse {
  margin: 1rem 0 0;
  text-align: center;
  color: var(--schrift-leise);
  font-size: .9rem;
  word-break: break-all;
}

.zaehler-hinweis { color: var(--schrift-leise); font-size: .9rem; margin-top: 0; }

.zaehlerliste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .8rem;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}

.zaehlerliste li {
  padding: .9rem 1rem;
  border: 1px solid var(--rand);
  border-radius: 10px;
  background: var(--flaeche);
}

.zaehlerwert {
  display: block;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--akzent);
}

.zaehlername { display: block; color: var(--schrift-leise); font-size: .85rem; }

/* --- Arbeitsplatz des Kindes ------------------------------------------- */

.sitzungsleiste {
  margin: 0 0 1.5rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--rand);
}

.sitzungstitel { margin: 0; font-weight: 600; }
.obergrenze-hinweis { margin: .2rem 0 0; color: var(--schrift-leise); font-size: .9rem; }

.aufgabentext {
  margin: 0 0 1rem;
  padding: .9rem 1.1rem;
  border-left: 4px solid var(--akzent);
  border-radius: 0 8px 8px 0;
  background: var(--akzent-leise);
  font-size: 1.05rem;
}

.hilfe {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rand);
  border-radius: 10px;
  background: var(--flaeche);
}

.hilfe-kopf {
  margin: 0 0 .5rem;
  font-size: .9rem;
  color: var(--schrift-leise);
  font-weight: 600;
}

.hilfe-stufe {
  display: inline-block;
  margin-right: .4rem;
  padding: .1rem .5rem;
  border-radius: 999px;
  background: var(--akzent-leise);
  color: var(--akzent);
  font-size: .8rem;
}

.hilfe-text { white-space: pre-wrap; }
.hilfe-neu { border-style: dashed; }
.grenzhinweis { padding: .9rem 1.1rem; border-radius: 8px; background: var(--akzent-leise); }

.neue-aufgabe {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rand);
}

/* --- Rechtstexte -------------------------------------------------------- */

.rechtstext { max-width: 40rem; }
.rechtstext .stand { color: var(--schrift-leise); font-size: .9rem; margin-top: -.4rem; }
.rechtstext ul { padding-left: 1.2rem; }
.rechtstext li { margin-bottom: .5rem; }

.rechtstext code {
  padding: .1rem .35rem;
  border-radius: 4px;
  background: var(--akzent-leise);
  font-size: .92em;
}

/* --- Grosser Bildschirm ------------------------------------------------- */

@media (min-width: 40rem) {
  h1 { font-size: 2.05rem; }
  .marke-logo { width: 104px; }
  .inhalt { padding-top: 2.6rem; }
  .knopf-gross { width: auto; min-width: 16rem; }
  .fuss-innen { gap: 1.2rem; }
}
