:root {
  /* generic.xaml Default (dark) dictionary. Dark only: a white card over the night sky glared. */
  color-scheme: dark;
  --base-high: #FFFFFF;
  --base-medium-high: rgba(255,255,255,.8);
  --base-medium: rgba(255,255,255,.6);
  --base-medium-low: rgba(255,255,255,.4);
  --base-low: rgba(255,255,255,.2);
  --card: #1F1F1F;                 /* SystemChromeMedium */
  --error: #FF8A8A;                /* by eye; Default dictionary has no SystemErrorText */

  /* Palintropic gold #D4A754, sampled from the logo. */
  --accent-text: #D4A754;          /* 7.4:1 on #1F1F1F */
  --accent-fill: #D4A754;          /* black label, 9:1 */
  --on-accent: #000000;
}
:root[data-client="sekai-times"] {
  /* Nightcord purple, community value #9933FF (SITE_1_CHARACTER_COLORS_RESEARCH), lifted for dark. */
  --accent-text: #B87AFF;          /* by eye; 5.7:1 on #1F1F1F */
  --accent-fill: #B87AFF;
  --on-accent: #000000;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  /* The platform's own pairing (SF Pro + PingFang, Segoe UI + YaHei): Selawik beside PingFang
     read as two unrelated faces. */
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px; line-height: 20px;           /* Body */
  color: var(--base-high);
  background: #000;                             /* ApplicationPageBackground = SystemAltHigh */
  display: flex; flex-direction: column; min-height: 100%;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--base-high); outline-offset: 2px; }

/* ---- background art ---- */
.art { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; }
.art .st { display: none; }
:root[data-client="sekai-times"] body { background: #140B1F; }     /* by eye */
:root[data-client="sekai-times"] .art .pal { display: none; }
:root[data-client="sekai-times"] .art .st { display: inline; }
#stars { fill: #EAE6DD; opacity: .45; }                            /* logo ivory; faint, by eye */
:root[data-client="sekai-times"] #stars { fill: #DCC2FF; }
/* Twinkle is decorative and by eye. */
.tw { animation: twinkle 4s ease-in-out infinite; }
.tw.b { animation-duration: 3s; animation-delay: -1.5s; }
.tw.c { animation-duration: 5.5s; animation-delay: -3s; }
@keyframes twinkle { 50% { opacity: .15; } }
@media (prefers-reduced-motion: reduce) { .tw { animation: none; } }

/* ---- layout ---- */
main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 16px 16px; gap: 12px; }
/* No card: the form sits straight on the sky. */
.card { width: 100%; max-width: 360px; }
.signin { padding: 0; }
.options { display: flex; align-items: center; gap: 12px; padding: 12px 44px; border: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.options:hover { background: linear-gradient(var(--base-low), var(--base-low)), var(--card); }
.options svg { flex: none; }
.options[hidden] { display: none; }

/* ---- brand ---- */
.brand { font-weight: 600; }                     /* Base 15 SemiBold: no large type anywhere */
.relying { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; color: var(--base-medium); }
.relying[hidden] { display: none; }
.relying .tile { width: 20px; height: 20px; background: var(--accent-fill); color: var(--on-accent); font-size: 10px; font-weight: 600; display: grid; place-items: center; }

/* ---- steps ---- */
.step[hidden] { display: none; }
h1 { font-size: 15px; line-height: 20px; font-weight: 400; color: var(--base-medium); margin: 2px 0 40px; }  /* Body, BaseMedium; margins by eye */
h2 { font-size: 15px; line-height: 20px; font-weight: 600; margin: 0 0 16px; }   /* group header: Base 15 SemiBold; 16 below by eye, 8 ran into the field header */
.step + .step { margin-top: 40px; }               /* settings sections; by eye */
.identity { display: flex; align-items: center; gap: 8px; margin-top: 16px; color: var(--base-medium-high); }
.identity button { width: 24px; height: 24px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; display: grid; place-items: center; }
.identity button:hover { background: var(--base-low); }

.header { display: block; margin-bottom: 8px; }   /* header 8 epx above the field */
/* TextBox: 2 epx BaseMediumLow border over AltMediumLow, TextControlThemePadding 10,3,6,6, MinHeight 32;
   focused: white fill, black text, accent border. Corner radius 4 is Windows 11's ControlCornerRadius,
   a deliberate step away from W10M's square corners. */
.field { display: block; width: 100%; height: 32px; padding: 3px 6px 6px 10px; margin: 0;
  border: 2px solid var(--base-medium-low); border-radius: 4px;
  background: rgba(0,0,0,.4); color: var(--base-high); font: inherit; outline: none; }
.field:hover { border-color: var(--base-medium); }
.field:focus { background: #fff; color: #000; border-color: var(--accent-fill); }
.field[aria-invalid="true"] { border-color: var(--error); }
.field:focus[aria-invalid="true"] { border-color: var(--error); }
/* One field, one action: the arrow button sits flush against the field. */
.combo { display: flex; }
.combo .field { flex: 1; border-right: 0; border-radius: 4px 0 0 4px; }
.go { flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 0 4px 4px 0; cursor: pointer;
  display: grid; place-items: center; background: var(--accent-fill); color: var(--on-accent); }
.go:active { filter: brightness(.9); }
.error { color: var(--error); font-size: 13px; margin-top: 8px; }
.error:empty { margin-top: 0; }   /* no reserved line: it left a gap under every field */

.hint { font-size: 13px; color: var(--base-medium-high); margin-top: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 8px; color: var(--base-medium-high); cursor: pointer; }
.check input { margin: 0; accent-color: var(--accent-fill); }
/* Secondary choices: one quiet row in BaseMedium, so gold is left to the main action. */
.opts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 24px; }   /* by eye */
.opt { font: inherit; font-size: 14px; color: var(--base-medium); background: none; border: 0; padding: 0; cursor: pointer; }
.opt:hover { color: var(--base-high); text-decoration: none; }
.opt[hidden] { display: none; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }   /* by eye; primary first */
.btn { min-width: 108px; height: 32px; padding: 4px 12px 5px; border: 2px solid transparent; border-radius: 4px;   /* 4: see .field */
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  font: inherit; font-size: 14px; cursor: pointer;
  background: var(--base-low); color: var(--base-high);
  transition: transform 200ms; }               /* press feedback: 200 ms up, by eye */
.btn:hover { border-color: var(--base-medium-low); }
.btn:active { background: var(--base-medium-low); transform: scale(.97); transition-duration: 90ms; }
.btn.accent { background: var(--accent-fill); color: var(--on-accent); }
.btn.accent:hover { border-color: var(--base-medium-low); }
.btn.accent:active { filter: brightness(.9); }

.done-mark { width: 48px; height: 48px; margin-top: 24px; color: var(--accent-text); }
.muted { color: var(--base-medium-high); }

/* page-refresh entrance: 28 px, 300 ms, 30 ms stagger, curve from reference (numbers by eye) */
.enter > * { animation: enter 300ms cubic-bezier(.1,.9,.2,1) both; }
.enter > :nth-child(2) { animation-delay: 30ms; }
.enter > :nth-child(3) { animation-delay: 60ms; }
.enter > :nth-child(4) { animation-delay: 90ms; }
.enter > :nth-child(5) { animation-delay: 120ms; }
.enter > :nth-child(6) { animation-delay: 150ms; }
.enter > :nth-child(7) { animation-delay: 180ms; }
.enter > :nth-child(8) { animation-delay: 210ms; }
@keyframes enter { from { opacity: 0; transform: translateY(28px); } }
@media (prefers-reduced-motion: reduce) { .enter > * { animation: none; } }
/* ---- footer ---- */
footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 16px; padding: 8px 16px; font-size: 12px; line-height: 14px; }
footer a, footer span { color: rgba(255,255,255,.8); }
footer .proto { color: #D4A754; }
/* phone width: the form fills the width, on the same sky (padding by eye) */
@media (max-width: 600px) {
  main { justify-content: flex-start; align-items: stretch; padding: 72px 16px 24px; gap: 0; }
  .card { max-width: none; }
  .options { padding: 12px 16px; border-top: 1px solid var(--base-low); }
  footer { justify-content: flex-start; }
}

/* ---- server-rendered flows ---- */
.notice { margin-top: 8px; color: var(--base-medium-high); }
.notice.error { color: var(--error); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.field-wrap + .field-wrap { margin-top: 16px; }   /* by eye */
.actions form { margin: 0; }
.btn.link { min-width: 0; background: none; color: var(--accent-text); padding: 4px 0; }
a.btn:hover { text-decoration: none; }
.btn[hidden], .go[hidden] { display: none; }
