/* danitex chat's join page. Colours and type follow danitex's design
   tokens (danitex web/src/theme/tokens.css): danitex green, deep green
   chrome, faintly green neutrals, Inter. Light by default, dark by the
   device's preference. */

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('inter.woff2') format('woff2-variations');
}

:root {
  --brand: #1f6b4f;
  --brand-deep: #123e2e;
  --gold: #e3b341;
  --primary: var(--brand);
  --primary-hover: color-mix(in srgb, var(--brand) 86%, #000);
  --primary-fg: #ffffff;
  --primary-ink: #1f6b4f;
  --primary-tint: color-mix(in srgb, var(--brand) 9%, #fff);
  --ring: color-mix(in srgb, var(--brand) 24%, transparent);
  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-2: #eef2ef;
  --border: #dfe6e2;
  --border-strong: #c3cec8;
  --text: #16201b;
  --text-muted: #4f5c55;
  --text-subtle: #626e67;
  --input-bg: #ffffff;
  --success: #15803d; --success-bg: #e7f5ec; --success-bd: #a6d9b8; --success-fg: #14532d;
  --danger: #c62828;  --danger-bg: #fdecec;  --danger-bd: #f3b4b4;  --danger-fg: #8f1d1d;
  --warning-fg: #6f4b00;
  --header-bg: var(--brand-deep);
  --header-fg: #e8f1ec;
  --shadow-card: 0 1px 3px rgba(16, 32, 24, .06), 0 4px 14px rgba(16, 32, 24, .04);
  --font-ui: 'Inter Variable', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --r-md: 8px; --r-lg: 10px; --r-2xl: 14px;
  --dur: 160ms; --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: color-mix(in srgb, var(--brand) 88%, #fff);
    --primary-hover: color-mix(in srgb, var(--brand) 78%, #fff);
    --primary-ink: #7fd3ad;
    --primary-tint: color-mix(in srgb, var(--brand) 22%, #121815);
    --ring: color-mix(in srgb, var(--brand) 50%, transparent);
    --bg: #0e1311;
    --surface: #151b18;
    --surface-2: #1b2320;
    --border: #28332e;
    --border-strong: #3a4741;
    --text: #e6ece9;
    --text-muted: #a8b5af;
    --text-subtle: #8a9690;
    --input-bg: #111714;
    --success: #5fd08e; --success-bg: #10291b; --success-bd: #2a6a45; --success-fg: #a8ecc3;
    --danger: #ff8a80;  --danger-bg: #33130f;  --danger-bd: #7a2f28;  --danger-fg: #ffc2bc;
    --warning-fg: #f6dc9a;
    --header-bg: color-mix(in srgb, var(--brand-deep) 62%, #050a08);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 .9375rem / 1.55 var(--font-ui);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}
h1, h2, p, ol { margin: 0; }
h1 { font-size: 1.5rem; font-weight: 700; line-height: 1.2; letter-spacing: -.015em; }
h2 { font-size: 1rem; font-weight: 650; line-height: 1.35; }
a { color: var(--primary-ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

/* The deep green band, with the mark: danitex's header, shorter. */
.band {
  background: var(--header-bg);
  color: var(--header-fg);
  padding: 0 16px;
  height: 120px;
}
.band-in {
  max-width: 480px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo { display: block; border-radius: 9px; }
.brand { font-size: 1.125rem; font-weight: 700; letter-spacing: -.02em; }
.brand-sub { font-weight: 450; opacity: .8; }

.wrap {
  max-width: 480px;
  margin: -56px auto 0;
  padding: 0 16px 40px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-card);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
@media (max-width: 420px) {
  .card { padding: 22px 18px; }
}
.lead { color: var(--text-muted); }
.aside { color: var(--text-muted); font-size: .875rem; }
.foot { color: var(--text-subtle); font-size: .8125rem; text-align: center; margin-top: 18px; }
.nowrap { overflow-wrap: break-word; font-weight: 600; color: var(--text); }

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
label { font-weight: 600; font-size: .875rem; }
input[type=text], input[type=email] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem; /* 16px: phones don't zoom in on focus */
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.has-error input { border-color: var(--danger); }
.has-error input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 24%, transparent); }

/* The username, between its @ and :danitex.org, so the person sees the
   whole Matrix ID while typing. */
.handle {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--input-bg);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.handle:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.has-error .handle { border-color: var(--danger); }
.handle input, .handle input:focus { border: 0; box-shadow: none; background: transparent; padding-left: 2px; padding-right: 2px; min-width: 0; flex: 1; }
.handle-at, .handle-server {
  display: flex;
  align-items: center;
  color: var(--text-subtle);
  font-size: 1rem;
  white-space: nowrap;
}
.handle-at { padding-left: 12px; }
.handle-server { padding-right: 12px; }
@media (max-width: 360px) {
  .handle-server { display: none; }
}

.hint { color: var(--text-subtle); font-size: .8125rem; }
.msg { font-size: .8125rem; font-weight: 500; min-height: 1.2em; }
.msg:empty { display: none; }
/* The username's line is always there, so what it says never moves the
   button under a finger or a pointer. */
#username-status { display: block; min-height: 1.35em; }
.msg-error { color: var(--danger-fg); }
.msg-free { color: var(--success-fg); }
.msg-wait { color: var(--text-subtle); font-weight: 400; }
.msg-error::before, .msg-free::before {
  display: inline-block;
  width: 1.2em;
  font-weight: 700;
}
.msg-error::before { content: '!'; color: var(--danger); }
.msg-free::before { content: '\2713'; color: var(--success); }

.cf-turnstile { min-height: 65px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  background: var(--primary);
  color: var(--primary-fg);
  font: inherit;
  font-weight: 600;
  font-size: .9375rem;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.btn:hover { background: var(--primary-hover); }
.btn[disabled] { opacity: .65; cursor: progress; }
.btn-ghost {
  background: transparent;
  color: var(--primary-ink);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--primary-tint); }

.callout {
  border: 1px solid;
  border-radius: var(--r-lg);
  padding: 12px 14px;
  font-size: .875rem;
}
.callout-danger { background: var(--danger-bg); border-color: var(--danger-bd); color: var(--danger-fg); }

.icon-ok {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--success-bg);
  border: 1px solid var(--success-bd);
  position: relative;
}
.icon-ok::after {
  content: '';
  position: absolute;
  left: 17px;
  top: 12px;
  width: 10px;
  height: 18px;
  border: solid var(--success);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.steps li {
  counter-increment: step;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.steps li::before {
  content: counter(step);
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--primary-ink);
  font-weight: 700;
  font-size: .8125rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps span { padding-top: 2px; overflow-wrap: anywhere; }

.idcard {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.idcard-label { font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-subtle); }
.idcard-id { font-family: var(--font-mono); font-size: 1rem; overflow-wrap: anywhere; }

.choices { display: flex; flex-direction: column; gap: 14px; }
.choice {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.choice p { color: var(--text-muted); font-size: .875rem; }
