/* bimconvert.css — IFC to GeoJSON/KML converter.
   Dark theme; palette mirrors the main dantine.dev site
   (bg #0E0E10, text #EDEAE4, DM Sans/Serif, accent #7EB3E8). Self-contained:
   does not import the root stylesheet. */

:root {
  --bg:            #0E0E10;
  --surface:       #17171A;
  --surface-2:     #1E1E22;
  --ink:           #EDEAE4;
  --muted:         #9A9896;
  --faint:         #5A5858;
  --line:          #252528;
  --line-strong:   #363639;
  --accent:        #7EB3E8;
  --accent-dark:   #5A96D4;
  --good:          #7ED39B;
  --warn:          #E8C87E;
  --bad:           #E8746A;

  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-sans:    'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --max-w: 1100px;
  --t-fast: 140ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 1.25rem;
}
@media (min-width: 640px) { .container { padding-inline: 2rem; } }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
}

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  left: 0; top: -3rem;
  background: var(--accent);
  color: #0A0A0C;
  padding: 0.5rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
  transition: top var(--t-fast);
}
.skip-link:focus { top: 0; }

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

/* ---------- Header / footer ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.header-inner {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding-block: 1rem;
}
.wordmark { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); }
.wordmark:hover { color: var(--accent); text-decoration: none; }
.header-tool { color: var(--muted); font-size: 0.9rem; }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  padding-block: 1.5rem;
  color: var(--faint);
  font-size: 0.85rem;
}

/* ---------- Headings ---------- */
main { padding-block: 2.5rem 3rem; }
h1 { font-family: var(--font-display); font-size: 2.5rem; line-height: 1.15; margin-bottom: 0.75rem; }
h2 { font-size: 1.25rem; font-weight: 500; margin-bottom: 1rem; }
h3 { font-size: 1rem; font-weight: 500; margin: 1.75rem 0 0.5rem; }

.lede { color: var(--muted); max-width: 62ch; margin-bottom: 1rem; }

.privacy {
  border-left: 2px solid var(--good);
  padding: 0.6rem 0 0.6rem 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 62ch;
  margin-bottom: 2rem;
}
.privacy strong { color: var(--ink); font-weight: 500; }

/* ---------- Steps ---------- */
.steps ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.step-item {
  display: flex; align-items: center; gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.75rem 0.35rem 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.step-item.is-active { color: var(--ink); border-color: var(--accent); }
.step-item.is-disabled { opacity: 0.5; }
.step-num {
  display: grid; place-items: center;
  width: 1.35rem; height: 1.35rem;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 0.75rem;
}
.step-item.is-active .step-num { background: var(--accent); color: #0A0A0C; }

/* ---------- Panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.panel-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: var(--surface-2); }
.dropzone.is-drag { border-color: var(--accent); background: rgba(126, 179, 232, 0.08); }
.dropzone-title { font-size: 1.1rem; margin-bottom: 0.25rem; }
.dropzone-sub { color: var(--muted); }
.dropzone-hint { color: var(--faint); font-size: 0.8rem; margin-top: 0.75rem; }

.link-btn {
  background: none; border: none; padding: 0;
  color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline;
}
.link-btn:hover { color: var(--accent-dark); }

/* ---------- Buttons ---------- */
.btn {
  font: inherit;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.btn-primary { background: var(--accent); color: #0A0A0C; font-weight: 500; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { background: var(--surface-2); color: var(--faint); cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-small { padding: 0.3rem 0.7rem; font-size: 0.85rem; }

/* The [hidden] attribute must beat any author rule that sets `display`.
   The UA stylesheet's `[hidden] { display: none }` loses to *any* author
   declaration, so `.status { display: flex }` alone left the loading spinner
   turning on page load. */
[hidden] { display: none !important; }

/* ---------- Status / messages ---------- */
.status { display: flex; align-items: center; gap: 0.6rem; margin-top: 1rem; color: var(--muted); font-size: 0.9rem; }
.spinner {
  width: 0.9rem; height: 0.9rem;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

.error-box, .warn-box, .note {
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-top: 1rem;
}
.error-box { background: rgba(232, 116, 106, 0.1); border: 1px solid rgba(232, 116, 106, 0.35); color: var(--ink); }
.warn-box  { background: rgba(232, 200, 126, 0.08); border: 1px solid rgba(232, 200, 126, 0.3); color: var(--ink); }
.note      { background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); margin-top: 0; margin-bottom: 1.25rem; }
.warn-box ul { margin: 0.5rem 0 0 1.1rem; }
.warn-box .field-hint { margin-top: 0.5rem; }

/* ---------- Facts list ---------- */
.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.25rem;
  margin-top: 1.25rem;
  font-size: 0.9rem;
}
.facts.compact { margin-top: 1rem; font-size: 0.85rem; }
.facts dt { color: var(--muted); }
.facts dd { color: var(--ink); }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 0.9rem; }
.field-label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.3rem; }
.field-hint { color: var(--faint); font-size: 0.8rem; }
.field-hint.indent { margin: 0.1rem 0 0.85rem 1.6rem; max-width: 58ch; }

.input {
  width: 100%;
  font: inherit;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.6rem;
}
.input:focus-visible { border-color: var(--accent); }

.field-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}
.field-group legend { padding-inline: 0.4rem; font-size: 0.85rem; color: var(--muted); }
.field-group legend .field-hint { display: block; }

.offset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.check { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; font-size: 0.95rem; }
.check input { accent-color: var(--accent); width: 1rem; height: 1rem; }

.tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}
.tag-good { color: var(--good); border-color: rgba(126, 211, 155, 0.4); }

/* ---------- CRS step ---------- */
.crs-grid { display: grid; gap: 1.5rem; }
@media (min-width: 860px) { .crs-grid { grid-template-columns: 20rem 1fr; } }

.crs-map {
  width: 100%;
  height: 22rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
}
@media (min-width: 860px) { .crs-map { height: 26rem; } }

.map-toolbar { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.6rem; flex-wrap: wrap; }
.map-hint { color: var(--faint); font-size: 0.8rem; }

/* MapLibre's own controls sit on a light chrome by default. */
.maplibregl-ctrl-attrib { font-size: 0.65rem; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
.table-scroll.short { max-height: 18rem; overflow-y: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th, .data-table td {
  text-align: left;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table th { color: var(--muted); font-weight: 500; position: sticky; top: 0; background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table code { background: none; padding: 0; color: var(--muted); }

/* ---------- Downloads ---------- */
.downloads { list-style: none; margin-top: 1.25rem; display: grid; gap: 0.5rem; }
.downloads li {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
}
.downloads .file-name { font-family: var(--font-mono); font-size: 0.85rem; }
.downloads .file-size { color: var(--faint); font-size: 0.8rem; margin-left: auto; }

/* A field name the ArcGIS sanitiser had to rewrite. */
.data-table td.changed { color: var(--warn); font-family: var(--font-mono); font-size: 0.8rem; }
