/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */

:root {
  color-scheme: dark;
  --bg: #101217;
  --panel: #191c23;
  --line: #2c3039;
  --text: #eef0f5;
  --muted: #929aaa;
  --accent: #8baeff;
  --accent-text: #0d1220;
  --danger: #ff8b8b;
  --notice: #232838;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f3f4f8;
    --panel: #ffffff;
    --line: #d9dce5;
    --text: #151821;
    --muted: #5d6475;
    --accent: #3a63d8;
    --accent-text: #ffffff;
    --danger: #c22c2c;
    --notice: #e9eefc;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  padding: 32px 16px;
}

header, main, footer {
  max-width: 460px;
  margin: 0 auto;
}

header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

header h1 { margin: 0; font-size: 1.35rem; }
header p { margin: 0; }

main {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}

footer { margin-top: 18px; font-size: 0.85rem; }

h2 { font-size: 1.1rem; margin: 0 0 12px; }
section + section { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 20px; }

.muted, .hint { color: var(--muted); }
.hint { font-size: 0.88rem; margin: 4px 0 12px; }

label {
  display: block;
  margin: 0 0 14px;
  font-size: 0.92rem;
}

input[type="email"], input[type="password"], input[inputmode="numeric"] {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input[inputmode="numeric"] { letter-spacing: 0.25em; font-size: 1.15rem; }

label.check, fieldset label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 9px;
  margin: 0 0 14px;
  padding: 10px 12px 6px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

legend { padding: 0 6px; color: var(--muted); font-size: 0.88rem; }

button {
  font: inherit;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

button.primary {
  width: 100%;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

button.danger { border-color: var(--danger); color: var(--danger); }
button:disabled { opacity: 0.6; cursor: progress; }

a { color: var(--accent); }

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.tabs button { flex: 1; }
.tabs button[aria-selected="true"] { border-color: var(--accent); color: var(--accent); font-weight: 600; }

.notice {
  background: var(--notice);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.message { min-height: 1.2em; margin: 4px 0 12px; font-size: 0.9rem; }
.message.error { color: var(--danger); }

.devices { list-style: none; margin: 0; padding: 0; }

.devices li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.devices .muted { font-size: 0.85rem; }

.badge {
  font-size: 0.75rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 6px;
}
