/*
 * The landing page on helferprot.de (DEV-8) and its entrance (U5): the key
 * field here, and the page /anmelden that the server writes
 * (server/entrance.ts) -- both use this file.
 *
 * Colours from the app icon (public/icon.png): ink and the red check mark.
 * No external font, no script, no cookie -- datenschutz.html promises that,
 * and this file is bound to it.
 */
:root {
  color-scheme: light dark;
  --ink: #1b1c20;
  --check: #e5281c;
  --bg: #f6f6f4;
  --card: #ffffff;
  --text: #1b1c20;
  --quiet: #5c6270;
  --line: #e2e2de;
  --link: #b81f15;
  --button: #1b1c20;
  --button-text: #ffffff;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121317;
    --card: #1b1c20;
    --text: #eceef2;
    --quiet: #a3a9b6;
    --line: #2c2e35;
    --link: #ff6b5f;
    --button: #eceef2;
    --button-text: #121317;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
}

a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--check); outline-offset: 3px; border-radius: 3px; }

.wrap {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

header.top { padding: 1.75rem 0 0; }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.top-nav a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.top-nav a:hover { border-color: var(--quiet); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand svg { width: 2.25rem; height: 2.25rem; flex: none; }
/* in dark mode the dark square would otherwise vanish into the background */
.brand svg rect { stroke: var(--line); stroke-width: 1.5; }

main { flex: 1; padding: 3.5rem 0 3rem; }

h1 {
  margin: 0 0 1.1rem;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  /* "Patientenprotokoll" is wider than a narrow phone */
  hyphens: auto;
  overflow-wrap: break-word;
}
h1 .mark { color: var(--check); }

h2 {
  margin: 2.2rem 0 0.5rem;
  font-size: 1.1rem;
  letter-spacing: -0.005em;
}

p { margin: 0 0 1rem; }

.lead { font-size: 1.15rem; color: var(--text); }
.quiet { color: var(--quiet); }

.card {
  margin-top: 2.25rem;
  padding: 1.25rem 1.4rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--check);
  border-radius: 10px;
}
.card p:last-child { margin-bottom: 0; }

/* the key field: "[ kürzel ].helferprot.de  [Weiter]" -- wraps the button on a phone */
.entrance label { display: block; font-weight: 650; margin-bottom: 0.7rem; }
.entrance-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.entrance-field {
  flex: 1 1 16rem;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.entrance-field:focus-within { outline: 3px solid var(--check); outline-offset: 2px; }
.entrance-field input {
  flex: 1;
  min-width: 3rem;
  padding: 0.65rem 0;
  /* the key sits right before ".helferprot.de" and reads as the address */
  text-align: right;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
}
.entrance-field input[aria-invalid="true"] { color: var(--link); }
.entrance-suffix { color: var(--quiet); white-space: nowrap; }
.entrance button {
  padding: 0.65rem 1.4rem;
  border: 0;
  border-radius: 8px;
  background: var(--button);
  color: var(--button-text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.entrance button:focus-visible { outline: 3px solid var(--check); outline-offset: 2px; }
.entrance-error { margin: 0.8rem 0 0; color: var(--link); font-weight: 600; }
.entrance-hint { margin: 0.8rem 0 0; color: var(--quiet); font-size: 0.95rem; }

ul { padding-left: 1.2rem; margin: 0 0 1rem; }
li { margin-bottom: 0.4rem; }

address { font-style: normal; }

footer.foot {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 1.75rem;
  font-size: 0.95rem;
  color: var(--quiet);
}
footer.foot .wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
footer.foot a { color: var(--quiet); }
footer.foot a[aria-current="page"] { color: var(--text); text-decoration: none; font-weight: 600; }
