:root { --bg:#f5f6f8; --card:#fff; --fg:#111827; --muted:#6b7280; --line:#d1d5db; --primary:#0f766e; --primary-fg:#fff; --hover:#f1f3f5; --err:#b91c1c; --err-bg:#fef2f2; --ok-bg:#f0fdf4; --ok:#166534; }
/* data-theme = the visitor's choice (cookie sky_theme, shared with the web app): light | dark | system */
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) { --bg:#0b0f14; --card:#151b23; --fg:#e5e7eb; --muted:#9ca3af; --line:#374151; --primary:#2dd4bf; --primary-fg:#042f2e; --hover:#1f2731; --err:#fca5a5; --err-bg:#3b1212; --ok-bg:#0f2a1b; --ok:#86efac; } }
:root[data-theme=dark] { --bg:#0b0f14; --card:#151b23; --fg:#e5e7eb; --muted:#9ca3af; --line:#374151; --primary:#2dd4bf; --primary-fg:#042f2e; --hover:#1f2731; --err:#fca5a5; --err-bg:#3b1212; --ok-bg:#0f2a1b; --ok:#86efac; }
* { box-sizing: border-box; }
body { margin:0; min-height:100vh; display:flex; align-items:center; justify-content:center; padding:16px; background:var(--bg); color:var(--fg);
  font:16px/1.5 "Noto Sans Thai","Sarabun",system-ui,-apple-system,"Segoe UI",sans-serif; }
.card { width:100%; max-width:420px; background:var(--card); border:1px solid var(--line); border-radius:14px; padding:24px; }
header { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:8px; }
.brand { font-weight:700; color:var(--primary); display:inline-flex; align-items:center; gap:6px; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.brand .logo { display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:6px; flex-shrink:0;
  background:var(--primary); color:var(--primary-fg); font-size:11px; font-weight:700; }
.brand .name { min-width:0; overflow:hidden; text-overflow:ellipsis; }
/* language and theme pickers: the web app's dropdowns (ghost button + menu panel), as <details> so they work without script */
.tools { display:flex; flex:none; gap:8px; }
.menu { position:relative; }
.menu summary { display:flex; align-items:center; gap:6px; height:36px; padding:0 10px; border:1px solid var(--line); border-radius:8px;
  font-size:12px; font-weight:600; color:var(--fg); cursor:pointer; list-style:none; user-select:none; white-space:nowrap; }
.menu summary::-webkit-details-marker { display:none; }
.menu summary:hover, .menu[open] summary { background:var(--hover); }
.menu summary:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.menu .panel { position:absolute; right:0; top:calc(100% + 8px); z-index:5; width:176px; padding:6px; background:var(--card);
  border:1px solid var(--line); border-radius:12px; box-shadow:0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1); }
.menu .panel.wide { width:224px; }
.menu .panel a { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:8px; font-size:14px; color:var(--fg); text-decoration:none; }
.menu .panel a:hover, .menu .panel a:focus-visible { background:var(--hover); outline:none; }
.menu .panel a span { flex:1; }
.menu .panel a[aria-checked=true]::after { content:""; width:6px; height:6px; border-radius:50%; background:var(--primary); }
.ico { flex:none; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.ico.muted, .menu .panel .ico { color:var(--muted); }
.flag { flex:none; border-radius:3px; box-shadow:0 0 0 1px rgb(0 0 0 / .1); }
@media (max-width:479px) { .menu .label { display:none; } }
h1 { font-size:22px; margin:8px 0 16px; }
form { display:flex; flex-direction:column; gap:12px; }
label { display:flex; flex-direction:column; gap:4px; font-size:14px; color:var(--muted); }
label.check { flex-direction:row; align-items:flex-start; gap:8px; color:var(--fg); }
label.check input { margin-top:4px; }
input[type=email], input[type=password], input[type=text] { font:inherit; color:var(--fg); background:transparent; padding:10px 12px; border:1px solid var(--line); border-radius:8px; }
input:focus-visible, button:focus-visible, a:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
button { font:inherit; font-weight:600; padding:11px; border:0; border-radius:8px; background:var(--primary); color:var(--primary-fg); cursor:pointer; }
a { color:var(--primary); }
.links { margin:12px 0 0; font-size:14px; color:var(--muted); }
.or { display:flex; align-items:center; gap:12px; margin:18px 0 10px; font-size:14px; color:var(--muted); }
.or::before, .or::after { content:""; flex:1; border-top:1px solid var(--line); }
a.button { display:block; text-align:center; padding:10px; border:1px solid var(--primary); border-radius:8px; font-weight:600; text-decoration:none; }
.alert { padding:10px 12px; border-radius:8px; font-size:14px; }
.alert.error { background:var(--err-bg); color:var(--err); }
.alert.info { background:var(--ok-bg); color:var(--ok); }
.notice { margin:0; font-size:13px; color:var(--muted); }

/* password: eye toggle + new-password checklist (static/password.js) */
.pwwrap { position:relative; display:flex; }
.pwwrap input { flex:1; min-width:0; padding-right:48px; }
.pweye { position:absolute; right:2px; top:50%; transform:translateY(-50%); display:inline-flex; align-items:center; justify-content:center;
  width:44px; height:40px; padding:0; background:transparent; color:var(--muted); border-radius:6px; font-weight:400; }
.pweye:hover { color:var(--fg); background:var(--hover); }
.pwcheck { font-size:13px; color:var(--muted); border:1px solid var(--line); border-radius:8px; padding:10px 12px; }
.pwcheck p { margin:0 0 4px; font-weight:600; color:var(--fg); }
.pwcheck ul { list-style:none; margin:0 0 8px; padding:0; display:grid; gap:2px; }
.pwcheck li { display:flex; gap:8px; }
.pwcheck li::before { content:"•"; flex:none; width:14px; text-align:center; }
.pwcheck li[data-state=ok] { color:var(--ok); }
.pwcheck li[data-state=ok]::before { content:"✓"; }
.pwcheck li[data-state=bad] { color:var(--err); }
.pwcheck li[data-state=bad]::before { content:"✗"; }
.pwcheck li[data-state=todo]::before { content:"○"; }
.pwcheck .pwmeter { margin:4px 0 0; font-weight:400; }
.pwcheck .pwmeter[data-level=weak] b { color:var(--err); }
.pwcheck .pwmeter[data-level=good] b, .pwcheck .pwmeter[data-level=strong] b { color:var(--ok); }
.pwcheck .pwpending { margin:4px 0 0; font-weight:400; color:var(--muted); font-size:12px; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
/* in-login TOTP setup (mfa-setup.html / mfa-codes.html) */
.qr { display:flex; justify-content:center; }
.qr svg { width:200px; height:200px; background:#fff; padding:8px; border-radius:8px; }
.notice code, .codes code { font-family:ui-monospace, monospace; font-size:14px; letter-spacing:.05em; word-break:break-all; color:var(--fg); }
.codes { display:grid; grid-template-columns:repeat(2, 1fr); gap:6px 16px; margin:0; padding:0; list-style:none; }
.otp { display:flex; gap:8px; }
.otp input { width:44px; height:52px; padding:0; text-align:center; font-size:20px; font-weight:600; font-variant-numeric:tabular-nums; }
.otp input:focus-visible { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
@media (max-width:360px) { .otp { gap:6px; } .otp input { width:38px; height:48px; } }
.linkbtn { align-self:flex-start; padding:0; background:none; color:var(--primary); font-weight:500; font-size:14px; text-decoration:underline; }
