/* CICHR quote page. Builds on style.css (same tokens, dark theme). */
:root {
  --q-surface: #121212;
  --q-surface-2: #1b1b1b;
  --q-surface-3: #262626;
  --q-line: #333333;
  --q-line-strong: #5a5a5a;
  --q-muted: #a9b8bf;
  --q-ok: #7fd49b;
  --q-warn: #ffc56b;
  --q-error: #ff8a8a;
  --q-radius: 12px;
}

.quote-page {
  padding: calc(var(--header-height) + 48px) 0 96px;
  /* The site's light 300 weight is fine for large body copy, but too thin for the
     small form text here, so the quote page uses the normal weight. */
  font-weight: 400;
}

/* style.css sets p { font-weight: 300 }; :where() keeps this as weak as that rule
   (it wins by coming later) so classes such as .q-hint can still set their own weight. */
:where(.quote-page) p {
  font-weight: 400;
}

.quote-page .container {
  max-width: 1240px;
}

.quote-hero {
  max-width: 820px;
  margin-bottom: 40px;
}

.quote-hero h1 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  font-weight: 200;
}

.quote-hero h1 span {
  font-weight: 400;
}

.quote-hero p {
  color: var(--q-muted);
  font-size: clamp(1.02rem, 1.6vw, 1.25rem);
}

.quote-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 18px;
  color: var(--q-muted);
  font-size: 0.95rem;
  list-style: none;
}

.quote-steps li::before {
  display: inline-grid;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  place-items: center;
  border: 1px solid var(--q-line-strong);
  border-radius: 50%;
  color: #ffffff;
  content: counter(step);
  counter-increment: step;
  font-size: 0.8rem;
}

.quote-steps {
  counter-reset: step;
}

.quote-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.quote-main {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.q-panel {
  padding: 26px;
  border: 1px solid var(--q-line);
  border-radius: var(--q-radius);
  background: var(--q-surface);
}

.q-panel > h2 {
  margin-bottom: 6px;
  font-size: 1.45rem;
  font-weight: 400;
}

.q-panel > .q-lead {
  margin-bottom: 20px;
  color: var(--q-muted);
  font-size: 0.98rem;
}

.q-panel > h2 + .q-drop {
  margin-top: 18px;
}

/* Custom / adaptive layer height */
.q-layer-extra {
  display: flex;
  align-items: center;
  gap: 8px;
}

.q-layer-extra .q-input {
  flex: 1 1 0;
  min-width: 0;
}

/* Drop zone */
.q-drop {
  position: relative;
  display: grid;
  min-height: 210px;
  padding: 30px 20px;
  place-items: center;
  border: 2px dashed var(--q-line-strong);
  border-radius: var(--q-radius);
  background: var(--q-surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.q-drop:hover {
  border-color: #ffffff;
  background: #202020;
}

/* Full-page overlay while files are dragged over the window. */
.q-drop-overlay {
  position: fixed;
  z-index: 2000; /* above the site header (1100) */
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(40, 40, 40, 0.72);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.q-drop-overlay.is-visible {
  opacity: 1;
}

.q-drop-overlay-box {
  display: grid;
  gap: 8px;
  width: 100%;
  height: 100%;
  place-content: center;
  border: 3px dashed rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  color: #ffffff;
  text-align: center;
}

.q-drop-overlay-box strong {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 600;
}

.q-drop-overlay-box span {
  color: #d9e1e4;
  font-size: 1.05rem;
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  .q-drop-overlay {
    transition: none;
  }
}

.q-drop:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.q-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.q-drop-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  stroke: #ffffff;
}

.q-drop strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.15rem;
  font-weight: 500;
}

.q-drop small {
  display: block;
  max-width: 620px;
  color: var(--q-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.q-alert {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--q-warn);
  border-radius: 8px;
  color: var(--q-warn);
  font-size: 0.92rem;
}

.q-alert[hidden] {
  display: none;
}

/* File cards */
.q-files {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.q-file {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--q-line);
  border-radius: var(--q-radius);
  background: var(--q-surface-2);
}

.q-file.has-problem {
  border-color: var(--q-warn);
}

.q-thumb {
  position: relative;
  display: grid;
  min-height: 200px;
  place-items: center;
  border-right: 1px solid var(--q-line);
  background: radial-gradient(circle at 50% 40%, #2b2b2b, #141414 70%);
}

.q-thumb img {
  width: 100%;
  height: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 0;
}

.q-thumb .q-thumb-svg {
  padding: 14px;
}

/* Customer SVG artwork is usually dark, so show it on light "paper". */
.q-thumb img.q-paper,
.q-viewer-stage img.q-paper {
  background: #f1f3f4;
}

.q-thumb img.q-paper {
  width: calc(100% - 28px);
  height: auto;
  margin: 14px;
  border-radius: 8px;
}

.q-thumb-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.q-thumb-open {
  position: absolute;
  right: 10px;
  bottom: 10px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-size: 0.85rem;
  cursor: pointer;
}

.q-thumb-open:hover {
  background: #ffffff;
  color: #111111;
}

.q-thumb-msg {
  max-width: 180px;
  padding: 12px;
  color: var(--q-muted);
  font-size: 0.85rem;
  text-align: center;
}

.q-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #444444;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: q-spin 900ms linear infinite;
}

@keyframes q-spin {
  to { transform: rotate(360deg); }
}

.q-file-body {
  min-width: 0;
  padding: 18px 20px 20px;
}

.q-file-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.q-file-name {
  overflow: hidden;
  font-size: 1.02rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.q-file-meta {
  margin-top: 4px;
  color: var(--q-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.q-file-meta b {
  color: #ffffff;
  font-weight: 500;
}

.q-remove {
  flex: 0 0 auto;
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--q-line-strong);
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
}

.q-remove:hover {
  border-color: var(--q-error);
  color: var(--q-error);
}

.q-section-label {
  display: block;
  margin: 16px 0 8px;
  color: var(--q-muted);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Process chips */
.q-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.q-chip {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid var(--q-line-strong);
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.q-chip:hover {
  border-color: #ffffff;
}

.q-chip[aria-pressed="true"] {
  border-color: #ffffff;
  background: #ffffff;
  color: #111111;
}

.q-chip-step {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: #111111;
  color: #ffffff;
  font-size: 0.72rem;
}

.q-chain {
  margin-top: 10px;
  color: var(--q-muted);
  font-size: 0.88rem;
}

.q-chain b {
  color: #ffffff;
  font-weight: 500;
}

.q-hint {
  margin-top: 8px;
  color: var(--q-warn);
  font-size: 0.86rem;
  font-weight: 500;
}

.q-hint[hidden] {
  display: none;
}

/* Form fields */
.q-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px 14px;
}

.q-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.q-field > span {
  color: var(--q-muted);
  font-size: 0.86rem;
  font-weight: 500;
}

.q-field.q-wide {
  grid-column: 1 / -1;
}

.q-input,
.q-select,
.q-textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--q-line-strong);
  border-radius: 8px;
  background: #0b0b0b;
  color: #ffffff;
  font: inherit;
  font-size: 0.95rem;
}

.q-select {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, #ffffff 50%), linear-gradient(135deg, #ffffff 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.q-textarea {
  min-height: 92px;
  resize: vertical;
}

.q-input:focus,
.q-select:focus,
.q-textarea:focus {
  border-color: #ffffff;
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.q-input[aria-invalid="true"],
.q-textarea[aria-invalid="true"] {
  border-color: var(--q-error);
}

.q-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--q-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.q-check input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: #ffffff;
}

.q-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Summary */
.quote-summary {
  position: sticky;
  top: calc(var(--header-height) + 20px);
}

.q-summary-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  list-style: none;
}

.q-summary-list li {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--q-line);
  font-size: 0.9rem;
  line-height: 1.45;
}

.q-summary-list li span {
  display: block;
  color: var(--q-muted);
  font-size: 0.82rem;
}

.q-summary-list li.is-warn span {
  color: var(--q-warn);
}

.q-summary-empty {
  color: var(--q-muted);
  font-size: 0.92rem;
}

.q-summary-total {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  font-size: 0.95rem;
}

.q-summary-price {
  margin: 8px 0 18px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--q-surface-3);
  color: var(--q-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.q-submit {
  width: 100%;
  min-height: 56px;
  border: 1px solid #ffffff;
  border-radius: 10px;
  background: #ffffff;
  color: #111111;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.q-submit:hover:not(:disabled) {
  background: #2f2f2f;
  color: #ffffff;
}

.q-submit:disabled {
  opacity: 0.55;
  cursor: progress;
}

.q-progress {
  height: 6px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 3px;
  background: #2a2a2a;
}

.q-progress[hidden] {
  display: none;
}

.q-progress > div {
  width: 0;
  height: 100%;
  background: #ffffff;
  transition: width 120ms linear;
}

.q-status {
  margin-top: 12px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.q-status.is-error {
  color: var(--q-error);
}

.q-status.is-ok {
  color: var(--q-ok);
}

.q-success {
  padding: 34px 26px;
  border: 1px solid var(--q-ok);
  border-radius: var(--q-radius);
  background: var(--q-surface);
  text-align: center;
}

.q-success h2 {
  margin-bottom: 10px;
  font-size: 1.7rem;
  font-weight: 400;
}

.q-success p {
  color: var(--q-muted);
}

.q-success code {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 7px;
  background: var(--q-surface-3);
  color: #ffffff;
  font-size: 1.05rem;
}

/* Small buttons */
.q-btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--q-line-strong);
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font-size: 0.9rem;
  cursor: pointer;
}

.q-btn:hover {
  border-color: #ffffff;
}

/* 3D viewer dialog */
.q-viewer {
  width: min(1100px, 94vw);
  height: min(780px, 88vh);
  margin: auto; /* style.css resets * { margin: 0 }, which breaks native dialog centring */
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--q-line-strong);
  border-radius: var(--q-radius);
  background: #0d0d0d;
  color: #ffffff;
}

.q-viewer::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.q-viewer-inner {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
}

.q-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--q-line);
}

.q-viewer-head strong {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.q-viewer-stage {
  position: relative;
  min-height: 0;
}

.q-viewer-stage canvas,
.q-viewer-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}

.q-viewer-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--q-line);
  color: var(--q-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1080px) {
  .quote-layout {
    grid-template-columns: 1fr;
  }

  .quote-summary {
    position: static;
  }
}

@media (max-width: 680px) {
  .quote-page {
    padding-top: calc(var(--header-height) + 24px);
  }

  .q-panel {
    padding: 18px 16px;
  }

  .q-file {
    grid-template-columns: 1fr;
  }

  .q-thumb {
    min-height: 190px;
    border-right: 0;
    border-bottom: 1px solid var(--q-line);
  }

  .q-file-body {
    padding: 16px;
  }

  .q-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 420px) {
  .q-grid {
    grid-template-columns: 1fr;
  }
}
