/* The invite page and the landing page. Colours are the app's tokens (apps/mobile/src/theme/tokens.ts),
   light and dark by the system setting. System fonts only: nothing is loaded from elsewhere. */

:root {
  color-scheme: light dark;
  --ground: #f5f7fa;
  --surface: #ffffff;
  --surface-raised: #e8eef6;
  --border: #6f7b8e;
  --text: #14202e;
  --text-muted: #52607a;
  --primary: #1d4e89;
  --on-primary: #ffffff;
  --warning-bg: #fdf3e1;
  --warning-text: #6b4512;
  --tint: #dce6f3;
  --focus: #2f6fd0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0b1320;
    --surface: #121c2d;
    --surface-raised: #1b2a42;
    --border: #7a8ba6;
    --text: #eef2f8;
    --text-muted: #a6b3c7;
    --primary: #7db0f0;
    --on-primary: #0b1320;
    --warning-bg: #2f2410;
    --warning-text: #f0cb85;
    --tint: #1a2a44;
    --focus: #7ab0ff;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  padding: 0 max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 34rem;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 0 8px;
}

.brand {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  color: var(--primary);
}

.lang {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.lang button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  min-height: 44px;
  padding: 0 14px;
  cursor: pointer;
}

.lang button[aria-pressed="true"] {
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}

main {
  max-width: 34rem;
  margin: 8px auto 0;
  background: var(--surface);
  border-radius: 20px;
  padding: 28px 20px;
}

h1 {
  font-size: 1.625rem;
  line-height: 1.25;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

p {
  margin: 0 0 12px;
}

main > section > :last-child,
main > :last-child {
  margin-bottom: 0;
}

.muted {
  color: var(--text-muted);
}

#city {
  overflow-wrap: anywhere;
}

.eyebrow {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 6px;
}

.notice {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-radius: 12px;
  padding: 12px 14px;
}

.code-box {
  margin: 24px 0;
  padding: 20px 16px;
  border-radius: 16px;
  background: var(--tint);
  text-align: center;
}

.code-box .label {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.code {
  margin: 0 0 12px;
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  font-size: clamp(2.25rem, 12vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  /* The letter spacing also follows the last character; this keeps the code centred. */
  text-indent: 0.18em;
  user-select: all;
  -webkit-user-select: all;
}

.copied {
  margin: 8px 0 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* Takes no room until it has something to say (it stays rendered, so it is still announced). */
.copied:empty {
  margin: 0;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: 14px;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--primary);
  color: var(--on-primary);
  border: 0;
  margin-bottom: 16px;
}

.button.secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--border);
  min-height: 48px;
}

.note {
  font-size: 0.9375rem;
  margin: 0;
}

.noscript {
  max-width: 34rem;
  margin: 16px auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

@media (min-width: 40rem) {
  main {
    margin-top: 24px;
    padding: 40px 36px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .button,
  .lang button {
    transition: background-color 120ms ease, color 120ms ease;
  }
}
