/* Handelsregister-Checker – Gestaltung nach dem Erscheinungsbild von SIGN8
 *
 * Marke: Petrol #006669 (Logo), Lime #BBD135 (Akzent), Verlauf Petrol → Lime.
 * Schrift: Roboto. Bewusst ohne Google-Fonts-Einbindung – keine Anfragen an
 * Dritte (Datenschutz) und voll funktionsfähig im abgeschotteten Container.
 */

:root {
  /* Marke */
  --brand: #006669;
  --brand-strong: #004f52;
  --brand-soft: #1e6568;
  --brand-tint: #e6f0ef;
  --accent: #bbd135;
  --accent-mid: #80a07a;
  --accent-deep: #4c6b12;
  --brand-gradient: linear-gradient(90deg, #006669 0%, #1e6568 35%, #80a07a 58%, #bbd135 100%);

  /* Flächen */
  --bg: #f3f6f5;
  --surface: #ffffff;
  --surface-2: #f1f5f4;
  --border: #dce6e4;
  --text: #0f2120;
  --muted: #5d716f;

  /* Signalfarben */
  --ok: #4c6b12;
  --ok-bg: #f0f6d9;
  --warn: #96570a;
  --warn-bg: #fdf2e0;
  --bad: #a82020;
  --bad-bg: #fbeaea;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 42, 43, .06), 0 10px 30px rgba(0, 42, 43, .07);
  --font: Roboto, "Helvetica Neue", "Segoe UI", Arial, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #2e9a9e;
    --brand-strong: #3fb2b6;
    --brand-soft: #1e6568;
    --brand-tint: #0f2a2b;
    --accent: #bbd135;
    --accent-deep: #bbd135;

    --bg: #0a1616;
    --surface: #10201f;
    --surface-2: #16292a;
    --border: #23403f;
    --text: #e4efed;
    --muted: #91a8a6;

    --ok: #bbd135;
    --ok-bg: #26310f;
    --warn: #efb45f;
    --warn-bg: #33260f;
    --bad: #f08a8a;
    --bad-bg: #391717;

    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- Topbar */
.topbar {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 12px 26px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 3px; background: var(--brand-gradient);
}
.brand { display: flex; align-items: center; gap: 13px; }
.logo {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  display: block; object-fit: contain;
  box-shadow: 0 2px 8px rgba(0, 102, 105, .25);
}
.topbar h1 {
  margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.2px;
}
.sub { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); }
.sub .mark { color: var(--brand); font-weight: 700; letter-spacing: .06em; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.tab {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  padding: 8px 15px; border-radius: 999px; cursor: pointer;
  font: 500 14px/1 var(--font);
}
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab.active {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500;
}
.status { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.link { color: var(--brand); text-decoration: none; font-size: 13px; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* ----------------------------------------------------------------- Views */
main { max-width: 1180px; margin: 0 auto; padding: 26px 20px 80px; }
.view { display: none; }
.view.active { display: block; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 24px; margin-bottom: 20px;
}
.card h2 {
  margin: 0 0 16px; font-size: 16px; font-weight: 700; letter-spacing: -.2px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card h3 {
  margin: 24px 0 10px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
}
.card.warn-card { border-top: 3px solid var(--warn); }
.lead { margin: -8px 0 18px; color: var(--muted); font-size: 14px; }

/* ----------------------------------------------------------------- Forms */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.grid .span2 { grid-column: span 2; }
.grid .actions { grid-column: 1 / -1; }
@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid .span2 { grid-column: span 2; }
  .topbar { padding: 12px 16px 14px; }
  .tabs { width: 100%; margin-left: 0; }
}

label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em;
}
label.check {
  flex-direction: row; align-items: center; gap: 9px;
  font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 13.5px;
}
input, select, textarea {
  font: 15px/1.4 var(--font); color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; width: 100%; text-transform: none; letter-spacing: 0;
}
input[type=checkbox] { width: auto; accent-color: var(--brand); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 102, 105, .16);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
textarea { resize: vertical; }

.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
button { font: 600 15px/1 var(--font); cursor: pointer; border-radius: 999px; padding: 11px 22px; }
button.primary {
  background: var(--brand); border: 1px solid var(--brand); color: #fff;
  transition: background .15s ease, box-shadow .15s ease;
}
button.primary:hover { background: var(--brand-strong); box-shadow: 0 4px 14px rgba(0, 102, 105, .28); }
button.ghost, .ghost-button {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  padding: 11px 20px; border-radius: 999px; font: 600 15px/1 var(--font);
  display: inline-block; cursor: pointer; text-decoration: none;
  /* die umgebende <label> setzt Versalien für Feldbeschriftungen – hier nicht */
  text-transform: none; letter-spacing: 0;
}
label.upload { text-transform: none; letter-spacing: 0; }
button.ghost:hover, .ghost-button:hover { background: var(--surface-2); border-color: var(--brand); }
button.small { padding: 6px 14px; font-size: 12.5px; }
.hint { color: var(--muted); font-size: 12.5px; }
/* Feldbeschriftungen laufen in Versalien – ein erklärender Satz darunter nicht. */
label .hint {
  text-transform: none; letter-spacing: 0; font-weight: 400; line-height: 1.45;
}
label.checkbox {
  flex-direction: row; align-items: flex-start; gap: 9px;
  font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 13.5px;
  color: var(--text);
}
label.checkbox input[type=checkbox] { margin-top: 2px; flex: none; }

/* ---------------------------------------------------------------- Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--muted);
}
tbody tr:hover { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- Badges */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.accent { background: var(--brand-tint); color: var(--brand); }

/* ------------------------------------------------------------- Key facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.fact {
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.fact dt {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); font-weight: 700; margin: 0 0 4px;
}
.fact dd { margin: 0; font-size: 14.5px; }

.person { padding: 12px 0; border-bottom: 1px solid var(--border); }
.person:last-child { border-bottom: none; }
.person .name { font-weight: 700; }
.person .meta { color: var(--muted); font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.notice {
  border-left: 3px solid var(--brand); background: var(--surface-2);
  padding: 11px 15px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 10px 0; font-size: 13.5px;
}
.notice.warn { border-color: var(--warn); }
.notice.bad { border-color: var(--bad); }

/* ------------------------------------------------------------------ Tree */
.tree, .tree ul { list-style: none; margin: 0; padding-left: 0; }
.tree ul { margin-left: 18px; padding-left: 20px; border-left: 2px solid var(--border); }
.tree li { margin: 9px 0; }
.node {
  background: var(--surface-2); border: 1px solid var(--border);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius-sm); padding: 11px 14px;
  display: inline-block; min-width: 270px;
}
.node .title { font-weight: 700; }
.node .meta { color: var(--muted); font-size: 12.5px; }
.node.unresolved { border-style: dashed; border-top-color: var(--muted); opacity: .85; }

.option {
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 11px 15px; margin-bottom: 9px; font-size: 14px;
}
/* Prokura ist rechtsgeschäftliche, keine organschaftliche Vertretung */
.option.prokura { border-left-color: var(--warn); }
.option .who { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.option .why { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* ----------------------------------------------------------- Toast/Modal */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: #fff; padding: 12px 22px;
  border-radius: 999px; box-shadow: var(--shadow); z-index: 60;
  font-size: 14px; font-weight: 500; max-width: 90vw;
}
.toast.bad { background: var(--bad); color: #fff; }
.overlay {
  position: fixed; inset: 0; background: rgba(0, 30, 31, .62); z-index: 50;
  display: grid; place-content: center; justify-items: center; gap: 16px; color: #fff;
}
.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid rgba(187, 209, 53, .3); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
details summary { cursor: pointer; color: var(--brand); font-size: 13px; font-weight: 500; }
pre.raw {
  white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border);
  padding: 13px; border-radius: var(--radius-sm); max-height: 420px; overflow: auto;
  font-size: 12.5px;
}

/* ---------------------------------------------------------------- Footer */
.footer {
  max-width: 1180px; margin: 0 auto; padding: 0 20px 40px;
  color: var(--muted); font-size: 12.5px;
}
.footer .rule { height: 2px; background: var(--brand-gradient); border-radius: 2px; margin-bottom: 14px; }

/* ------------------------------------------------------------ Anmeldung */
/* Liegt über der Anwendung: Ohne festgestellte Identität ist keine
   Prüfentscheidung zuordenbar, also gibt es davor nichts zu sehen. */
.login-screen {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg);
}
.login-card {
  width: 100%; max-width: 420px; margin: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.login-card .logo { width: 48px; height: 48px; }
.login-card h2 { margin: 0; }
.login-card .lead { margin: 0; }
.login-card .actions { margin-top: 4px; }
.login-card button.primary { width: 100%; justify-content: center; }
