/* Shared authentication styles for GetTrusted.now / ICA +Trusted.
 * Zero-green obsidian & sapphire TrustMark palette with WCAG 2.1 AA contrast,
 * supporting both explicit [data-theme] toggles (appearance.js) and OS
 * prefers-color-scheme on pages without appearance.js. */

:root {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --obsidian: #060e18;
  --obsidian-glow: #0f3342;

  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-subtle: #f8fafd;
  --ink: #060e18;
  --muted: #475569;
  --line: #dfe6f0;
  --border: #7b8ba1;
  --blue: #0067d6;
  --blue-hover: #0052ad;
  --blue-ink: #ffffff;
  --blue-tint: #eaf2ff;
  --input: #ffffff;
  --error: #b42318;
  --card-shadow: 0 14px 36px rgb(6 14 24 / 0.09);

  color: var(--ink);
  background: var(--bg);
  color-scheme: light;
  accent-color: var(--blue);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060e18;
    --surface: #0c1726;
    --surface-subtle: #0a1421;
    --ink: #f3f7fc;
    --muted: #aabfd0;
    --line: #1c2e44;
    --border: #607a96;
    --blue: #5cb4ff;
    --blue-hover: #85c8ff;
    --blue-ink: #060e18;
    --blue-tint: #0f253c;
    --input: #0a1421;
    --error: #ff8a8a;
    --card-shadow: 0 16px 44px rgb(0 0 0 / 0.42);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #060e18;
  --surface: #0c1726;
  --surface-subtle: #0a1421;
  --ink: #f3f7fc;
  --muted: #aabfd0;
  --line: #1c2e44;
  --border: #607a96;
  --blue: #5cb4ff;
  --blue-hover: #85c8ff;
  --blue-ink: #060e18;
  --blue-tint: #0f253c;
  --input: #0a1421;
  --error: #ff8a8a;
  --card-shadow: 0 16px 44px rgb(0 0 0 / 0.42);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  padding: 32px 16px;
  min-block-size: 100dvh;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

main {
  position: relative;
  width: 100%;
  max-width: 504px;
  margin: 4vh auto;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--card-shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 70px 0 0;
  min-height: 28px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.1em;
  font-weight: 750;
  color: var(--ink);
}

.brand-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 7px;
  background: radial-gradient(circle at 50% 34%, var(--obsidian-glow), var(--obsidian) 76%);
  border: 1px solid rgb(120 237 245 / 0.24);
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgb(6 14 24 / 0.22);
}

h1 {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 22px 0 14px;
}
h1:focus { outline: none; }
h2 { font-family: var(--font-display); font-size: 21px; }
p { line-height: 1.5; overflow-wrap: anywhere; }
#guidance { color: var(--muted); }

label { display: block; margin: 18px 0; font-weight: 600; font-size: 0.94rem; }

input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  color: var(--ink);
  background: var(--input);
}

input:focus {
  border-color: var(--blue);
}

button {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--blue);
  color: var(--blue-ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

@media (hover: hover) {
  button:hover:not(:disabled) { background: var(--blue-hover); }
}
button:disabled { opacity: 0.6; cursor: wait; }

button.secondary {
  background: var(--surface-subtle);
  color: var(--ink);
  border-color: var(--border);
}

@media (hover: hover) {
  button.secondary:hover:not(:disabled) {
    background: var(--blue-tint);
    border-color: var(--blue);
  }
}

a { color: var(--blue); font-weight: 550; text-underline-offset: 3px; }
@media (hover: hover) {
  a:hover { color: var(--blue-hover); }
}
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

#status { min-height: 1.5em; color: var(--muted); }
#status.error { color: var(--error); }
#setupKey { overflow-wrap: anywhere; font-family: var(--font-mono); }
#qr, #replacementQR { display: block; max-width: 100%; height: auto; padding: 8px; border-radius: 10px; background: #ffffff; }
button + button { margin-top: 8px; }

.appearance-control {
  position: absolute;
  right: 20px;
  top: 20px;
  width: auto;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

@media (hover: hover) {
  .appearance-control:hover:not(:disabled) {
    background: var(--blue-tint);
    border-color: var(--blue);
    color: var(--ink);
  }
}

.auth-signup-prompt {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

main > p > a, main > a { display: inline-flex; align-items: center; min-height: 44px; }

[data-setup-key] {
  display: block;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
  margin: 12px 0;
  font: inherit;
  font-family: var(--font-mono);
  padding: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
}

li { line-height: 1.5; margin: 12px 0; }
[data-copy-feedback] { min-height: 1.5em; }

/* Preserve exact compact password toggle geometry for test-password-visibility.mjs:
 * 44x44 toggle inside >=48px input with >=52px padding-right and 20x20 SVG glyph. */
.password-field { margin: 18px 0; min-width: 0; }
.password-field > label { margin: 0 0 8px; }
.password-input-row { position: relative; min-width: 0; }
.password-input-row input { margin-top: 0; min-width: 0; width: 100%; padding-right: 54px; }
.password-toggle {
  appearance: none;
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
@media (hover: hover) {
  .password-toggle:hover:not(:disabled) { color: var(--ink); background: var(--surface-subtle); }
}
.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.password-toggle [data-password-icon="hide"] { display: none; }
.password-toggle[data-visible="true"] [data-password-icon="show"] { display: none; }
.password-toggle[data-visible="true"] [data-password-icon="hide"] { display: block; }

.remember-browser { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.remember-browser input { display: inline-block; width: 22px; min-height: 22px; height: 22px; margin: 0; flex-shrink: 0; }

@media (max-width: 480px) {
  body { padding: 16px 12px; }
  main { margin: 12px auto; padding: 24px 20px; }
  h1 { font-size: 27px; }
  .appearance-control { right: 14px; top: 14px; }
}

@media (forced-colors: active) {
  .brand-mark, input:focus { border: 1px solid ButtonBorder; outline: 2px solid Highlight; }
}
