/* Elements and the shared buttons: html, body, links, inputs' focus, button kinds. Split out of style.css (issue #159). */

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 620;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

button:hover:not(:disabled) { background: var(--accent-hover); }

button:active:not(:disabled) { transform: translateY(1px); }

.primary-button {
  min-height: 3.05rem;
  padding-inline: 1.35rem;
  white-space: nowrap;
}

button:disabled { opacity: 0.45; cursor: not-allowed; }

.secondary-button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.secondary-button:hover:not(:disabled) { border-color: var(--accent-border); background: var(--panel-hover); box-shadow: none; }

/* .secondary-button is also used on <a> download links (e.g. the project
   report), which the bare `button` element selector above doesn't reach --
   repeat its shape-defining properties here so both tags render identically. */
a.secondary-button {
  display: inline-block;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 620;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

button:focus-visible,
input:focus-visible,
label.file-picker:has(+ input:focus-visible) {
  outline: 2px solid #ffb493;
  outline-offset: 2px;
}

.danger-button {
  background: var(--panel-raised);
  color: #ff6b6b;
  border: 1px solid var(--border);
}

.danger-button:hover { border-color: var(--danger); background: rgba(240, 107, 117, 0.1); color: #ff9ca4; box-shadow: none; }

* { scrollbar-color: #34445c transparent; scrollbar-width: thin; }

/* The JIS look on the page itself (issue #267, the keskuskuvaskanneri's;
   see tokens.css): its background and font. Each component's file carries
   the rest of the look after its own functional rules: orange marks a
   panel's main button and the view you are on in the top bar, and the
   DI/DO/AI/AO, OCR, device and TI colors keep their meanings. */
html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button {
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* The panel's main button: the one orange thing in it. */
.primary-button {
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
}

.primary-button:hover:not(:disabled) { border-color: var(--accent-hover); }

/* Every other button: outlined, neutral. */
.secondary-button,
a.secondary-button,
.danger-button {
  color: var(--text);
  background: var(--control-bg);
  border-color: var(--control-border);
}

.danger-button,
.danger-button:hover { color: var(--danger-strong); }

button:focus-visible,
input:focus-visible,
a:focus-visible,
label.file-picker:has(+ input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

* {
  scrollbar-color: var(--control-border) var(--page);
}
