/* Gestaltung der Seite für Anmeldung und Zustimmung (T-017). Die Werte folgen der
   Web-App (apps/web/src/app/globals.css); die Kennfarbe der Installation kommt
   aus theme.css, das der Build schreibt. */

:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --ink: #1d1c1a;
  --muted: #625f58;
  --line: #dcd9d1;
  --danger: #b3261e;
  --danger-bg: #fbeceb;
  --mark-bg: #fbecd3;
  --installation-color: #444444;
  --installation-ink: #ffffff;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --surface: #201f1d;
    --ink: #ecebe7;
    --muted: #a7a39a;
    --line: #3a3833;
    --danger: #f2b8b5;
    --danger-bg: #3d1f1d;
    --mark-bg: #3d2c12;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.installation {
  display: flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.5rem 1rem;
  background: var(--installation-color);
  color: var(--installation-ink);
  font-weight: 700;
}

.page,
.fallback {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

h1,
h2 {
  line-height: 1.25;
  margin: 0;
}

h1 {
  font-size: 1.5rem;
}

h1:focus {
  outline: none;
}

h2 {
  font-size: 1rem;
  margin-top: 1.5rem;
}

p {
  margin: 0.75rem 0 0;
}

.who,
.hint {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
}

code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.9375rem;
}

.facts {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.facts dt {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.facts dt:first-child {
  margin-top: 0;
}

.facts dd {
  margin: 0.125rem 0 0;
}

/* Was ein Client über sich sagt, bleibt in seinem Feld – auch gestapelte Zeichen. */
.facts dd,
.facts li,
.who,
.redirect-target {
  overflow: hidden;
}

.client-name {
  font-size: 1.125rem;
  font-weight: 600;
}

.scopes {
  margin: 0;
  padding-left: 1.25rem;
}

.redirect-target {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--mark-bg);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 1rem;
}

.message {
  padding: 0.625rem 0.75rem;
  border-left: 4px solid var(--danger);
  background: var(--danger-bg);
}

.sign-in {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.sign-in label {
  display: grid;
  gap: 0.25rem;
  font-weight: 600;
}

input {
  font: inherit;
  min-height: 2.75rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: inherit;
}

button {
  font: inherit;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

button.primary {
  background: var(--ink);
  color: var(--bg);
}

button.danger {
  border-color: var(--danger);
  color: var(--danger);
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--installation-color);
  outline-offset: 2px;
}

.sign-in button {
  justify-self: start;
}

.actions,
.more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.more {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.more button {
  min-height: 2.75rem;
  border-color: var(--line);
  font-weight: 400;
}

.grants {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.5rem;
}

.grant .actions {
  margin-top: 0.75rem;
}

.confirm {
  flex-basis: 100%;
  font-weight: 600;
}
