/* Wildwood Field Tool beta portal: dark theme. Restyle by changing the tokens. */
:root {
  --bg: #0f1412;
  --surface: #171e1a;
  --surface-2: #1d2621;
  --border: #2b3731;
  --text: #e6ece8;
  --muted: #98a69e;
  --accent: #6fbf73;
  --accent-strong: #8fd893;
  --accent-ink: #0d1a10;
  --danger: #f08080;
  --warning: #e8c46a;
  --focus: #9fd8ff;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
}
a { color: var(--accent-strong); }
code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  overflow-wrap: anywhere;
}
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 0.5rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 0.75rem; display: flex; align-items: center; gap: 0.6rem; }
.lead { color: var(--muted); margin: 0 0 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.mock-banner {
  background: #3a3015;
  color: var(--warning);
  text-align: center;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 16px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--text); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 650; font-size: 1.1rem; letter-spacing: 0.01em; }
.brand-tagline { color: var(--muted); font-size: 0.8rem; }
.beta-pill {
  font-size: 0.75rem;
  color: var(--accent-strong);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
}

.content { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px 2rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 4vw, 2rem);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 16px 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Forms */
fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; min-width: 0; }
legend {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
  padding: 0;
}
.field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; min-width: 0; }
.field.narrow { max-width: 220px; }
label { font-weight: 550; font-size: 0.95rem; }
input[type="text"], input[type="email"], input[type="number"], input[type="password"], input:not([type]) {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  min-height: 44px;
}
input:focus-visible, .button:focus-visible, .checkbox input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
input[aria-invalid="true"] { border-color: var(--danger); }
.hint { margin: 0; color: var(--muted); font-size: 0.85rem; }
.field-error { margin: 0; color: var(--danger); font-size: 0.85rem; }
.field-error:empty, .field-status:empty { display: none; }
.field-status { margin: 0; font-size: 0.85rem; color: var(--muted); }
.field-status.ok { color: var(--accent-strong); }
.field-status.bad { color: var(--danger); }
.form-error { margin-bottom: 1rem; }
.checkbox { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; margin-bottom: 1rem; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--accent); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }

.user-rows { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.user-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 1rem;
  align-items: start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem 0;
}
.user-row .field { margin-bottom: 0.85rem; }
.row-label { font-weight: 600; color: var(--muted); padding-top: 2rem; font-size: 0.9rem; }
.owner-row { grid-template-columns: 4.5rem minmax(0, 1fr); padding-bottom: 0.85rem; }
.owner-row .row-label { padding-top: 0; }
.owner-summary { overflow-wrap: anywhere; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { border-color: var(--accent); }
.button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-strong); }
.button.small { min-height: 34px; padding: 0.3rem 0.75rem; font-size: 0.85rem; }
.button[disabled] { opacity: 0.6; cursor: progress; }
.actions { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; }

/* Status page */
.steps { list-style: none; padding: 0; margin: 0 0 1.5rem; display: flex; flex-direction: column; gap: 0.55rem; }
.steps li { display: flex; align-items: center; gap: 0.7rem; color: var(--muted); }
.steps li::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--border);
}
.steps li.running { color: var(--text); }
.steps li.running::before { border-color: var(--accent); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.steps li.done { color: var(--text); }
.steps li.done::before { background: var(--accent); border-color: var(--accent); }
.steps li.failed { color: var(--danger); }
.steps li.failed::before { background: var(--danger); border-color: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .steps li.running::before { animation: none; } }

.notice { border-radius: 10px; padding: 0.85rem 1rem; margin: 0 0 1rem; border: 1px solid var(--border); }
.notice p { margin: 0.25rem 0; }
.notice.success { border-color: #2f5d36; background: #15261a; }
.notice.mock { border-color: #5a4a1d; background: #221d10; }
.notice.danger { border-color: #6a2e2e; background: #2a1515; }
.link-list { margin: 0.5rem 0 0; padding-left: 1.2rem; overflow-wrap: anywhere; }

/* Setup pages */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 1rem; margin: 0 0 1.5rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.step-num {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.9rem;
}
.stores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.store {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}
.qr { background: #fff; border-radius: 8px; padding: 6px; line-height: 0; }
.qr svg { width: 168px; height: 168px; max-width: 100%; }
.instructions { padding-left: 1.3rem; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.copy-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.4rem 0; flex-wrap: wrap; }

/* Sketch of QField's sign-in screen, before and after revealing the Server URL box */
.login-sketch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
}
.phone {
  margin: 0;
  width: 150px;
  flex: 0 1 150px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 10px 10px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 18px;
  font-size: 0.68rem;
}
.phone-logo {
  position: relative;
  align-self: center;
  width: 54px;
  height: 54px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: #2d6fb0;
}
.phone-logo::after {
  content: "";
  position: absolute;
  inset: 17px 12px;
  border-radius: 10px;
  background: #e8f1fa;
}
.tap-mark {
  position: absolute;
  inset: -7px;
  z-index: 1;
  border: 2px dashed var(--warning);
  border-radius: 50%;
}
.tap-mark::before {
  content: "×2";
  position: absolute;
  top: -6px;
  right: -14px;
  color: var(--warning);
  font-weight: 700;
  font-size: 0.8rem;
}
.phone-label { color: var(--warning); font-weight: 600; }
.phone-field {
  border-bottom: 1px solid var(--border);
  padding: 4px 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.phone-field.placeholder { color: var(--muted); }
.phone-field.filled { color: var(--text); }
.phone-field.server { border-bottom-color: var(--warning); }
.phone-button {
  margin-top: 4px;
  text-align: center;
  padding: 5px;
  border-radius: 6px;
  background: #2d6fb0;
  color: #fff;
  font-weight: 600;
}
.phone figcaption { margin-top: 6px; text-align: center; color: var(--muted); }
.sketch-arrow { color: var(--muted); font-size: 1.4rem; }

.troubleshoot {
  margin: 1rem 0 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}
.troubleshoot summary { cursor: pointer; font-weight: 600; }
.troubleshoot ul { margin: 0.75rem 0 0.25rem; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; }

@media (max-width: 600px) {
  h1 { font-size: 1.35rem; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .user-row { grid-template-columns: minmax(0, 1fr); }
  .row-label { padding-top: 0; margin-bottom: 0.5rem; }
  .owner-row { grid-template-columns: minmax(0, 1fr); }
  .field.narrow { max-width: none; }
  .stores { grid-template-columns: minmax(0, 1fr); }
}
