/* Timastra sign-in. Tokens follow timastra-site/app/site.css and app/themes.css. */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --bg: #fafbf9;
  --surface: #fff;
  --surface-2: #edeee8;
  --ink: #20231e;
  --muted: #60645d;
  --line: #d6d8ce;
  --control-line: #7a7e74;
  --link: #284bdd;
  --link-hover: #1f3cb5;
  --focus: #284bdd;
  --accent: #284bdd;
  --accent-hover: #1f3cb5;
  --accent-ink: #fff;
  --fold: #b4c2ff;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --font-sans: "Inter Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --r-md: 8px;
  --r-lg: 12px;
  --shadow: 0 18px 40px #20231e12;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121619;
    --surface: #1a2025;
    --surface-2: #242c33;
    --ink: #eef1f4;
    --muted: #adb7c1;
    --line: #3a454f;
    --control-line: #7f8e9c;
    --link: #a7b8ff;
    --link-hover: #c6d0ff;
    --focus: #a7b8ff;
    --accent: #3454d1;
    --accent-hover: #2944ae;
    --fold: #7187de;
    --danger: #fda29b;
    --danger-bg: #3a1c1a;
    --ok: #75e0a7;
    --ok-bg: #16301f;
    --shadow: 0 18px 40px #00000035;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px;
}

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; border-radius: var(--r-md); }

.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; color: var(--ink); text-decoration: none; }
.brand svg { width: 32px; height: 32px; color: var(--accent); }
.brand .fold { fill: var(--fold); }
.brand span { font-size: 22px; font-weight: 640; letter-spacing: -0.02em; }

main {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}

h1 { font-size: 24px; line-height: 1.25; font-weight: 640; letter-spacing: -0.02em; margin: 0 0 8px; }
p { margin: 0 0 16px; }
.lede { color: var(--muted); margin-bottom: 24px; }
.muted { color: var(--muted); font-size: 14px; }

form { margin: 0; }
.field { margin-bottom: 18px; }
label { display: block; font-weight: 550; font-size: 14px; margin-bottom: 6px; }
.hint { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; }
input[type=email], input[type=password], input[type=text] {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--control-line);
  border-radius: var(--r-md);
}
input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
input[aria-invalid=true] { border-color: var(--danger); }
input.code { letter-spacing: 0.3em; font-variant-numeric: tabular-nums; text-align: center; font-size: 20px; }
.password-control { position: relative; }
.password-control:has(.password-toggle:not([hidden])) input { padding-right: 76px; }
.password-control .password-toggle { position: absolute; right: 4px; top: 0; min-height: 44px; border: 0; padding: 0 10px; width: auto; background: transparent; }
.destination { font-size: 14px; margin-bottom: 12px; color: var(--muted); }
.recovery-choice { border-top: 1px solid var(--line); padding: 18px 0; }
.recovery-choice h2 { font-size: 17px; margin: 0 0 8px; }
.recovery-choice:last-of-type { padding-bottom: 0; }
.code-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.code-actions button { flex: 1 1 140px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 16px 0; font-weight: 400; }
.check input { width: 20px; height: 20px; flex: none; }
.security-overview { list-style: none; padding: 16px; background: var(--surface-2); border-radius: var(--r-md); }
.security-overview li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-bottom: 8px; font-size: 14px; }
.security-overview li:last-child { margin-bottom: 0; }
summary { cursor: pointer; min-height: 44px; padding: 10px 0; }
summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
main p a:not(.button), .row a { display: inline-flex; align-items: center; min-height: 44px; }
.help p { margin: 0; }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-weight: 600;
  border-radius: var(--r-md);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button.secondary, .button.secondary { background: var(--surface); color: var(--ink); border-color: var(--control-line); }
button.secondary:hover, .button.secondary:hover { background: var(--surface-2); }
button.danger { background: var(--danger); border-color: var(--danger); color: var(--danger-bg); }
button.danger:hover { background: var(--danger); border-color: var(--danger); filter: brightness(0.92); }
dialog.confirm { width: calc(100% - 32px); max-width: 420px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog.confirm::backdrop { background: #0000008c; }
dialog.confirm h2 { margin: 0 0 8px; font-size: 17px; }
dialog.confirm p { margin: 0; color: var(--muted); }
dialog.confirm .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 20px; }
dialog.confirm .actions button { width: auto; }
button.link { width: auto; min-height: 44px; padding: 0; border: 0; background: none; color: var(--link); font-size: 14px; font-weight: 500; text-decoration: underline; }
button.link:hover { color: var(--link-hover); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -6px 0 18px; font-size: 14px; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
/* Text-link hover must not override filled button text. */
a.button:hover { color: var(--accent-ink); }
a.button.secondary:hover { color: var(--ink); }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.provider svg { width: 18px; height: 18px; flex: none; }

.alert { border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 20px; font-size: 14px; }
.alert.error { background: var(--danger-bg); color: var(--danger); border: 1px solid currentColor; }
.alert.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid currentColor; }
.alert h2 { font-size: 14px; margin: 0 0 4px; }
.alert ul { margin: 0; padding-left: 18px; }

.qr { display: flex; justify-content: center; padding: 16px; background: #fff; border-radius: var(--r-md); border: 1px solid var(--line); margin-bottom: 16px; }
.qr svg { width: 200px; height: 200px; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; word-break: break-all; background: var(--surface-2); padding: 8px 10px; border-radius: var(--r-md); }
.codes { columns: 2; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); padding: 12px 16px; border-radius: var(--r-md); list-style: none; margin: 0 0 16px; }
.account { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 20px; font-size: 14px; }
.account strong { font-weight: 600; word-break: break-all; }
.account { flex-wrap: wrap; }

footer { margin-top: 24px; color: var(--muted); font-size: 13px; text-align: center; }
footer a { color: var(--muted); }

@media (max-width: 480px) {
  body { padding: 24px 16px; }
  main { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-16 { margin-bottom: 16px; }
.steps { padding-left: 18px; }
[hidden] { display: none !important; }

main.wide { max-width: 640px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: -8px 0 24px; border-bottom: 1px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
h2.section { font-size: 16px; font-weight: 640; margin: 28px 0 8px; padding-top: 20px; border-top: 1px solid var(--line); }
.list { list-style: none; margin: 0 0 12px; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--surface-2); font-size: 14px; }
.list li form { margin: 0; flex: none; }
.list li > span { min-width: 0; overflow-wrap: anywhere; }
button.small, .button.small { width: auto; min-height: 44px; padding: 0 12px; font-size: 14px; }
.button.secondary.small { flex: none; }
.alert.info { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
button[disabled], input[disabled] { opacity: 0.55; cursor: not-allowed; }
