/* The portal, in the cockpit's colours (direction C): warm paper, Bricolage
   Grotesque for the titles, DM Sans for the text. */
:root {
  color-scheme: light;
  --bg: #f2eee6;
  --surface: #fbf9f5;
  --ink: #1d1b18;
  --muted: #5e5c55;
  --line: #ddd6c8;
  --field: #ffffff;
  --accent: #1f6b4f;
  --accent-ink: #ffffff;
  --danger: #a83a2a;
  --ok: #1f6b4f;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121110;
    --surface: #1c1a18;
    --ink: #f1ede6;
    --muted: #a9a398;
    --line: #34302b;
    --field: #24211e;
    --accent: #5fbf95;
    --accent-ink: #0f1a14;
    --danger: #f08b78;
    --ok: #5fbf95;
  }
}

* { box-sizing: border-box; }

/* hidden wins over every display rule below (a form is a grid). */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 "DM Sans", system-ui, sans-serif;
}

.shell {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 48px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 700;
  font-size: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px;
}

h1, h2 {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  margin: 0 0 6px;
  line-height: 1.2;
}

h1 { font-size: 26px; }
h2 { font-size: 17px; }

.lead { margin: 0 0 20px; color: var(--muted); }

form { display: grid; gap: 6px; }

label { font-weight: 600; font-size: 14px; margin-top: 8px; }

input, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button {
  margin-top: 14px;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button[disabled] { opacity: 0.6; cursor: progress; }

button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  width: 100%;
}

button.link {
  margin-top: 4px;
  background: none;
  color: var(--accent);
  padding: 4px 0;
  text-align: left;
}

.hint { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.message { margin: 8px 0 0; min-height: 1.5em; font-size: 14px; color: var(--danger); }
.message.ok { color: var(--ok); }

.links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  font-size: 14px;
}

a { color: var(--accent); }

.section-title { margin-top: 4px; }

.empty {
  margin: 8px 0 12px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}

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

.company {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}

.company-name { grid-column: 1; grid-row: 1; font-weight: 700; overflow-wrap: anywhere; }
.company-meta { grid-column: 1 / -1; grid-row: 2; font-size: 13px; color: var(--muted); }

.company-action {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  border: 0;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.company-waiting {
  grid-column: 2;
  grid-row: 1;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.company-form {
  margin: 16px 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.optional { font-weight: 400; color: var(--muted); }

[data-logout] { margin-top: 20px; }
