/* deedee Raft: the team's pages (sign-in, enrolment, the sector frame, keys, team). Spacing on a 4 px grid, targets of
   44 px, text contrast 4.5:1 at least in both themes. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #4b5261;
  --line: #d5d9e0;
  --accent: #1f5fd1;
  --accent-text: #ffffff;
  --danger: #b3261e;
  --ok: #18733a;
  --focus: #1f5fd1;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111318;
    --surface: #1b1e25;
    --text: #eef0f4;
    --muted: #b4bac6;
    --line: #353a45;
    --accent: #8ab4ff;
    --accent-text: #0b1530;
    --danger: #ff8a80;
    --ok: #7ad69a;
    --focus: #8ab4ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111318;
  --surface: #1b1e25;
  --text: #eef0f4;
  --muted: #b4bac6;
  --line: #353a45;
  --accent: #8ab4ff;
  --accent-text: #0b1530;
  --danger: #ff8a80;
  --ok: #7ad69a;
  --focus: #8ab4ff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 24px 0 12px; }
p { margin: 0 0 12px; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; min-width: 44px; padding: 8px 20px;
  border-radius: 999px; border: 2px solid var(--accent);
  background: var(--accent); color: var(--accent-text);
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn.sec { background: transparent; color: var(--accent); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.wide { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.stack { display: flex; flex-direction: column; gap: 6px; }

.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px 24px; text-align: center;
}
.brand { font-weight: 800; font-size: 18px; letter-spacing: .01em; margin-bottom: 24px; }
.brand b { color: var(--accent); }
.mini { color: var(--muted); font-size: 14px; }
.msg { min-height: 24px; margin-top: 12px; font-weight: 600; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }

label { display: block; font-weight: 600; margin: 12px 0 4px; text-align: left; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit;
}
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; }
.check input { width: 24px; height: 24px; }

/* the sector frame */
.top {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  min-height: 56px; padding: 4px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.top .brand { margin: 0 8px 0 0; }
.switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.switch a, .switch span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  font-weight: 700; text-decoration: none; color: var(--text);
}
.switch [aria-current="page"] { background: var(--accent); color: var(--accent-text); }
.top .grow { flex: 1; }
.top .who { color: var(--muted); font-size: 14px; }
.frame { display: block; width: 100%; height: calc(100vh - 57px); border: 0; background: var(--bg); }

.page { max-width: 880px; margin: 0 auto; padding: 24px 16px 48px; }
.list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.item .grow { flex: 1; min-width: 200px; }
.tag { display: inline-block; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.link-out { word-break: break-all; background: var(--bg); border: 1px dashed var(--line); padding: 8px; border-radius: 8px; font-family: ui-monospace, monospace; font-size: 14px; }

/* a card over the page: the round cross top left, the title centred, one button per outcome */
.overlay { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, .45); display: grid; place-items: center; padding: 16px; }
.dialog { position: relative; width: 100%; max-width: 440px; background: var(--surface); color: var(--text); border-radius: var(--radius); padding: 24px; }
.dialog h2 { text-align: center; margin: 0 48px 16px; }
.dialog .x {
  position: absolute; top: 12px; left: 12px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 18px; cursor: pointer;
}
@media (max-width: 600px) {
  .top .who { display: none; }
  .frame { height: calc(100vh - 106px); }
}
.gap-top { margin-top: 16px; }

/* the permanent banner under the header (RAFT_HARDWARE_KEYS=plus-tard, or security keys still to add) */
.bandeau {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex: none;
  width: 100%; max-width: 100vw; min-width: 0; margin: 0; padding: 8px 16px;
  background: var(--surface); color: var(--text);
  border-bottom: 2px solid var(--danger); font-weight: 700; text-align: center;
  white-space: normal; overflow-wrap: anywhere;
}
/* the text wraps beside its mark, never cut at the edge */
.bandeau::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: var(--surface); font-size: 14px; }
/* the sector page: the header, the banner if any, the frame takes the rest */
body.espace { display: flex; flex-direction: column; height: 100vh; }
body.espace > main { flex: 1; min-height: 0; }
body.espace .frame { height: 100%; }
