/* Dinner Deck sign-in page. Concept A's look (warm paper, tomato accent) with Besley for titles and Wix Madefor Text for
   everything else, the pair Adam picked (2026-10-24). One signature element: the tilted tomato mark. Sizes are in rem so the
   page follows the browser's text size. Built from the approved prototype (app/design/2026-10-own-signin/signin.css, D-063);
   scripts/build-page.mjs rewrites the font URLs to their hashed names. The auth Lambda's own stop pages (src/pages.mjs) use it too. */
@font-face { font-family: "Besley"; src: url("besley-latin-wght.45a619033dd9.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Wix Madefor Text"; src: url("wix-madefor-text-latin-wght.cbd90a79e04d.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }

:root {
  --paper: #f4eee3; --paper2: #ebe3d5; --card: #fffdf8; --ink: #1f1a15; --ink2: #5a5046; --line: #d9ccb7; --card-line: #cdbfa8; --field: #8a7b68;
  --tomato: #b8361f; --tomato-press: #9c2c18; --tomato-ink: #fff; --err: #a32a16; --err-bg: #fbe9e4; --focus: #1f5fd1;
  --warn-bg: #fff3c4; --warn-ink: #3d3000; --halo: rgba(184,54,31,.28);
  --shadow: 0 1px 2px rgba(60,40,20,.06), 0 18px 40px -18px rgba(60,40,20,.28);
  --btn-shadow: 0 6px 14px -8px rgba(60,40,20,.5);
  --serif: "Besley", Georgia, serif; --sans: "Wix Madefor Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not(.light) { color-scheme: dark; } }
:root.dark { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --paper: #14110e; --paper2: #1c1814; --card: #201b16; --ink: #f6eee2; --ink2: #c3b6a5; --line: #3f352c; --card-line: #4a3e33; --field: #8f8170;
    --tomato: #f0694b; --tomato-press: #ff8466; --tomato-ink: #1b0f0a; --err: #ff9a85; --err-bg: #3a1a13; --focus: #8ab4ff;
    --warn-bg: #3a3112; --warn-ink: #f5e6a8; --halo: rgba(240,105,75,.34); --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 18px 40px -18px rgba(0,0,0,.7);
    --btn-shadow: 0 6px 14px -8px rgba(0,0,0,.8);
  }
}
:root.dark {
  --paper: #14110e; --paper2: #1c1814; --card: #201b16; --ink: #f6eee2; --ink2: #c3b6a5; --line: #3f352c; --card-line: #4a3e33; --field: #8f8170;
  --tomato: #f0694b; --tomato-press: #ff8466; --tomato-ink: #1b0f0a; --err: #ff9a85; --err-bg: #3a1a13; --focus: #8ab4ff;
  --warn-bg: #3a3112; --warn-ink: #f5e6a8; --halo: rgba(240,105,75,.34); --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 18px 40px -18px rgba(0,0,0,.7);
  --btn-shadow: 0 6px 14px -8px rgba(0,0,0,.8);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.45 var(--sans); font-synthesis: none; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1:focus { outline: none; }

.shell {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.panel { width: 100%; max-width: 26rem; flex: 1 0 auto; }

/* The lockup: the tilted mark is the page's one signature. It sits above the title, inside the card on larger screens. */
.brand { display: flex; align-items: center; gap: 12px; margin: 0 0 clamp(22px, 5vh, 40px); }
.mark {
  width: clamp(40px, 2.5rem, 56px); height: clamp(40px, 2.5rem, 56px); border-radius: 30%; background: var(--tomato); color: var(--tomato-ink);
  display: grid; place-items: center; transform: rotate(-8deg); flex: none; padding: 5px;
}
.mark svg { width: 100%; height: 100%; display: block; }
.mk-back { fill: currentColor; opacity: .5; }
.mk-front { fill: currentColor; }
.mk-dot, .mk-line { fill: var(--tomato); }
.mk-line { opacity: .85; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: clamp(1.125rem, 5.2vw, 1.375rem); letter-spacing: -.01em; white-space: nowrap; }

.view { animation: rise .22s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* The viewport cap keeps a title from overflowing a small screen; the rem floor keeps it larger than the text under it when
   the person has turned the text size up. */
h1 {
  font-family: var(--serif); font-weight: 650; font-size: clamp(1.75rem, 8vw + .5rem, 2.125rem); line-height: 1.12; letter-spacing: -.02em;
  margin: 0 0 10px; text-wrap: balance; overflow-wrap: break-word; hyphens: manual;
}
h1.h-sm { font-size: clamp(1.5rem, 7vw + .4rem, 1.75rem); }
.lede { color: var(--ink2); margin: 0 0 24px; font-size: 1.0625rem; text-wrap: pretty; }
.lede.ink { color: var(--ink); }
[data-view="signin"] .lede:has(+ .lede-extra:not([hidden])) { margin-bottom: 6px; }
.body { margin: 18px 0 0; font-size: 1.0625rem; }
.body.strong { font-weight: 650; margin-top: 12px; }
#f-consent { margin-top: 22px; }
.hint { color: var(--ink2); font-size: .9375rem; margin: 8px 0 0; }
.hint:empty { margin: 0; }
.signin-note:not(:empty) { margin: 0 0 18px; color: var(--ink); font-weight: 600; }

form { display: flex; flex-direction: column; }
.field { margin: 0 0 18px; }
.field > label, .label-row label { display: block; font-weight: 650; font-size: .9375rem; margin: 0 0 8px; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin: -6px 0 2px; }
.label-row label { margin: 0; }
.label-row .link { margin-right: -10px; }
input[type=text], input[type=password], input[type=email] {
  width: 100%; min-height: 3.5rem; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--field);
  background: var(--card); color: var(--ink); font: 500 1.0625rem/1.2 var(--sans); /* >= 16px: no zoom on focus in iOS Safari */
  transition: border-color .15s, box-shadow .15s; appearance: none;
}
input[type=password]::-ms-reveal, input::-ms-clear { display: none; }
input:hover { border-color: var(--ink2); }
/* One focus look, in the palette: an ink border and a soft tomato halo. A field in error keeps its red and gets a red halo. */
input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--halo); }
input[aria-invalid=true] { border-color: var(--err); border-width: 2px; padding: 0 15.5px; }
input[aria-invalid=true]:focus { border-color: var(--err); box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 35%, transparent); }
input::placeholder { color: var(--ink2); }
input[readonly] { cursor: default; }
/* A filled-in field from a password manager keeps the card's colours instead of the browser's pale blue. */
input:-webkit-autofill, input:autofill {
  -webkit-text-fill-color: var(--ink); caret-color: var(--ink); box-shadow: 0 0 0 100px var(--card) inset; transition: background-color 600000s 0s;
}
input.code { font: 650 1.5rem/1 var(--sans); letter-spacing: .32em; text-indent: .32em; text-align: center; font-variant-numeric: tabular-nums; }

.field > label.check, .check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 2px 0 0; font-size: .9375rem; font-weight: 550; cursor: pointer; width: fit-content; }
.check input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--tomato); flex: none; cursor: pointer; }

/* Remembered account: the username input becomes the second line of a small card, still a real autocomplete=username field. */
.user-box { position: relative; }
.user-box .avatar, .user-box .who-name, .user-box .not-you { display: none; }
.field.known > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.field.known .user-box {
  display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 12px; border-radius: 16px; flex-wrap: wrap;
  background: var(--card); border: 1.5px solid var(--line);
}
.field.known .user-box .avatar, .field.known .user-box .not-you { display: grid; }
.field.known .user-box .who-name { display: block; }
.field.known .user-stack { flex: 1 1 8em; min-width: 0; display: flex; flex-direction: column; }
.field.known #username, .acct input {
  min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  color: var(--ink2); font-size: .9375rem; font-weight: 500; text-overflow: ellipsis;
}
.field.known.noname .who-name { display: none; }
.field.known.noname #username, .acct input { color: var(--ink); font-size: 1.0625rem; font-weight: 700; }
.avatar {
  width: 2.5rem; height: 2.5rem; border-radius: 50%; flex: none; place-items: center; display: grid;
  background: var(--paper2); color: var(--ink); font-weight: 750; font-size: 1.0625rem;
}
.who-name { font-weight: 700; font-size: 1.0625rem; overflow-wrap: anywhere; }
.who-sub { color: var(--ink2); font-size: .9375rem; overflow-wrap: anywhere; }
.who.static, .acct {
  display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 12px; margin: 18px 0 0; border-radius: 16px; flex-wrap: wrap;
  background: var(--card); border: 1.5px solid var(--line);
}
.acct { margin: 0 0 20px; }
.who-text, .acct-text { flex: 1 1 8em; min-width: 0; display: flex; flex-direction: column; }
.acct-text input { width: 100%; }

.err {
  display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; color: var(--err); font-weight: 600; font-size: .9375rem;
}
.err:empty { margin: 0; } /* stays in the page (a live region), takes no room */
.err:not(:empty)::before {
  content: "!"; content: "!" / ""; flex: none; width: 1.15rem; height: 1.15rem; margin-top: .1rem; border-radius: 50%; background: var(--err); color: var(--card);
  font: 800 .75rem/1.15rem var(--sans); text-align: center;
}
.err-text { flex: 1 1 0; min-width: 0; }
.lede b { overflow-wrap: anywhere; }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 3.5rem; padding: 12px 20px; width: 100%;
  border: 0; border-radius: 16px; font: 700 1.0625rem/1.2 var(--sans); letter-spacing: -.005em; cursor: pointer; text-decoration: none;
  text-align: center; transition: background-color .15s, transform .08s;
}
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--tomato); color: var(--tomato-ink); margin-top: 6px; box-shadow: var(--btn-shadow); }
.btn.primary:hover { background: var(--tomato-press); }
.btn[aria-busy=true] { cursor: progress; }
.btn[aria-busy=true]::after {
  content: ""; position: absolute; right: 18px; top: 50%; margin-top: -.525rem; width: 1.05rem; height: 1.05rem; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
/* A secondary button that stays a button: used when the primary one is the way out (after "too many tries"). */
.btn.secondary { background: transparent; color: var(--ink); border: 1.5px solid var(--field); margin-top: 8px; }
.btn.secondary:hover { background: var(--paper2); }
/* Text actions under the main button: quiet, but underlined so they read as pressable. */
.btn.quiet {
  background: transparent; color: var(--ink2); margin-top: 4px; min-height: 3rem; font: 600 1rem/1.2 var(--sans);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px;
}
.btn.quiet:hover { background: var(--paper2); }
.btn.quiet:disabled { cursor: default; color: var(--ink2); text-decoration: none; opacity: .8; }
.btn.quiet:disabled:hover { background: transparent; }
.link {
  border: 0; background: none; padding: 0 10px; min-height: 44px; color: var(--tomato); font: 700 1rem var(--sans); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; border-radius: 8px;
}
.link.small { font-size: .9375rem; }
.not-you { place-items: center; white-space: nowrap; flex: none; color: var(--ink2); font-weight: 600; }
.row-links { display: flex; flex-wrap: wrap; gap: 0 8px; margin-top: 4px; }
.row-links .btn { width: auto; flex: 1 1 auto; margin-top: 0; }

.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 0 0 14px; border-radius: 14px;
  background: var(--warn-bg); color: var(--warn-ink); font-size: .9375rem; font-weight: 550;
}
.notice .ico { width: 20px; height: 20px; flex: none; margin-top: 1px; }

.view.center { text-align: center; padding-top: 4vh; display: flex; flex-direction: column; align-items: center; }
.view.center .lede { margin-bottom: 24px; }
.view.center .btn span { display: inline; }
.spinner {
  width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--tomato);
  animation: spin .8s linear infinite; margin: 8px 0 22px;
}
.tick { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--paper2); color: var(--tomato); margin: 0 0 18px; }
.ref { color: var(--ink2); font-size: .875rem; margin-top: 18px; font-variant-numeric: tabular-nums; }
@keyframes spin { to { transform: rotate(360deg); } }

.help { margin: 8px 0 20px; }
.help dt { font-weight: 700; margin: 18px 0 4px; }
.help dd { margin: 0; color: var(--ink2); font-size: 1.0625rem; }

/* The help link shows only where a person can be stuck, not on the end screens. */
.foot { width: 100%; max-width: 26rem; display: none; justify-content: center; padding: 20px 0 4px; }
body[data-view="signin"] .foot, body[data-view="forgot"] .foot, body[data-view="reset"] .foot { display: flex; }
.foot .link { color: var(--ink2); }

/* Tablet and desktop: the lockup and form sit on a card in the upper middle of the paper. The stack is anchored from the top,
   so an error line or a new step only moves the bottom edge of the card. */
@media (min-width: 640px) and (min-height: 560px) {
  .shell { justify-content: flex-start; padding-top: max(32px, env(safe-area-inset-top)); }
  .panel { max-width: 30rem; margin-top: clamp(0px, 4vh, 40px); flex: 0 0 auto; background: var(--card); border-radius: 24px; padding: 36px 44px 36px; box-shadow: var(--shadow); border: 1px solid var(--card-line); }
  .brand { flex-direction: column; justify-content: center; gap: 12px; margin-bottom: 26px; }
  .mark { width: 52px; height: 52px; padding: 6px; }
  .brand-name { font-size: 1.5rem; }
  .panel input[type=text], .panel input[type=password] { background: var(--paper); }
  .field.known .user-box, .who.static, .acct { background: var(--paper); }
  .field.known #username, .acct input { background: transparent; }
  .foot { max-width: 30rem; }
}
/* Text turned up (a media query's em is the browser's text size) on a phone: the invite pointer gives way so the button stays close. */
@media (max-width: 22em) { .lede-extra { display: none; } [data-view="signin"] .lede:has(+ .lede-extra:not([hidden])) { margin-bottom: 24px; } }
/* Landscape phones and any short screen: tighten the top so the first field is on screen. */
@media (max-height: 480px) {
  .brand { margin-bottom: 12px; }
  .mark { width: 32px; height: 32px; padding: 4px; }
  .brand-name { font-size: 1.125rem; }
  h1, h1.h-sm { font-size: 1.5rem; }
  .lede { margin-bottom: 14px; }
  [data-view="signin"] .lede { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  .spinner, .btn[aria-busy=true]::after { animation: none; }
  .btn:active { transform: none; }
}
@media (forced-colors: active) {
  .btn.primary { border: 2px solid ButtonText; }
  .btn.quiet { border: 1px solid ButtonText; }
  .mark { forced-color-adjust: none; }
}
