/* The sign-in page (signin.html): the site's look, cut down to one form. The page can load nothing but the
   files beside it in signin/ (site/gate.js), so it has this sheet of its own, not style.css; the build writes
   it there with the font beside it (assets.signin_css). The faces, colours and sizes are style.css's: the
   colour tokens must match it (tests/test_signin_page.py). Upright text only, so one font file. */

@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(EBGaramond-normal-latin.woff2?v=8860338416) format('woff2');
}
/* While EB Garamond loads: a common serif sized to its metrics, as in style.css, so nothing moves when it arrives */
@font-face {
  font-family: 'EB Garamond Fallback';
  font-style: normal;
  font-weight: 400 600;
  src: local('Times New Roman'), local('TimesNewRomanPSMT'), local('Liberation Serif'), local('LiberationSerif'), local('Tinos');
  size-adjust: 95.1%; ascent-override: 106.2%; descent-override: 31.5%; line-gap-override: 0%;
}

:root {
  --paper: #fbf7ef; --paper-2: #f2eadc; --ink: #2a1f17; --ink-2: #5b4a38; --rule: #e0d3bd;
  --accent: #7b3b22; --box: #998366; --link-red: #b3261e;
  --field: #fff;  /* where the reader types: a shade lighter than the page */
  --serif: "EB Garamond", "EB Garamond Fallback", Garamond, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 125%;  /* 20px at the browser default, and it follows the reader's own setting */
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1d1814; --paper-2: #28211b; --ink: #eee4d3; --ink-2: #bdaa95; --rule: #3d3229;
    --accent: #e3a486; --box: #7c6954; --link-red: #ff7b6b;
    --field: #28211b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 1rem;
  line-height: 1.42; font-kerning: normal;
}
/* One narrow column, a little above the middle on a wide screen, at the top on a phone (the keyboard takes
   the bottom half) */
main { width: 100%; max-width: 23rem; margin: 0 auto; padding: clamp(1.6rem, 12vh, 7rem) 1.1rem 2rem; }
.mark { display: block; width: 2.9rem; height: 2.7rem; margin: 0 0 1rem -.1rem; fill: var(--accent); color: var(--accent); }
h1 { font-size: 1.8rem; font-weight: 500; line-height: 1.15; margin: 0 0 1.5rem; text-wrap: balance; }
p { margin: 0; }

form { display: grid; grid-template-columns: minmax(0, 1fr); }
label { display: block; margin: 0 0 .3rem; }
input {
  font: inherit; font-size: 1.1rem; color: var(--ink); background: var(--field); width: 100%; min-height: 2.6rem;
  border: 1px solid var(--box); border-radius: 4px; padding: .45rem .65rem; margin: 0;
}
/* the code: big even figures, a little apart, so the digits are easy to check against the email */
#code { font-size: 1.5rem; font-variant-numeric: lining-nums tabular-nums; letter-spacing: .18em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

button { font: inherit; cursor: pointer; }
button[type="submit"] {
  margin-top: 1rem; width: 100%; min-height: 2.7rem; padding: .5rem 1rem; font-size: 1.1rem; font-weight: 500;
  color: var(--paper); background: var(--accent); border: 1px solid var(--accent); border-radius: 4px;
}
button[type="submit"]:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
button:disabled { opacity: .6; cursor: progress; }
/* "Send another code" and "Use a different email address": actions that read as links, with room for a thumb */
.again { margin-top: .5rem; }
.other { margin-top: -.1rem; }
/* "Send another code" resting for a minute after a request (signin.js): plainly not a link for now, and the
   line under it says when it will be */
[data-rest="true"] #again { cursor: default; text-decoration: none; }
.wait { margin: -.25rem 0 .35rem; font-size: .9rem; color: var(--ink-2); }
.wait:empty { display: none; }
button.link {
  min-height: 2.4rem; padding: .3rem 0; color: var(--accent); background: none; border: 0;
  text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .18em;
}
button.link:hover { color: var(--ink); }

/* What has happened (a code is on its way) and what went wrong: boxes on the darker paper, the second with a
   red edge, so it is not told apart by colour alone and the words keep the ink's contrast */
.note, .error { padding: .55rem .75rem; background: var(--paper-2); border-radius: 4px; }
.note { margin-bottom: .6rem; }
/* under the note, quieter: what to do if no code comes. Then the address the code went to, which may be long */
.aside { margin-bottom: 1.2rem; font-size: .9rem; color: var(--ink-2); }
.sent-to { margin-bottom: .9rem; overflow-wrap: anywhere; }
.sent-to b { font-weight: 600; }
.error { margin-top: .7rem; border-left: 4px solid var(--link-red); }
.note:empty, .error:empty { display: none; }

footer { margin-top: 2.4rem; padding-top: .9rem; border-top: 1px solid var(--rule); font-size: .9rem; color: var(--ink-2); }

@media (max-width: 26rem) {
  h1 { font-size: 1.6rem; margin-bottom: 1.2rem; }
}
