/* The gate's pages: one column, readable on a phone, light and dark. */

:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1b1f24;
  --muted: #5b6470;
  --line: #d9dee5;
  --accent: #2357c6;
  --accent-text: #ffffff;
  --error: #b42318;
  --notice: #fff7e0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --card: #1b2027;
    --text: #e8ecf1;
    --muted: #9aa4b1;
    --line: #2e3640;
    --accent: #7aa2ff;
    --accent-text: #0b1020;
    --error: #ff8a80;
    --notice: #3a3214;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

#app {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem;
}

header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

header h1 {
  font-size: 1.25rem;
  margin: 0;
  flex: 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.card h2 {
  font-size: 1.1rem;
  margin-top: 0;
}

.notice {
  background: var(--notice);
  border-radius: 0.5rem;
  padding: 0.75rem;
}

button,
.button {
  font: inherit;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button.primary,
.button.primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

button.link {
  border: none;
  background: none;
  color: var(--accent);
  padding: 0.25rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

input {
  font: inherit;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}

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

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

small {
  color: var(--muted);
}

.message.error {
  color: var(--error);
}

.code {
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
  font-size: 1.75rem;
  letter-spacing: 0.15em;
}

/* The machines (package gate-machines). Text from a machine sits in <bdi>: its direction stays its own. */

bdi {
  unicode-bidi: isolate;
  overflow-wrap: anywhere;
}

.machine > div {
  flex: 1 1 18rem;
  min-width: 0;
}

.machine .details {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}

/* One line of details: text that flows, not the rows of `.list li`. */
.machine .details li {
  display: block;
  padding: 0.1rem 0;
  border: none;
}

.machine .label {
  color: var(--muted);
}

.status {
  margin: 0.25rem 0;
  font-weight: 600;
}

.status::before {
  content: "";
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  margin-right: 0.4rem;
  background: var(--muted);
}

.status.online::before {
  background: #1f9d55;
}

.status.offline::before {
  background: var(--error);
}

#add-machine h3 {
  font-size: 1rem;
  margin: 0;
}
