/* Free 3D file converter, /tools/stl-converter. Loaded after home.css,
   pages.css and marketing-v2.css, whose pearl tokens (--blue, --blue-ink,
   --text, --text-muted, --surface-border, --shadow, --display, --mono) it
   uses. Every class is sc-* so nothing here reaches another page.

   Two rules hold the phone layout together (no horizontal scroll at 360 px):
   grid children carry min-width:0, so a long file name or a select cannot
   force its column wider than the screen, and file names wrap anywhere
   (scan exports are often one unbroken string of digits and underscores). */

.sc-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* The hidden attribute is only the browser's display:none, and any class that
   sets display (grid, flex, inline-flex) beats it -- which is how "Loading the
   3D preview…" stayed over a model that had long since loaded. main.js shows
   and hides by toggling `hidden` (the preview overlay, the Rotate button, row
   warnings and errors, the list footer), so here it always wins. */
.sc-main [hidden],
.sc-viewer-empty[hidden] { display: none !important; }

/* position + z-index: the fixed cloud canvas paints over anything that is not
   positioned (see contact.blade.php). */
.sc-main { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 5% 90px; }

.sc-tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.sc-tool > * { min-width: 0; }

.sc-panel {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}

/* ---- drop zone ---- */
.sc-drop {
  display: grid; justify-items: center; gap: 6px; text-align: center;
  padding: 30px 20px 26px;
  border: 2px dashed rgba(59,130,246,.45);
  border-radius: 16px;
  background: rgba(239,246,255,.75);
  transition: border-color .15s, background .15s;
}
.sc-drop.is-over, body.sc-dragging .sc-drop { border-style: solid; border-color: var(--blue); background: rgba(219,234,254,.9); }
.sc-drop-icon { width: 44px; height: 44px; color: var(--blue); }
.sc-drop-title { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--text); }
.sc-drop-or { font-size: 13px; color: var(--text-muted); }
.sc-drop-formats { margin-top: 8px; font-size: 13px; color: var(--text-muted); max-width: 46ch; }

.sc-private {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 14px; padding: 12px 14px;
  border-radius: 12px;
  background: rgba(22,163,74,.08);
  border: 1px solid rgba(22,163,74,.25);
  color: #14532d; font-size: 14px; line-height: 1.5;
}
.sc-private svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: #15803d; }

/* ---- controls ---- */
.sc-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 18px; }
.sc-field { display: grid; gap: 6px; min-width: 0; }
.sc-label { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.sc-select {
  width: 100%; min-width: 0;
  appearance: none; -webkit-appearance: none;
  padding: 11px 38px 11px 12px;
  border: 1px solid rgba(200,210,225,.95); border-radius: 10px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23475569' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 13px center / 12px 8px;
  font: inherit; font-size: 15px; color: var(--text);
  cursor: pointer;
}
.sc-select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sc-hint { margin-top: 10px; font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.sc-status { margin-top: 16px; font-size: 14px; font-weight: 600; color: var(--text); min-height: 1.5em; }
.sc-status-error { color: #b91c1c; }

/* ---- buttons ----
   Colours meet WCAG AA (4.5:1) for their 13-14px labels. The site's --blue
   (#3b82f6) gives white text only 3.7:1, so this page's filled buttons use
   #2563eb (5.2:1), darkening to #1d4ed8 (6.7:1) on hover; the pressed Preview
   button's ink is #1e40af on #eff6ff (8.0:1, --blue-ink there was 3.8:1); the
   text button is #1d4ed8 on white (6.7:1). Scoped to this page's sc-* buttons
   and its own call to action; the nav's CTA and other pages are untouched.
   A button busy building a download is aria-disabled, not disabled (keyboard
   focus stays on it), so the hover and dimmed states key off both. */
.sc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 9px 16px;
  border-radius: 10px; border: 1px solid rgba(15,23,42,.14);
  background: #fff; color: var(--text);
  font-family: var(--display); font-weight: 600; font-size: 14px; line-height: 1.2;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.sc-btn:hover:not(:disabled):not([aria-disabled="true"]) { border-color: #2563eb; }
.sc-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sc-btn:disabled, .sc-btn[aria-disabled="true"] { opacity: .55; cursor: default; }
/* Busy keeps full colour: "Building STL…" is the message, and must stay legible. */
.sc-btn[aria-busy="true"] { opacity: 1; cursor: progress; }
.sc-btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; box-shadow: 0 6px 18px rgba(37,99,235,.26); }
.sc-btn-primary:hover:not(:disabled):not([aria-disabled="true"]) { background: #1d4ed8; border-color: #1d4ed8; transform: translateY(-1px); }
.sc-btn[aria-pressed="true"] { background: #eff6ff; border-color: #2563eb; color: #1e40af; }
.sc-btn-small { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.sc-btn svg { width: 15px; height: 15px; flex: none; }
.sc-link-btn { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 14px; font-weight: 600; color: #1d4ed8; cursor: pointer; }
.sc-link-btn:hover { text-decoration: underline; }
.sc-link-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.sc-icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border: 1px solid transparent; border-radius: 10px;
  background: none; color: var(--text-muted); cursor: pointer;
}
.sc-icon-btn svg { width: 16px; height: 16px; }
.sc-icon-btn:hover { background: rgba(15,23,42,.06); color: var(--text); }
.sc-icon-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---- result rows ---- */
.sc-rows { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.sc-rows:empty { display: none; }
/* Name and details on top with Remove in the corner; Preview and Download on
   their own line below, so the name always gets the row's full width. */
.sc-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main remove" "actions actions";
  gap: 10px 6px; align-items: start;
  padding: 14px 10px 14px 16px;
  border: 1px solid rgba(200,210,225,.8); border-radius: 14px;
  background: #fff;
}
.sc-row.is-selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.14); }
.sc-row-main { grid-area: main; min-width: 0; padding-top: 2px; }
.sc-row-remove { grid-area: remove; margin-top: -6px; }
.sc-row-name { font-weight: 700; color: var(--text); overflow-wrap: anywhere; word-break: break-word; line-height: 1.35; }
.sc-row-meta { margin-top: 3px; font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.sc-row-meta b { font-weight: 600; color: var(--text); }
.sc-seg { display: inline-block; max-width: 100%; }
.sc-row-warn, .sc-row-error, .sc-row-note { margin-top: 6px; font-size: 13px; line-height: 1.45; }
.sc-row-warn { color: #92400e; background: rgba(245,158,11,.12); border-radius: 8px; padding: 6px 9px; }
.sc-row-error { color: #b91c1c; }
.sc-row-note { color: var(--text-muted); }
.sc-row-actions { grid-area: actions; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sc-row-actions:empty { display: none; }
.sc-row.is-pending .sc-row-meta::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 7px; vertical-align: -1px;
  border: 2px solid rgba(59,130,246,.3); border-top-color: var(--blue); border-radius: 50%;
  animation: sc-spin .8s linear infinite;
}
@keyframes sc-spin { to { transform: rotate(360deg); } }
.sc-rows-foot { margin-top: 10px; text-align: right; }

/* ---- preview ---- */
.sc-preview { position: sticky; top: 84px; }
.sc-preview-head { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 34px; margin-bottom: 12px; }
.sc-preview-title { font-size: 18px; font-weight: 700; color: var(--text); flex: none; }
.sc-preview-name { min-width: 0; font-size: 14px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Rotate sits at the right end; the file name between shrinks (ellipsis). */
.sc-rotate { margin-left: auto; flex: none; }
.sc-viewer {
  position: relative; overflow: hidden;
  width: 100%; aspect-ratio: 1 / 1;
  border-radius: 14px;
  background:
    radial-gradient(120% 90% at 50% 0%, #ffffff 0%, #eef3fa 55%, #dfe7f2 100%);
  border: 1px solid rgba(200,210,225,.8);
}
.sc-viewer:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sc-viewer canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.sc-viewer-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; font-size: 14px; color: var(--text-muted); }

/* ---- FAQ ---- */
.sc-faq { position: relative; z-index: 1; max-width: 760px; margin: 70px auto 0; }
.sc-faq h2, .sc-cta h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; color: var(--text); margin: 6px 0 20px; }
.sc-faq .pg-eyebrow, .sc-cta .pg-eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-ink); }
.sc-faq-item { background: rgba(255,255,255,.92); border: 1px solid var(--surface-border); border-radius: 14px; box-shadow: 0 4px 14px rgba(15,23,42,.05); }
.sc-faq-item + .sc-faq-item { margin-top: 10px; }
.sc-faq-item summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 18px; cursor: pointer; list-style: none;
  font-weight: 600; color: var(--text);
}
.sc-faq-item summary::-webkit-details-marker { display: none; }
.sc-faq-item summary::after { content: "+"; flex: none; font-size: 22px; line-height: 1; color: var(--blue-ink); }
.sc-faq-item[open] summary::after { content: "\2212"; }
.sc-faq-item summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 14px; }
.sc-faq-body { padding: 0 18px 16px; color: var(--text-muted); line-height: 1.65; }
.sc-faq-body p + p { margin-top: 10px; }

/* ---- call to action ---- */
.sc-cta {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: center;
  margin: 60px auto 0; padding: 34px 36px;
  border-radius: 22px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
}
.sc-cta h2 { margin-bottom: 12px; }
.sc-cta p { color: var(--text-muted); line-height: 1.65; max-width: 62ch; }
.sc-cta-actions { display: flex; flex-direction: column; gap: 12px; }
.sc-cta-actions a { justify-content: center; }
/* "Book a demo" is the site-wide .hp-btn-primary (white on #3b82f6, 3.7:1);
   here, and only here, it gets the same AA blue as the converter's buttons. */
.sc-cta .hp-btn-primary { background: #2563eb; box-shadow: 0 0 20px rgba(37,99,235,.26); }
.sc-cta .hp-btn-primary:hover { background: #1d4ed8; }

@media (max-width: 960px) {
  .sc-tool { grid-template-columns: minmax(0, 1fr); }
  .sc-preview { position: relative; top: auto; }
  .sc-viewer { aspect-ratio: 4 / 3; }
  .sc-cta { grid-template-columns: minmax(0, 1fr); }
  .sc-cta-actions { flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 600px) {
  .sc-main { padding: 0 16px 70px; }
  .sc-panel { padding: 18px 16px; border-radius: 18px; }
  .sc-controls { grid-template-columns: minmax(0, 1fr); }
  .sc-row { padding: 12px 8px 12px 14px; }
  .sc-cta { padding: 26px 20px; }
  .sc-cta-actions a { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .sc-row.is-pending .sc-row-meta::before { animation: none; }
  .sc-btn, .sc-drop { transition: none; }
}
