/* Archivo (SIL Open Font License), variabel in Breite und Stärke – lokal ausgeliefert */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url('/fonts/archivo-latin-wdth-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url('/fonts/archivo-latin-ext-wdth-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --green-900: #0c5135;
  --green-800: #145f40;
  --green-700: #2e7c55;
  --green-300: #9ecaaf;
  --green-100: #d3e7db;
  --green-50: #edf3ef;
  --ink: #1d1d1b;
  --ink-soft: #3b4640;
  --muted: #5b6660;
  --line: #cfd8d2;
  --line-strong: #7f8e85;
  --bg: #f5f7f5;
  --card: #ffffff;
  --warn-bg: #fff6e0;
  --warn-line: #e6c36b;
  --error: #a32020;
  --error-bg: #fdecec;
  --radius: 10px;
  --radius-small: 6px;
  --focus: 0 0 0 3px rgba(46, 124, 85, 0.35);
  --appbar-h: 108px;
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--appbar-h) + 12px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-stretch: 87.5%;
  font-size: 16px;
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: var(--green-700);
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.icon {
  flex: none;
}

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 16px 64px;
}

.eyebrow {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ------------------------------------------------------------------ Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--green-900);
  color: #fff;
}

.btn-primary:hover {
  background: var(--green-800);
}

.btn-secondary {
  background: var(--card);
  border-color: var(--line-strong);
  color: var(--green-900);
}

.btn-secondary:hover {
  border-color: var(--green-700);
  background: var(--green-50);
}

.btn-ghost {
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--green-900);
  border-radius: var(--radius);
  width: 100%;
}

.btn-ghost:hover {
  background: var(--green-50);
  border-color: var(--green-700);
}

.btn-large {
  min-height: 52px;
  padding: 12px 24px;
  font-size: 17px;
}

.btn[aria-busy='true'] {
  opacity: 0.7;
  cursor: progress;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--error-bg);
  color: var(--error);
}

/* ------------------------------------------------------------------ Fortschritt */

.progress {
  position: relative;
  display: inline-block;
  height: 6px;
  width: 100%;
  border-radius: 999px;
  background: var(--green-100);
  overflow: hidden;
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p, 0%);
  background: var(--green-700);
  border-radius: inherit;
  transition: width 0.3s;
}

/* ------------------------------------------------------------------ Hinweise */

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 15px;
  list-style: none;
}

.notice p + p {
  margin-top: 4px;
}

.notice--warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
}

.notice--error {
  background: var(--error-bg);
  border-color: #e5b4b4;
  color: var(--error);
}

/* ------------------------------------------------------------------ Startseite */

.hero {
  padding: 40px 0 28px;
}

.hero-title,
.login-title {
  margin-top: 6px;
  color: var(--green-900);
  font-stretch: 75%;
  font-weight: 800;
  font-size: clamp(40px, 9vw, 60px);
  line-height: 0.95;
  letter-spacing: -0.01em;
}

.hero-date {
  margin-top: 10px;
  font-weight: 600;
  font-size: 19px;
}

.lead {
  margin-top: 16px;
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: 17px;
}

.list-title {
  margin: 8px 0 12px;
  font-stretch: 75%;
  font-weight: 700;
  font-size: 22px;
}

.group-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.group-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.group-card:hover {
  border-color: var(--green-700);
  box-shadow: 0 2px 10px rgba(12, 81, 53, 0.08);
}

.group-num {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-900);
  font-stretch: 75%;
  font-weight: 800;
  font-size: 20px;
}

.group-body {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.group-name {
  font-stretch: 75%;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
}

.group-mdep {
  color: var(--muted);
  font-size: 15px;
}

.group-meta {
  display: grid;
  grid-template-columns: minmax(60px, 140px) auto;
  align-items: center;
  gap: 4px 10px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

.group-progress {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--green-900);
}

.group-status {
  grid-column: 1 / -1;
}

@media (min-width: 560px) {
  .group-meta {
    grid-template-columns: minmax(60px, 140px) auto 1fr;
  }
  .group-status {
    grid-column: auto;
  }
}

.group-active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--green-700);
}

.group-arrow {
  color: var(--green-700);
}

.skeleton {
  height: 104px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #e9eeea 0%, #f4f7f5 50%, #e9eeea 100%) 0 0 / 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.home-footer {
  margin-top: 28px;
}

/* ------------------------------------------------------------------ Anmeldung */

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 16px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.login-title {
  font-size: 40px;
}

.login-form {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.login-form .btn {
  margin-top: 8px;
}

.form-error {
  color: var(--error);
  font-size: 15px;
}

/* ------------------------------------------------------------------ Kopfleiste */

.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.appbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 780px;
  margin: 0 auto;
  padding: 8px 16px 4px;
}

.appbar-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  margin-left: -6px;
  padding: 0 6px;
  border-radius: 8px;
  color: var(--green-900);
  font-weight: 600;
  text-decoration: none;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 14px;
  color: var(--muted);
  text-align: right;
}

.status span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status[data-state='saved'] {
  color: var(--green-700);
}

.status[data-state='offline'],
.status[data-state='retry'] {
  color: #8a5a00;
}

.status[data-state='error'] {
  color: var(--error);
}

.stepper {
  display: flex;
  gap: 6px;
  max-width: 780px;
  margin: 0 auto;
  padding: 4px 16px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.stepper::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 36px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--green-700);
}

.chip.is-current {
  border-color: var(--green-900);
  box-shadow: inset 0 0 0 1px var(--green-900);
}

.chip-letter {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-stretch: 75%;
  font-weight: 800;
}

.chip--A .chip-letter {
  background: var(--green-100);
}
.chip--B .chip-letter {
  background: var(--green-300);
}
.chip--C .chip-letter {
  background: var(--green-700);
  color: #fff;
}
.chip--D .chip-letter {
  background: var(--green-900);
  color: #fff;
}

.chip-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.chip.is-complete .chip-count {
  color: var(--green-700);
  font-weight: 700;
}

.chip--pdf {
  padding-left: 12px;
  color: var(--green-900);
  font-weight: 600;
}

/* ------------------------------------------------------------------ Bogen */

.doc-head {
  padding: 28px 0 8px;
}

.doc-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-stretch: 75%;
  font-weight: 800;
  font-size: clamp(30px, 7vw, 40px);
  line-height: 1.05;
  color: var(--green-900);
}

.doc-title .group-num {
  width: 44px;
  height: 44px;
  font-size: 24px;
}

.doc-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 17px;
}

.presence {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green-50);
  color: var(--green-900);
  font-size: 14px;
  font-weight: 600;
}

.meta-grid {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

@media (min-width: 640px) {
  .meta-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.is-loading #sections,
.is-loading .finish,
.is-loading .stepper {
  visibility: hidden;
}

.section {
  margin-top: 36px;
}

.section-bar {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-small);
}

.section--A .section-bar {
  background: var(--green-100);
  color: #14251b;
}
.section--B .section-bar {
  background: var(--green-300);
  color: #14251b;
}
.section--C .section-bar {
  background: var(--green-700);
  color: #fff;
}
.section--D .section-bar {
  background: var(--green-900);
  color: #fff;
}

.section-letter {
  font-stretch: 75%;
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
}

.section-title {
  flex: 1;
  font-stretch: 75%;
  font-weight: 700;
  font-size: 21px;
  line-height: 1.2;
}

.section-time {
  flex: none;
  font-stretch: 75%;
  font-weight: 700;
  font-size: 15px;
}

.section-intro {
  margin: 10px 2px 0;
  color: var(--ink-soft);
}

.block {
  margin-top: 16px;
}

.block-title {
  margin-bottom: 10px;
  padding: 0;
  font-stretch: 75%;
  font-weight: 700;
  font-size: 19px;
}

.field {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.meta-grid .field,
.row-fields .field {
  padding: 0;
  border: 0;
  background: none;
}

.field-label {
  font-weight: 650;
  font-size: 17px;
}

.field-hint {
  color: var(--muted);
  font-size: 15px;
}

.input {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-stretch: 100%;
  font-size: 16px;
  line-height: 1.45;
}

.input::placeholder {
  color: #8b958f;
}

.input:focus {
  outline: none;
  border-color: var(--green-700);
  box-shadow: var(--focus);
}

.textarea {
  min-height: 92px;
  resize: vertical;
  overflow: hidden;
}

.row-fields .textarea {
  min-height: 68px;
}

.counter {
  justify-self: end;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* Zeilen (Vorhaben, Nächste Schritte) */

.rows {
  display: grid;
  gap: 10px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.row-card {
  padding: 8px 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  margin-right: -8px;
}

.row-title {
  font-stretch: 75%;
  font-weight: 700;
  font-size: 18px;
  color: var(--green-900);
}

.row-fields {
  display: grid;
  gap: 14px;
}

@media (min-width: 640px) {
  .row-card--b .row-fields {
    grid-template-columns: 1fr 1fr;
  }
  .row-card--s .row-fields {
    grid-template-columns: 2fr 1fr 1fr;
    align-items: start;
  }
}

/* Auswahl ja / teils / nein */

.segments {
  display: inline-flex;
  margin-top: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  justify-self: start;
}

.segment {
  min-width: 72px;
  min-height: 44px;
  padding: 8px 16px;
  border: 0;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
}

.segment + .segment {
  border-left: 1px solid var(--line-strong);
}

.segment:hover {
  background: var(--green-50);
}

.segment[aria-checked='true'] {
  background: var(--green-900);
  color: #fff;
}

.segment:focus-visible {
  box-shadow: inset 0 0 0 3px var(--green-300);
}

.row-fields .field-hint:last-child {
  font-size: 13px;
}

/* Checkliste */

.block-checks {
  margin: 16px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.block-checks .block-title {
  float: left;
  width: 100%;
}

.checks {
  clear: both;
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 4px 6px;
  margin: 0 -6px;
  border-radius: 8px;
  cursor: pointer;
}

.check:hover {
  background: var(--green-50);
}

.check-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.check-box {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  background: #fff;
}

.check-input:checked + .check-box {
  border-color: var(--green-900);
  background: var(--green-900) no-repeat center / 16px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E");
}

.check-input:focus-visible + .check-box {
  box-shadow: var(--focus);
}

.check-other {
  display: grid;
  gap: 2px;
}

.input-inline {
  margin: 0 0 4px 34px;
  width: calc(100% - 34px);
}

/* ------------------------------------------------------------------ Abschluss */

.finish {
  display: grid;
  gap: 14px;
  margin-top: 40px;
  padding: 20px;
  border: 2px solid var(--green-900);
  border-radius: 14px;
  background: var(--card);
}

.finish-title {
  font-stretch: 75%;
  font-weight: 800;
  font-size: 26px;
  color: var(--green-900);
}

.progress-line {
  display: grid;
  grid-template-columns: minmax(80px, 200px) auto;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 15px;
}

.finish .btn {
  justify-self: start;
}

@media (max-width: 479px) {
  .finish .btn {
    justify-self: stretch;
  }
  .appbar-back span {
    display: none;
  }
}

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

/* Nicht übernommene Offline-Änderungen */

.conflicts {
  margin-top: 16px;
}

.conflicts dl {
  display: grid;
  gap: 2px;
  margin: 8px 0 12px;
}

.conflicts dt {
  font-weight: 650;
}

.conflicts dd {
  margin: 0 0 6px;
  white-space: pre-wrap;
}
