/* Seitenrahmen für die Textseiten der App: Konto, Verwaltung, Rechtliches.

   Das Dashboard bringt denselben Rahmen inline mit, das Trainings-Log und
   die Anmeldung arbeiten dagegen mit dem Vollbild-Viewport aus
   log/css/main.css. Die drei Seiten hier sind gewöhnliche Dokumente: sie
   scrollen im Body, haben keinen Schrittstapel und keine feste Höhe.

   Farben, Radien und Schatten kommen ausschließlich aus shell.css. */

/* Pflicht, nicht Geschmack: die Eingabefelder sind breit wie ihr Kasten und
   haben Innenabstand. Ohne border-box ragen sie um Polster plus Rahmen
   darüber hinaus und schieben sich unter den Knopf daneben. Das Trainings-
   Log bekommt das von log/css/main.css, diese Seiten laden das nicht. */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
}

.page {
  min-height: 100vh;
  padding: clamp(16px, 4vw, 36px) clamp(14px, 4vw, 24px) 48px;
  overflow-x: clip;
}

.shell {
  max-width: 720px;
  margin: 0 auto;
}

.pagehead {
  margin-bottom: clamp(18px, 4vw, 26px);
}

.pagehead h1 {
  margin: 0 0 4px;
  font-size: clamp(24px, 6vw, 32px);
  letter-spacing: -.02em;
}

.pagehead p {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.5;
}

.card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: clamp(18px, 4vw, 24px);
  margin-bottom: 16px;
}

/* 20 statt 17 px: bei 17 lag der Kapiteltitel nur um den Faktor 1,2 über
   dem Fließtext und trug die Gliederung allein über den Fettgrad. */
.card > h2 {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: -.015em;
}

.card > h2 + .hint {
  margin-top: 0;
  margin-bottom: 16px;
}

.hint {
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}

.card p,
.card li {
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- Zeilen und Listen ---------- */

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.row:first-of-type { border-top: 0; }

.row .rowmain { min-width: 0; }

.row .rowtitle {
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.row .rowsub {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 12px;
}

/* ---------- Bedienelemente ---------- */

.btn {
  min-height: 40px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: var(--r-field);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  /* Knöpfe und knopfförmige Links sollen gleich aussehen; die Unterstreichung
     des Links macht sonst aus einer Reihe zwei verschiedene Dinge. */
  text-decoration: none;
}

.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFF;
}

.btn-accent:hover { background: #A5361A; border-color: #A5361A; }

.btn-danger {
  background: var(--warn);
  border-color: var(--warn);
  color: #FFF;
}

.btn-danger:hover { background: #A32A20; border-color: #A32A20; }

/* Kleiner in der Schrift, nicht im Fingerziel: 40 px bleiben die Untergrenze
   für alles, was auf dem Handy angetippt wird. */
.btn-small { padding: 8px 13px; font-size: 13px; min-height: 40px; }

.field {
  display: block;
  margin-bottom: 14px;
}

.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-2);
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--r-field);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
}

/* Der Rahmenwechsel markiert das Feld, ersetzt aber nicht den Fokusring:
   der aus shell.css bleibt stehen. Sonst wäre der Fokus in den beiden
   Eingabefeldern nur eine 1px-Linie in anderer Farbe, während jedes andere
   Element einen 2px-Ring bekommt. */
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  /* An der Unterkante ausrichten: steht ein beschriftetes Feld daneben, soll
     der Knopf auf Höhe des Feldes sitzen und nicht mittig zur Beschriftung. */
  align-items: flex-end;
}

/* ---------- Rückmeldungen ---------- */

.msg {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: var(--r-field);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.msg.ok { background: #E4F4EA; color: #17663B; }
.msg.error { background: #FCE6E3; color: #A32A20; }
.msg[hidden] { display: none; }

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tag-ok { background: #E4F4EA; color: #17663B; }
.tag-off { background: var(--line); color: var(--text-2); }
.tag-warn { background: #FCE6E3; color: #A32A20; }

/* Breite Tabellen scrollen in ihrem eigenen Kasten, nie die Seite.
   min-width:0 ist Pflicht, sonst bleibt der Kasten so breit wie sein
   Inhalt und schiebt das Layout seitlich. */
.tablewrap {
  min-width: 0;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-2);
}

/* Zahlenspalten stehen rechtsbündig. Ohne linkes Polster kleben zwei
   benachbarte Zahlenspalten aneinander. */
td.num, th.num { text-align: right; padding: 10px 0 10px 18px; }

/* Gewöhnliche Links in Karten und Hinweistexten. Ohne diese Regel rendern
   sie in Browser-Blau mitten in einer Koralle-Palette. */
.card a:not(.btn) {
  color: var(--accent);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.card a:not(.btn):hover { color: #A5361A; }

.backlink {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.backlink:hover { text-decoration: underline; }

@media (max-width: 520px) {
  .row { flex-wrap: wrap; }
  .row .btn { flex: 1; }
}
