/*
 * The look of the shared entry page: the suite's neutral look, without the suite's build.
 *
 * The values below are the ones of the client's theme (`apps/office/src/index.css`): the
 * background, the text, the muted text, the border, the filled button, the ring around what has
 * the focus, what says that something went wrong, and the radius. Nothing reads them across,
 * because this page has no build step and is served from an address of its own: when the theme
 * changes there, copy the value here. The measures of the field and the button are those of the
 * client's components (`src/components/ui/input.tsx`, `button.tsx`, size `lg`).
 *
 * Light or dark follows the system. This address belongs to no organization, so what a person
 * chose in the client (kept in the browser, per address) is not known here.
 *
 * The font is Geist, the client's, served from this folder so that no other server is asked:
 * `geist-latin-wght-normal.woff2` is the file of that name from the package
 * `@fontsource-variable/geist` 5.3.0 (`files/`), the one the client's build bundles. Copyright
 * 2024 The Geist Project Authors (https://github.com/vercel/geist-font), licensed under the SIL
 * Open Font License, Version 1.1, whose text is `geist-OFL.txt` beside it. It holds the Latin
 * letters; the range is the package's own, so a letter outside it is drawn in the system's font.
 */

@font-face {
  font-family: 'Geist Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(geist-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --field: transparent;
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --ring: oklch(0.708 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --radius: 0.625rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: oklch(0.178 0 0);
    --foreground: oklch(0.985 0 0);
    --muted-foreground: oklch(0.708 0 0);
    --border: oklch(1 0 0 / 10%);
    --input: oklch(1 0 0 / 15%);
    /* The client's fields are a third of `--input` in the dark. */
    --field: oklch(1 0 0 / 4.5%);
    --primary: oklch(0.922 0 0);
    --primary-foreground: oklch(0.205 0 0);
    --ring: oklch(0.556 0 0);
    --destructive: oklch(0.704 0.191 22.216);
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--background);
  color: var(--foreground);
  font: 0.875rem/1.5 'Geist Variable', sans-serif;
}

[hidden] { display: none !important; }

/* One column, no box around it: there is nothing else on the page to set it apart from. */
main { width: 100%; max-width: 22rem; }

h1 { margin: 0; font-size: 1.5rem; line-height: 2rem; font-weight: 600; letter-spacing: -0.025em; }

.muted { margin: 0.25rem 0 1.75rem; color: var(--muted-foreground); }

label { display: block; margin-bottom: 0.5rem; line-height: 1; font-weight: 500; }

input, button {
  width: 100%;
  height: 2.25rem;
  padding: 0 0.625rem;
  font: inherit;
  border: 1px solid transparent;
  border-radius: var(--radius);
  /* Not drawn, and still there where a system replaces all colours with its own. */
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

/* A phone enlarges the page when a field with smaller letters gets the focus; the client's fields are this size there too. */
input { font-size: 1rem; color: inherit; background: var(--field); border-color: var(--input); }

@media (min-width: 48rem) {
  input { font-size: 0.875rem; }
}

input:focus-visible, button:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent);
}

.problem { margin: 0.5rem 0 0; color: var(--destructive); }

/*
 * A form with several fields (signing up). Each field is a box of its own and the form keeps
 * them apart, so the distances do not depend on which element follows which: a password
 * manager puts elements of its own beside a field it fills.
 */
.fields { display: grid; gap: 1rem; }
.fields .problem, .fields button { margin-top: 0; }

/* A box to tick with its words beside it, below the field it is about. */
label.check { display: flex; align-items: center; gap: 0.5rem; margin: 0.625rem 0 0; font-weight: 400; line-height: 1.25; }
label.check input { width: 1rem; height: 1rem; margin: 0; padding: 0; flex: none; accent-color: var(--primary); }

/* A field with what stands behind it in the address, as one box. */
.joined { display: flex; align-items: center; border: 1px solid var(--input); border-radius: var(--radius); background: var(--field); }
.joined:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); }
.joined input { min-width: 0; flex: 1; border: 0; background: transparent; box-shadow: none; }
.joined span { padding-right: 0.625rem; color: var(--muted-foreground); white-space: nowrap; }

/* The organizations an address is in, when there are several: a name to choose, and where it lives. */
.choices { margin: 1.25rem 0 0; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: var(--radius); }
.choices li { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0.75rem; }
.choices li + li { border-top: 1px solid var(--border); }
.choices a { color: inherit; font-weight: 500; }
.choices span { color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The one other way on from a page, below its form. */
.other { margin: 1.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--border); color: var(--muted-foreground); }
.other a { color: inherit; }

/* The one filled button of the page. */
button {
  margin-top: 1rem;
  font-weight: 500;
  color: var(--primary-foreground);
  background: var(--primary);
  cursor: pointer;
}

button:hover:not(:disabled) { background: color-mix(in oklch, var(--primary) 80%, transparent); }

button:disabled { opacity: 0.5; cursor: progress; }
