/* The door's form, outside the door (plans/web.md §5): the look of the owner's mail templates, core.css's tokens,
   a white sheet on a grey page, union.cat's red its one band and what acts, #ff6b76 in the dark as the app's; AA in both themes. */
:root {
  color-scheme: light;
  --bg: #efefef; --panel: #ffffff; --fg: #434141; --muted: #6b6969; --line: #e4e4e4; --fill: #f6f6f6; --radius: 4px;
  --brand: #d31f30; --accent: #d31f30; --accent-fg: #ffffff;
  --state: #e8f1fb; --state-line: #0b5cad; --bad: #b3142c; --bad-fill: #fcebee;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c0c0c; --panel: #161616; --fg: #e8e8e8; --muted: #a8a8a8; --line: #2a2a2a; --fill: #222222;
    --accent: #ff6b76; --accent-fg: #111111; --state: #16243a; --state-line: #8db4ea; --bad: #ff8a95; --bad-fill: #3a1a1f;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0c0c; --panel: #161616; --fg: #e8e8e8; --muted: #a8a8a8; --line: #2a2a2a; --fill: #222222;
  --accent: #ff6b76; --accent-fg: #111111; --state: #16243a; --state-line: #8db4ea; --bad: #ff8a95; --bad-fill: #3a1a1f;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); }
body { margin: 0; font: 16px/1.45 Calibri, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.door { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; gap: 16px; }
.panel { width: 100%; max-width: 400px; background: var(--panel); border-radius: var(--radius); padding: 0 28px 20px; }
/* the template's header: the logo, whose page behind a 2 px rule, the 4 px band under it */
.brand { display: flex; align-items: center; gap: 16px; margin: 0 -28px 24px; padding: 24px 28px 18px; border-bottom: 4px solid var(--accent); }
.brand img { display: block; height: 33px; width: auto; }
.tagline { margin: 0; padding-left: 16px; border-left: 2px solid var(--accent); font-size: 13px; font-weight: 700; line-height: 1.45; }
h1 { font-weight: 700; font-size: 22px; margin: 4px 0 8px; }

form { display: flex; flex-direction: column; gap: 6px; }
form[hidden] { display: none; }
label, .field-label { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
input { font: inherit; color: var(--fg); background: transparent; border: 0; border-bottom: 1px solid var(--muted); padding: 6px 2px; }
input:focus { border-bottom-color: var(--accent); }
input:focus-visible { outline-color: transparent; box-shadow: 0 1px 0 var(--accent); }
@media (pointer: coarse) { input { font-size: 16px; } .icon { min-width: 44px; min-height: 44px; justify-content: center; } }
button { font: inherit; background: var(--accent); color: var(--accent-fg); border: 0; border-radius: var(--radius); padding: 8px 16px; cursor: pointer; }
form button[type="submit"] { align-self: stretch; margin-top: 16px; }
.aside { margin: 6px 0 0; font-size: 14px; }
.aside a { display: inline-block; padding: 3px 0; }
.readonly { margin: 0; overflow-wrap: anywhere; }
/* a notice, the template's: a 5 px rule in its tone on its tint */
.state { background: var(--state); border-left: 5px solid var(--state-line); border-radius: 0 var(--radius) var(--radius) 0; padding: 12px 16px; margin: 4px 0; }
.state.bad { background: var(--bad-fill); border-left-color: var(--bad); }
/* the door's notice is info (a PIN on its way), its error says ERROR, as core.css's (web.md §5: words, never the colour alone) */
.state.bad::before { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 700; letter-spacing: .5px; color: var(--bad); content: "\26A0\FE0E\A0 ERROR"; content: "\26A0\FE0E\A0 ERROR" / ""; }
.state[hidden] { display: none; }
/* a kept PIN on its way to the door (signin.js): a turning ring and one word, as a desktop's sign-in */
.knock { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; padding: 36px 0 20px; color: var(--muted); }
.knock[hidden] { display: none; }
.knock::before { content: ""; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--fg); border-radius: 50%; animation: knock .8s linear infinite; }
@keyframes knock { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .knock::before { animation-duration: 4s; } }

/* The corner switches, as socket.cat's, the theme (light or dark, one click) and the language menu. */
.site-actions { display: flex; align-items: center; gap: 2px; position: fixed; top: 12px; right: 16px; z-index: 2; }
.site-actions form { margin: 0; }
.icon { display: inline-flex; align-items: center; gap: 4px; background: transparent; color: var(--muted); border: 0; padding: 6px; cursor: pointer; list-style: none; font-size: 13px; }
.icon:hover { color: var(--fg); }
/* a theme button is drawn as the theme it leaves: the one of the theme in use hides (none chosen: the browser's), as core.css's */
:root[data-theme="light"] [name="theme"][value="light"], :root[data-theme="dark"] [name="theme"][value="dark"] { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) [name="theme"][value="dark"] { display: none; } }
@media not all and (prefers-color-scheme: dark) { :root:not([data-theme]) [name="theme"][value="light"] { display: none; } }
.icon::-webkit-details-marker { display: none; }
.lang { position: relative; }
.lang-menu { position: absolute; right: 0; top: 100%; display: flex; flex-direction: column; min-width: 120px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; z-index: 3; }
.lang-menu button { background: transparent; color: var(--fg); text-align: left; padding: 8px 12px; }
.lang-menu button:hover { background: var(--fill); }
.lang-menu button[aria-current="true"] { font-weight: 600; }

.foot { margin: 0; color: var(--muted); font-size: 13px; }
