/* Photos in the moving form (beta AI feature): the optional block that
   photo-quote.js renders into step 3 of #multi-step-form, and the result view
   it shows in #quote-box-photo-content after a submit with photos. Colours and
   radii come from the :root tokens in style.css, so dark mode follows along. */

/* --- The block in step 3 --- */
.pq-block { margin: 6px 0 4px; }
.pq-block-card {
  text-align: left; padding: 18px 18px 16px;
  border: 2px solid var(--accent-color); border-radius: var(--border-radius);
  background: linear-gradient(180deg, rgba(174, 242, 252, 0.22) 0%, var(--base-bg) 100%);
}
.pq-block-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; font-weight: 700; font-size: 1.05rem; color: var(--heading-color); }
.pq-block-head > i { color: var(--primary-original); }
.pq-ai-line { margin: 8px 0 6px; font-size: 0.85rem; font-weight: 600; line-height: 1.5; color: var(--primary-original); }
.pq-ai-line i { margin-right: 2px; }
.pq-block-lead { margin: 0 0 12px; font-size: 0.9rem; line-height: 1.55; color: var(--dark-text); }
.pq-block-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.pq-add { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; }
.pq-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.pq-file-input:focus-visible ~ .pq-block-actions .pq-add { box-shadow: 0 0 0 3px var(--focus-ring); }
.pq-block-tips { margin: 8px 0 0; font-size: 0.82rem; line-height: 1.5; color: var(--muted-text); }
/* The site's .form-group styles the label and textarea like the form's own fields. */
.pq-desc { margin: 14px 0 0; padding-bottom: 0; }
.pq-desc[hidden] { display: none; }
.pq-desc-hint { display: block; margin-top: 4px; font-size: 0.78rem; line-height: 1.45; color: var(--muted-text); }
.pq-photo-count { font-size: 0.85rem; color: var(--muted-text); }
.pq-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; margin-top: 12px; }
.pq-thumb { position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: var(--secondary-cta); border: 1px solid var(--border-color); }
.pq-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pq-thumb-remove {
  position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: none;
  background: rgba(30, 33, 41, 0.75); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 0.85rem;
}
.pq-thumb-remove:hover { background: var(--error-color); }
.pq-thumb-spinner, .pq-spinner {
  width: 28px; height: 28px; border: 3px solid rgba(61, 90, 128, 0.2); border-top-color: var(--primary-original);
  border-radius: 50%; animation: pq-spin 0.8s linear infinite;
}
.pq-thumb-spinner { position: absolute; top: 50%; left: 50%; margin: -14px 0 0 -14px; }
@keyframes pq-spin { to { transform: rotate(360deg); } }
.pq-error {
  display: none; margin: 10px 0 0; padding: 10px 14px; border-radius: 8px;
  background: var(--error-bg); color: var(--error-color); font-size: 0.9rem; border: 1px solid rgba(220, 53, 69, 0.3);
}
.pq-privacy { margin: 12px 0 0; font-size: 0.8rem; line-height: 1.5; color: var(--muted-text); }
.pq-privacy a { color: var(--link-color); }

/* The background read: running, done, unusable photos, failed */
.pq-analysis {
  display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 0; padding: 10px 14px;
  border-radius: 10px; font-size: 0.88rem; line-height: 1.45; border: 1px solid var(--border-color); background: var(--secondary-cta);
}
.pq-analysis[hidden] { display: none; }
.pq-analysis i { margin-top: 3px; }
.pq-analysis--done { border-color: rgba(40, 167, 69, 0.35); background: rgba(40, 167, 69, 0.08); }
.pq-analysis--done i { color: #1f8a3b; }
.pq-analysis--failed i { color: var(--primary-original); }
.pq-analysis--unusable { border-color: rgba(255, 159, 28, 0.5); background: rgba(255, 159, 28, 0.1); }
.pq-analysis--unusable i { color: #b76a00; }
.pq-analysis-body { flex: 1 1 auto; min-width: 0; }
.pq-analysis-body p { margin: 0; }
.pq-analysis-body .pq-analysis-summary { margin-top: 4px; font-weight: 600; color: var(--heading-color); }
.pq-analysis .pq-suggest { margin: 10px 0 2px; padding: 10px 12px; border-width: 1px; background: var(--base-bg); }
.pq-analysis .pq-suggest i { margin-top: 0; color: var(--primary-original); }
.pq-analysis .pq-suggest-btn.is-added i { color: #fff; }
.pq-analyse { margin-top: 14px; }
.pq-analyse[hidden] { display: none; }
.pq-analyse:disabled { opacity: 0.7; cursor: default; transform: none; }
.pq-analysis-spinner {
  flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%;
  border: 2px solid rgba(61, 90, 128, 0.2); border-top-color: var(--primary-original); animation: pq-spin 0.8s linear infinite;
}

/* Beta marks */
.pq-beta {
  display: inline-block; padding: 2px 9px; border-radius: 999px; vertical-align: middle;
  font-family: var(--font-body); font-size: 0.68rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  background: var(--primary-original); color: #fff;
}

/* --- The result view (after a submit with photos) --- */
#quote-box-photo-content { position: relative; padding-top: 50px; text-align: left; }
#quote-box-photo-content #back-to-selection-btn-photo { display: block; }
.pq .form-main-title { text-align: center; }
@keyframes pq-step-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
#quote-box-photo-content { animation: contentFadeIn 0.4s ease-in-out; }
.pq-result, .pq-processing { animation: pq-step-in 0.4s ease-out; }
@media (prefers-reduced-motion: reduce) {
  #quote-box-photo-content, .pq-result, .pq-processing { animation: none; }
}
/* Step titles are inline-block with an underline and sit wherever the parent
   aligns them; the moving form centres them, so centre them here too. */
.pq .step-title { display: table; margin-left: auto; margin-right: auto; margin-bottom: 1em; }

.pq-processing { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 50px 0 60px; text-align: center; }
.pq-spinner { width: 44px; height: 44px; border-width: 4px; }
.pq-processing-text { font-weight: 600; color: var(--heading-color); margin: 0; }

.pq-price-card {
  text-align: center; padding: 22px 20px 18px; margin-bottom: 16px;
  border-radius: var(--border-radius); border: 2px solid var(--accent-color);
  background: linear-gradient(180deg, rgba(174, 242, 252, 0.3) 0%, var(--base-bg) 100%);
}
.pq-price-label { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; color: var(--primary-original); }
.pq-price-label .pq-beta { margin-left: 6px; letter-spacing: 1px; }
.pq-price { font-family: var(--font-heading); font-size: 3.4rem; line-height: 1; color: var(--heading-color); margin: 6px 0 2px; letter-spacing: 1px; }
.pq-price-unit { font-size: 2rem; }
.pq-price-vat { font-size: 0.85rem; color: var(--muted-text); }
.pq-breakdown { max-width: 360px; margin: 14px auto 0; display: grid; gap: 4px; font-size: 0.9rem; text-align: left; }
.pq-breakdown-row { display: flex; justify-content: space-between; gap: 12px; }
.pq-breakdown-row span:last-child { font-weight: 600; white-space: nowrap; }
.pq-includes { margin: 12px auto 0; max-width: 460px; font-size: 0.92rem; line-height: 1.55; }

.pq-suggest { margin: 0 0 16px; padding: 14px 16px; border-radius: var(--border-radius); border: 2px solid var(--accent-color); background: rgba(174, 242, 252, 0.12); }
.pq-suggest-title { font-weight: 700; color: var(--heading-color); margin-bottom: 8px; }
.pq-suggest-title i { color: var(--primary-original); }
.pq-suggest-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border-color); }
.pq-suggest-row:first-of-type { border-top: 0; }
.pq-suggest-text { font-size: 0.9rem; line-height: 1.45; color: var(--dark-text); }
.pq-suggest-btn {
  flex: 0 0 auto; min-height: 40px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--primary-original); background: var(--base-bg); color: var(--primary-original);
  font-family: var(--font-body); font-weight: 600; font-size: 0.85rem;
}
.pq-suggest-btn.is-added { background: var(--primary-original); color: #fff; }
.pq-suggest-btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

.pq-result-lead { max-width: 520px; margin: -6px auto 22px; text-align: center; font-size: 1rem; line-height: 1.55; color: var(--dark-text); }
.pq-result-note {
  margin: 0 0 16px; padding: 10px 14px; font-size: 0.86rem; line-height: 1.55; color: var(--dark-text);
  border-radius: 10px; background: var(--secondary-cta); border: 1px dashed var(--border-color);
}
.pq-result-note i { color: var(--primary-original); margin-right: 4px; }
.pq-basis-title { font-weight: 700; margin-bottom: 6px; color: var(--heading-color); }
.pq-basis-list { margin: 0 0 14px; padding-left: 1.2em; font-size: 0.92rem; line-height: 1.55; }
.pq-basis-list li + li { margin-top: 4px; }
.pq-basis-note { list-style: none; margin-left: -1.2em; padding: 8px 12px; border-left: 3px solid var(--accent-color); background: rgba(174, 242, 252, 0.15); }

.pq-basis {
  margin: 0 0 18px; padding: 14px 18px;
  border: 1px solid var(--border-color); border-radius: var(--border-radius);
  background: var(--secondary-cta);
}
.pq-basis .pq-basis-list { margin-bottom: 0; }
.pq-basis .pq-basis-title { margin-bottom: 8px; }

.pq-nowrap { white-space: nowrap; }
.pq-urgent { margin: 18px 0 0; text-align: center; font-size: 0.92rem; line-height: 1.55; color: var(--dark-text); }
.pq-urgent a { white-space: nowrap; font-weight: 600; }
.pq-result .thank-you-actions { margin-top: 18px; text-align: center; }

@media (max-width: 600px) {
  .pq-block-card { padding: 16px 14px 14px; }
  .pq-price { font-size: 2.9rem; }
  .pq-suggest-row { flex-direction: column; align-items: flex-start; }
  .pq-analyse { width: 100%; }
}

/* Dark theme */
:root[data-theme="dark"] .pq-block-card { background: linear-gradient(180deg, rgba(127, 231, 247, 0.1) 0%, var(--form-bg) 100%); }
:root[data-theme="dark"] .pq-price-card { background: linear-gradient(180deg, rgba(127, 231, 247, 0.12) 0%, var(--form-bg) 100%); }
:root[data-theme="dark"] .pq-basis { background: var(--form-bg); }
:root[data-theme="dark"] .pq-basis-note { background: rgba(127, 231, 247, 0.1); }
:root[data-theme="dark"] .pq-error { background: rgba(220, 53, 69, 0.12); color: #ff8a95; }
:root[data-theme="dark"] .pq-beta { background: var(--accent-color); color: #0F1318; }
:root[data-theme="dark"] .pq-ai-line { color: var(--accent-color); }
:root[data-theme="dark"] .pq-suggest { background: rgba(127, 231, 247, 0.06); }
:root[data-theme="dark"] .pq-suggest-btn { background: var(--form-bg); color: var(--accent-color); border-color: var(--accent-color); }
:root[data-theme="dark"] .pq-suggest-btn.is-added { background: var(--accent-color); color: #0F1318; }
:root[data-theme="dark"] .pq-analysis--done i { color: #6fdc8c; }
:root[data-theme="dark"] .pq-analysis .pq-suggest { background: var(--form-bg); }
:root[data-theme="dark"] .pq-analysis .pq-suggest i { color: var(--accent-color); }
:root[data-theme="dark"] .pq-analysis .pq-suggest-btn.is-added i { color: #0F1318; }

/* Written inventories are visible before any photos are added. */
.pq-desc textarea { min-height: 112px; resize: vertical; }
.pq-block-actions { margin-top: 14px; }
