/*
 * Derselbe Auftritt wie der Konverter (services/mail-invoice/web/src/index.css), nach prey.de:
 * dunkles Navy als Grundton, ein einzelnes Blau als Akzent, sonst Grauwerte, Systemschrift.
 * Der Konverter baut das mit Tailwind; hier sind es dieselben Werte als einfache Klassen, damit
 * der Dienst ohne Node-Build auskommt.
 */
:root {
  --prey-ink: #001b39; /* Logo-Navy: Kopfzeile, Ueberschriften */
  --prey-slate: #232c3f;
  --prey-blue: #104798; /* Akzent: Schaltflaechen, Verweise */
  --prey-blue-dark: #0c3577;
  --prey-mist: #eae9e9; /* Trennlinien, Rahmen */
  --prey-paper: #f8f9fa; /* Seitenhintergrund */
  --prey-text: #333333;
  --prey-muted: #666977;
  --prey-ok: #1a7f4b;
  --prey-error: #b3261e;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--prey-paper);
  color: var(--prey-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Sichtbarer Fokus ueberall, aber nur bei Tastaturbedienung. */
:focus-visible { outline: 2px solid var(--prey-blue); outline-offset: 2px; }

.wrap { width: 100%; max-width: 48rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 40rem) { .wrap { padding: 0 1.5rem; } }

/* ------------------------------------------------------------------ Kopfzeile */

.topbar { background: var(--prey-ink); color: #fff; }
.topbar .wrap { display: flex; align-items: center; gap: 0.875rem; padding-top: 1rem; padding-bottom: 1rem; }
.brand { display: inline-flex; flex: none; }
.brand img { height: 2.5rem; width: auto; display: block; }
.divider { width: 1px; align-self: stretch; background: rgb(255 255 255 / 20%); }
.title { min-width: 0; }
.title p { margin: 0; font-size: 1.125rem; line-height: 1.25; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title p.sub { font-size: 0.75rem; font-weight: 400; color: rgb(255 255 255 / 60%); }

/* ------------------------------------------------------------------ Inhalt */

main.wrap { flex: 1; padding-top: 2rem; padding-bottom: 2.5rem; }

h1 { margin: 0; font-size: 1.25rem; font-weight: 600; color: var(--prey-ink); }
h2 { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 500; color: var(--prey-ink); }
.intro { margin: 0.5rem 0 0; font-size: 0.875rem; line-height: 1.65; color: var(--prey-muted); }

.card, .panel {
  margin-top: 1.5rem;
  background: #fff;
  border: 1px solid var(--prey-mist);
  border-radius: 0.5rem;
  padding: 1.5rem;
}

/* Die Code-Eingabe: wie die Ablagezone des Konverters - gestrichelt, mittig, mit Symbol. */
.panel {
  border: 2px dashed var(--prey-mist);
  padding: 2.25rem 1.5rem;
  text-align: center;
}
.panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  background: rgb(0 27 57 / 5%);
  color: var(--prey-ink);
}
.panel-icon svg { width: 1.5rem; height: 1.5rem; }
.panel h2 { font-size: 1rem; }
.panel .hint { margin-top: 0.25rem; }
.panel .error { text-align: left; margin: 1rem auto 0; max-width: 26rem; }

.code-form { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin: 1.25rem auto 0.75rem; max-width: 26rem; }
.code-form input.code { flex: 1 1 13rem; }

input, textarea, select {
  font: inherit;
  font-size: 0.9375rem;
  color: inherit;
  background: #fff;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d4d6dc;
  border-radius: 0.375rem;
  width: 100%;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--prey-blue); box-shadow: 0 0 0 3px rgb(16 71 152 / 15%); }
input[aria-invalid="true"] { border-color: var(--prey-error); }
input.code {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}
input.code::placeholder { color: #b8bcc6; }

/* Schaltflaechen wie Button.tsx im Konverter: primary blau, sonst weiss mit Rahmen. */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  border: 1px solid var(--prey-mist);
  background: #fff;
  color: var(--prey-ink);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s;
}
button:hover, .button:hover { background: var(--prey-paper); }
button.primary, .button.primary { background: var(--prey-blue); border-color: var(--prey-blue); color: #fff; }
button.primary:hover, .button.primary:hover { background: var(--prey-blue-dark); border-color: var(--prey-blue-dark); }
button:disabled { cursor: not-allowed; opacity: 0.5; }
.code-form button { padding: 0.5rem 1.25rem; }

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

.stack { display: flex; flex-direction: column; gap: 0.375rem; }
.stack label { margin-top: 0.75rem; font-size: 0.875rem; font-weight: 500; color: var(--prey-ink); }
.stack label.check { font-weight: 400; color: var(--prey-text); display: flex; gap: 0.5rem; align-items: baseline; margin-top: 0.5rem; }
.stack label.check input { width: auto; flex: none; }
.optional { font-weight: 400; font-size: 0.75rem; color: var(--prey-muted); }

.customer {
  display: flex;
  flex-direction: column;
  padding: 0.875rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--prey-paper);
  border-left: 3px solid var(--prey-ink);
  border-radius: 0 0.375rem 0.375rem 0;
  font-size: 0.9375rem;
}
.customer .label { font-size: 0.75rem; color: var(--prey-muted); }
.customer strong { color: var(--prey-ink); font-weight: 600; }

.muted, .hint { color: var(--prey-muted); }
.hint { font-size: 0.875rem; line-height: 1.6; margin: 0.5rem 0 0; }
.req { color: var(--prey-error); }

.ok, .error { margin: 1.25rem 0 0; padding: 0.75rem 1rem; border-radius: 0.375rem; font-size: 0.875rem; }
.ok { background: rgb(26 127 75 / 8%); color: var(--prey-ok); border: 1px solid rgb(26 127 75 / 20%); }
.error { background: rgb(179 38 30 / 6%); color: var(--prey-error); border: 1px solid rgb(179 38 30 / 20%); }

a { color: var(--prey-blue); }

/* Drei Schritte unter der Code-Eingabe. */
.steps { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.steps li { display: flex; gap: 0.75rem; align-items: flex-start; font-size: 0.875rem; color: var(--prey-muted); line-height: 1.5; }
.steps strong { color: var(--prey-ink); font-weight: 500; }
.step {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--prey-ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}
@media (max-width: 40rem) {
  .steps { grid-template-columns: 1fr; }
  .panel { padding: 1.75rem 1rem; }
  .card { padding: 1.25rem; }
}

.faq { margin-top: 2rem; border-top: 1px solid var(--prey-mist); }
.faq details { border-bottom: 1px solid var(--prey-mist); padding: 0.75rem 0; font-size: 0.875rem; }
.faq summary { cursor: pointer; font-weight: 500; color: var(--prey-ink); }
.faq details p { margin: 0.5rem 0 0; color: var(--prey-muted); line-height: 1.6; }

/* ------------------------------------------------------------------ Fusszeile */

.footer { border-top: 1px solid var(--prey-mist); background: #fff; }
.footer .wrap { padding-top: 1.25rem; padding-bottom: 1.25rem; font-size: 0.75rem; line-height: 1.6; color: var(--prey-muted); }
.footer strong { color: var(--prey-ink); font-weight: 500; }

/* ------------------------------------------------------------------ Verwaltung */

.result { white-space: pre-wrap; background: var(--prey-paper); padding: 0.75rem; border-radius: 0.375rem; font-size: 0.8125rem; }
.result.failed { background: rgb(179 38 30 / 6%); color: var(--prey-error); }

table.stats { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
table.stats th, table.stats td { text-align: right; padding: 0.5rem; border-bottom: 1px solid var(--prey-mist); }
table.stats th { color: var(--prey-ink); font-weight: 500; }
table.stats tr:last-child td { border-bottom: 0; }
table.stats th:first-child, table.stats td:first-child { text-align: left; }
table.stats td { font-variant-numeric: tabular-nums; }

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