:root { color-scheme: light dark; }
.ja-login-page, .ja-login-page * { box-sizing: border-box; }
.ja-login-page {
  --page: #f6f4ef;
  --paper: #fffcf6;
  --ink: #272822;
  --muted: #615d53;
  --line: #afa797;
  --accent: #774c25;
  --button: #302a23;
  --button-text: #fffaf0;
  --message: #9b392d;
  --radius: 12px;
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: safe center;
  padding: max(30px, env(safe-area-inset-top)) max(21px, env(safe-area-inset-right))
    max(30px, env(safe-area-inset-bottom)) max(21px, env(safe-area-inset-left));
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 "Avenir Next", Avenir, "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.ja-login-frame { width: min(100%, 420px); }
.ja-login-page .ja-signin {
  --field-radius: var(--radius);
  --field-surface: var(--paper);
  --field-border: var(--line);
  --field-text: var(--ink);
  --focus-ring: var(--accent);
  --login-message: var(--message);
}
.ja-login-page h1 { margin: 0 0 19px; font-size: clamp(24px, 4vw, 30px); line-height: 1.18; letter-spacing: -.025em; }
.ja-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 24px;
  font-size: 23px;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -.04em;
}
.ja-brand img { display: block; width: 52px; height: 52px; border-radius: 11px; }
.ja-submit {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--button);
  color: var(--button-text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: opacity 132ms, translate 90ms;
}
.ja-submit:hover { opacity: .9; }
.ja-submit:active { translate: 0 1px; }
.ja-secondary { margin: 16px 0 0; font-size: 14px; }
.ja-login-page :is(summary,a) { color: var(--accent); cursor: pointer; }
.ja-login-page a { text-underline-offset: 4px; }
.ja-login-page :is(a,summary,button):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ja-intro { margin: 0 0 15px; color: var(--muted); font-size: 14px; }
.ja-login-page [hidden] { display: none !important; }

.ja-home-login { --page: #eeeae1; --paper: #fcfaf5; }
.ja-home-login .ja-login-frame {
  display: grid;
  gap: 23px;
  width: min(100%, 920px);
  align-items: center;
}
.ja-home-login .ja-brand { justify-content: flex-start; margin: 0; }
.ja-home-login .ja-brand-art { display: contents; }
.ja-home-login .ja-brand-art::before, .ja-home-login .ja-brand-art::after { content: none; }
.ja-home-login .ja-login-panel {
  min-width: 0;
  padding: clamp(22px, 4vw, 35px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper) 72%, var(--page));
}
.ja-home-login .ja-secondary + .ja-secondary { margin-top: 10px; }
.ja-home-login .pair-code { display: block; font-size: 27px; letter-spacing: .16em; font-variant-numeric: tabular-nums; }
@media (min-width: 760px) {
  .ja-home-login .ja-login-frame { grid-template-columns: 1.1fr 1fr; gap: clamp(38px, 8vw, 92px); }
  .ja-home-login .ja-brand { flex-direction: column; align-items: flex-start; gap: 18px; font-size: 38px; }
  .ja-home-login .ja-brand-art { display: grid; position: relative; place-items: center; aspect-ratio: 1; width: 100%; isolation: isolate; }
  .ja-home-login .ja-brand-art::before, .ja-home-login .ja-brand-art::after {
    content: "";
    position: absolute;
    border: 1px solid var(--line);
    border-radius: 16px;
    pointer-events: none;
  }
  .ja-home-login .ja-brand-art::before { inset: 3% 8% 8% 3%; animation: home-plan 310ms ease-out both; }
  .ja-home-login .ja-brand-art::after { inset: 8% 3% 3% 8%; animation: home-plan 390ms ease-out both; }
  .ja-home-login .ja-brand-art img { position: relative; width: 61%; height: auto; border-radius: 19%; }
}
@keyframes home-plan { from { opacity: 0; transform: translate(-8px, 5px) scale(.94); } }

.ja-notes-login {
  --page: #f2f3f1; --paper: #f9faf8; --ink: #181a19; --muted: #505851;
  --line: #8d9991; --accent: #3f5d4a; --button: #29372e; --radius: 10px;
}
.ja-notes-login .ja-brand { font: italic 39px/1 Georgia, serif; }
.ja-notes-login .ja-brand-copy { display: inline-flex; gap: 1px; align-items: baseline; }
.ja-notes-login .ja-brand-copy b { color: var(--accent); font-weight: inherit; }
.ja-notes-login .ja-login-panel {
  position: relative;
  isolation: isolate;
  padding: clamp(23px, 5vw, 34px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 19px;
}
.ja-notes-login .ja-login-frame { padding: 0 8px 9px 0; }
.ja-notes-login .ja-login-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-inline-end: 1px solid var(--line);
  border-block-end: 1px solid var(--line);
  border-radius: inherit;
  transform: translate(7px, 7px);
  animation: notes-sheet 270ms cubic-bezier(.2,.72,.2,1) both;
  pointer-events: none;
}
@keyframes notes-sheet { from { opacity: 0; transform: translate(0, 0); } }

.ja-health-login {
  --page: #f6f1e8; --paper: #fffaf1; --ink: #312a22; --muted: #655747;
  --line: #ad947b; --accent: #7f4b20; --button: #71451f; --radius: 10px;
}
.ja-health-login .ja-brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 14px;
  letter-spacing: .11em;
  font-size: 17px;
  text-transform: uppercase;
}
.ja-health-login .ja-brand img { width: 64px; height: 64px; border-radius: 14px; }
.ja-health-trace { margin: 0 0 20px; }

.ja-console-login {
  --page: #f7f5ee; --paper: #fffdf6; --ink: #252724; --muted: #625f55;
  --line: #aaa494; --accent: #985032; --button: #252724; --radius: 3px;
}
.ja-console-login .ja-login-frame { width: min(100%, 400px); position: relative; padding-top: 13px; }
.ja-console-login .ja-login-frame::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--ink);
  transform-origin: left; animation: console-rule 240ms cubic-bezier(.2,.72,.2,1) both;
}
.ja-console-login .ja-brand { border-bottom: 1px solid var(--line); padding: 0 0 13px; margin-bottom: 22px; }
.ja-console-login .ja-brand img { width: 43px; height: 43px; border-radius: 7px; }
@keyframes console-rule { from { transform: scaleX(.18); opacity: .25; } }

@media (prefers-color-scheme: dark) {
  .ja-login-page {
    --page: #0e0e11; --paper: #1c1c20; --ink: #eeeae1; --muted: #b6b0a6;
    --line: #77716a; --accent: #e2b073; --button: #e2b073; --button-text: #21180f; --message: #ffc4b8;
  }
  .ja-notes-login:not(:is([data-theme="light"] *)) {
    --page: #181b1a; --paper: #242a27; --ink: #f0f2ef; --muted: #afb6b1;
    --line: #77837a; --accent: #b9d2c0; --button: #d5e6d8; --button-text: #1c2c20;
  }
  .ja-notes-login:is([data-theme="light"] *) {
    --page: #f2f3f1; --paper: #f9faf8; --ink: #181a19; --muted: #505851;
    --line: #8d9991; --accent: #3f5d4a; --button: #29372e; --button-text: #fffaf0; --message: #9b392d;
  }
  .ja-health-login { --page: #171613; --paper: #232019; --button: #d69634; }
  .ja-console-login { --page: #171613; --paper: #22211d; --ink: #f1ebde; --button: #efebe0; --button-text: #26231d; }
}
[data-theme="dark"] .ja-notes-login {
  --page: #181b1a; --paper: #242a27; --ink: #f0f2ef; --muted: #afb6b1;
  --line: #77837a; --accent: #b9d2c0; --button: #d5e6d8; --button-text: #1c2c20; --message: #ffc4b8;
}
[data-theme="light"] { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
@media (min-width:760px) and (max-height:580px), (max-height:520px) {
  .ja-login-page { place-items: start center; }
}
@media (prefers-reduced-motion: reduce) {
  .ja-login-page *, .ja-login-page *::before, .ja-login-page *::after { animation: none !important; transition: none !important; }
  .ja-submit:active { translate: none; }
}

.ja-health-trace {
  height: 22px;
  background: var(--accent);
  clip-path: polygon(0 64%, 29% 64%, 33% 48%, 38% 69%, 44% 13%, 50% 87%, 55% 56%, 59% 62%, 100% 62%,
    100% 68%, 59% 68%, 55% 63%, 50% 96%, 44% 23%, 38% 78%, 33% 54%, 29% 70%, 0 70%);
}
.ja-health-trace::before {
  content: "";
  display: block;
  height: 100%;
  background: var(--page);
  transform-origin: right;
  animation: trace-reveal 340ms cubic-bezier(.2,.72,.2,1) both;
}
@keyframes trace-reveal { to { transform: scaleX(0); } }

@media (max-width:759px) and (prefers-reduced-motion: no-preference) {
  .ja-home-login .ja-brand img { animation: home-plan 275ms ease-out both; }
}
@media (prefers-reduced-motion: reduce) {
  .ja-health-trace::before { display: none; }
}
