/* The sign-in and sign-up page (login.html), laid out after the owner's recording of 14 Nov 2026 ("make this the new
   signup/sign in page") and measured from it: one dialog, 880 by 570 with a 20px corner, in the middle of a darker
   page; two 440px halves. The left half is a showcase: six 200 by 112 pictures in two columns, the right column 40px
   lower, or six rows 56px tall, every other one 32px in; an 18px/600 line under them and four 2px bars, the current
   one filling over five seconds. The right half is a 340px column: a 40px mark, a 20px/600 title, a 14px line, 40px
   buttons 10px apart, "Or" between two rules, one field, Continue, 12px small print.
   Anticode's own mark, typeface (Plus Jakarta Sans), words, pictures and neutral dark. Three things differ from the
   recording on purpose, by the owner's standing rules: buttons are flat pills, not 10px rectangles; fields have a
   fill and no outline; and Continue is the accent once an address is typed, not black. */
.signin {
  --si-ground: #151515;
  --si-left: #1b1b1b;
  --si-right: #232323;
  --si-text: #f7f7f7;
  --si-muted: #a3a3a3;
  --si-quiet: #2e2e2e;
  --si-quiet-hover: #383838;
  --si-field: #2e2e2e;
  --si-field-focus: #363636;
  --si-rule: #3a3a3a;
  --si-track: #4d4d4d;
  --si-main: #2a62f0;
  --si-main-hover: #2557dc;
  --si-on-main: #ffffff;
  --si-off: #3a3a3a;
  --si-off-text: #b4b4b4;
  --si-last: #223462;
  --si-on-last: #b3c7ff;
  --si-bad: #ff9a8f;
  --si-good: #7fd6a4;
  --si-ease: cubic-bezier(.2, 0, 0, 1);
  margin: 0; min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background: var(--si-ground); color: var(--si-text); font-size: 14px; line-height: 1.5;
}
.signin .skip { position: absolute; left: 12px; top: -64px; z-index: 2; padding: 10px 14px; border-radius: 10px; background: var(--si-text); color: var(--si-ground); font-weight: 600; text-decoration: none; }
.signin .skip:focus { top: 12px; }
.si-defs { position: absolute; }

/* opened as a popup (signin-popup.js): the page it was opened from shows, dimmed, round the dialog */
html.si-popup, html.si-popup body.signin { background: transparent; }

/* the dialog: told from the page by its fill and one soft shadow, nothing drawn round it */
.si-card { display: grid; grid-template-columns: 440px 440px; width: 880px; max-width: 100%; min-height: 570px; border-radius: 20px; overflow: hidden; background: var(--si-right); box-shadow: 0 24px 80px rgba(0, 0, 0, .45); }

/* ---------------- left: the showcase ---------------- */
.sh { grid-column: 1; grid-row: 1; position: relative; min-height: 570px; background: var(--si-left); }
.sh-slide { position: absolute; inset: 0; }
.sh-slide[hidden] { display: none; }
.sh-grid { position: absolute; left: 16px; top: 23px; display: grid; grid-template-columns: 200px 200px; gap: 8px; }
.sh-grid img { display: block; width: 200px; height: 112px; border-radius: 8px; object-fit: cover; object-position: top; background: var(--si-quiet); }
.sh-grid img:nth-child(even) { position: relative; top: 40px; }
.sh-rows { position: absolute; left: 16px; top: 21px; width: 408px; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.sh-rows li { display: flex; align-items: center; gap: 6px; width: 376px; min-height: 56px; padding: 0 14px; border-radius: 12px; background: var(--si-quiet); }
.sh-rows li:nth-child(even) { margin-left: 32px; }
.sh-chip { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--si-left); color: var(--si-text); }
.sh-chip svg { width: 16px; height: 16px; fill: currentColor; }
.sh-chip.lg-stripe { color: #635bff; }
.sh-chip.lg-sheets { color: #34a853; }
.sh-arrow { flex: none; width: 12px; height: 12px; background: var(--si-muted); clip-path: polygon(0 42%, 62% 42%, 62% 12%, 100% 50%, 62% 88%, 62% 58%, 0 58%); }
.sh-text { margin-left: 8px; font-size: 14px; line-height: 1.3; font-weight: 500; color: var(--si-text); }
.sh-cap { position: absolute; left: 24px; right: 24px; bottom: 50px; margin: 0; font-size: 18px; line-height: 1.35; font-weight: 600; letter-spacing: 0; color: var(--si-text); }
/* the bars: 2px to look at, 24px to press */
.sh-segs { position: absolute; left: 24px; right: 24px; bottom: 17px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sh-seg { position: relative; height: 24px; padding: 0; border: 0; border-radius: 4px; background: none; cursor: pointer; }
.sh-seg::before, .sh-seg i { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 2px; border-radius: 2px; }
.sh-seg::before { background: var(--si-track); }
.sh-seg i { background: var(--si-text); transform: scaleX(0); transform-origin: left center; }
.sh-seg.is-done i, .sh-seg.is-on i { transform: scaleX(1); }

/* ---------------- right: the ways in ---------------- */
.si { grid-column: 2; grid-row: 1; position: relative; display: flex; flex-direction: column; min-width: 0; padding: 40px 50px; }
.si-col { display: flex; flex-direction: column; align-items: stretch; margin-block: auto; text-align: center; }
.si-close { position: absolute; right: 14px; top: 14px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9999px; color: var(--si-muted); transition: background-color .15s var(--si-ease), color .15s var(--si-ease); }
.si-close:hover { background: var(--si-quiet); color: var(--si-text); }
.si-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.si-mark { align-self: center; display: grid; place-items: center; height: 40px; margin-bottom: 20px; border-radius: 10px; }
.si-mark img { display: block; width: auto; height: 40px; }
.si h1 { margin: 0 0 4px; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: 0; color: var(--si-text); text-wrap: balance; }
.si h1:has(+ .si-sub[hidden]) { margin-bottom: 24px; }
.si-sub { margin: 0 0 24px; color: var(--si-muted); }
.si-sub[hidden] { display: none; }

/* buttons: flat pills, nothing drawn round them */
.si-ways { display: flex; flex-direction: column; gap: 10px; }
.si-form { display: flex; flex-direction: column; gap: 12px; }
.si-btn {
  position: relative; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; padding: 0 16px; border: 0; border-radius: 9999px;
  background: var(--si-quiet); color: var(--si-text); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background-color .15s var(--si-ease), color .15s var(--si-ease);
}
.si-btn:hover { background: var(--si-quiet-hover); }
.si-btn[hidden] { display: none; }
.si-logo { position: absolute; left: 26px; top: 50%; width: 16px; height: 16px; margin-top: -8px; fill: currentColor; }
.si-last { position: absolute; right: 8px; top: 50%; margin-top: -11px; padding: 0 8px; border-radius: 9999px; background: var(--si-last); color: var(--si-on-last); font-size: 11px; line-height: 22px; font-weight: 600; }
.si-last[hidden] { display: none; }
/* the one committing button: the accent, and a quiet grey until there is an address to continue with */
.si-btn.si-btn-main { background: var(--si-main); color: var(--si-on-main); font-weight: 600; }
.si-btn.si-btn-main:hover { background: var(--si-main-hover); }
.si-start:has(#s-email:placeholder-shown) .si-btn-main { background: var(--si-off); color: var(--si-off-text); }
.si-btn:disabled { opacity: .6; cursor: default; }

/* "Or", between two rules */
.si-or { display: flex; align-items: center; gap: 12px; margin: 24px 0; font-size: 12px; line-height: 18px; color: var(--si-muted); }
.si-or::before, .si-or::after { content: ""; flex: 1; height: 1px; background: var(--si-rule); }
.si-or[hidden] { display: none; }
.si-magic .si-or { margin: 12px 0 4px; }

/* fields: a fill, no outline; the label is read out and the hint inside says what goes in */
.si-field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.si-field[hidden] { display: none; }
.si-field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.si-field input {
  width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--si-field); color: #ffffff;
  font: inherit; font-weight: 400; transition: background-color .15s var(--si-ease);
}
.si-field input::placeholder { color: #9a9a9a; opacity: 1; }
.si-field input:hover, .si-field input:focus { background: var(--si-field-focus); }
.si-field small { padding: 0 2px; font-size: 12px; line-height: 1.45; color: var(--si-muted); }
.si-field small[hidden] { display: none; }
.si-pw { position: relative; }
.si-pw input { padding-right: 64px; }
.si-show { position: absolute; right: 4px; top: 50%; min-width: 52px; height: 32px; margin-top: -16px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--si-muted); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
.si-show:hover { color: var(--si-text); }
.si-form[hidden], .si-step[hidden], .si-ways[hidden] { display: none; }
.si-step { display: flex; flex-direction: column; }

.si-remember { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 28px; font-size: 13px; color: var(--si-muted); cursor: pointer; }
.si-remember input { width: 16px; height: 16px; margin: 0; accent-color: var(--si-main); }

/* links in the small print: underlined, as in the recording */
.si-link { padding: 0; border: 0; background: none; color: var(--si-text); font: inherit; cursor: pointer; text-decoration: none; }
.si-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.si-back, #mfa-resend { align-self: center; min-height: 28px; margin-top: 16px; font-size: 13px; }
.si-legal { margin: 24px 0 0; font-size: 12px; line-height: 18px; color: var(--si-muted); text-wrap: balance; }
.si-legal a { color: var(--si-text); text-decoration: underline; text-underline-offset: 2px; }
.si-switch { margin: 20px 0 0; font-size: 13px; color: var(--si-muted); }
.si-legal[hidden], .si-switch[hidden] { display: none; }

/* the idea waiting to be built, and what the server said */
.si-idea { margin: -8px 0 20px; padding: 10px 12px; border-radius: 12px; background: var(--si-quiet); font-size: 13px; color: var(--si-muted); }
.si-idea[hidden] { display: none; }
.si-idea p { margin: 0; }
.si-idea-text { margin-top: 2px; color: var(--si-text); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.si-msg { margin: -8px 0 16px; font-size: 13px; color: var(--si-bad); text-wrap: balance; }
.si-msg[data-kind="ok"] { color: var(--si-good); }
.si-msg[hidden] { display: none; }
.si-msg a { color: inherit; }

/* focus: one clear ring, on everything that takes it */
.signin :is(a, button, input):focus-visible { outline: 2px solid var(--si-text); outline-offset: 2px; }
.signin .si-field input:focus-visible { outline-offset: 0; }

/* Motion, as recorded: a slide is replaced at once; its line fades in, then its pictures or rows one after another,
   a tenth of a second apart; the current bar fills in five seconds and the next slide follows (login.js). Pointing
   at the showcase, or tabbing into it, holds it. With reduced motion nothing moves and the bars change the slide. */
@media (prefers-reduced-motion: no-preference) {
  .si-card { animation: si-in .4s var(--si-ease) both; }
  .si-ways:not([hidden]), .si-start:not([hidden]), .si-step:not([hidden]), #mfa-form:not([hidden]) { animation: si-step .28s var(--si-ease) both; }
  .sh-slide:not([hidden]) .sh-cap { animation: sh-in .3s ease-out both; }
  .sh-slide:not([hidden]) :is(.sh-grid img, .sh-rows li) { animation: sh-in .5s ease-out both; }
  .sh-slide:not([hidden]) :is(.sh-grid img, .sh-rows li):nth-child(1) { animation-delay: .12s; }
  .sh-slide:not([hidden]) :is(.sh-grid img, .sh-rows li):nth-child(2) { animation-delay: .24s; }
  .sh-slide:not([hidden]) :is(.sh-grid img, .sh-rows li):nth-child(3) { animation-delay: .36s; }
  .sh-slide:not([hidden]) :is(.sh-grid img, .sh-rows li):nth-child(4) { animation-delay: .48s; }
  .sh-slide:not([hidden]) :is(.sh-grid img, .sh-rows li):nth-child(5) { animation-delay: .6s; }
  .sh-slide:not([hidden]) :is(.sh-grid img, .sh-rows li):nth-child(6) { animation-delay: .72s; }
  .sh-seg.is-on i { animation: sh-fill 5s linear both; }
  .sh:hover .sh-seg.is-on i, .sh:focus-within .sh-seg.is-on i { animation-play-state: paused; }
}
@keyframes si-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes si-step { from { opacity: 0; } }
@keyframes sh-in { from { opacity: 0; } }
@keyframes sh-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* narrower than the dialog: the ways in alone; on a phone they are the page */
@media (max-width: 927px) {
  .sh { display: none; }
  .si-card { grid-template-columns: minmax(0, 1fr); width: 440px; }
  .si { grid-column: 1; }
}
@media (max-width: 520px) {
  .signin { padding: 0; place-items: stretch; background: var(--si-right); }
  .si-card { width: 100%; min-height: 100dvh; border-radius: 0; box-shadow: none; animation: none; }
  .si { padding: 64px 24px max(32px, env(safe-area-inset-bottom)); }
}
/* touch: 44px to press, and fields at 16px so the page doesn't zoom when one is tapped */
@media (max-width: 520px), (pointer: coarse) {
  .si-btn, .si-field input { min-height: 44px; }
  .si-field input { font-size: 16px; }
  .si-close { width: 44px; height: 44px; right: 8px; top: 8px; }
  .si-show { height: 36px; margin-top: -18px; }
  .si-back, #mfa-resend { min-height: 44px; margin-top: 8px; }
}
@media (prefers-contrast: more) {
  .signin { --si-muted: #cfcfcf; --si-field: #333333; --si-quiet: #333333; --si-track: #8a8a8a; --si-rule: #6b6b6b; }
  .si-field input, .si-btn { outline: 1px solid #7a7a7a; }
}
