/* The estimate card (partials/estimate-card.html, rendered into each page by
 * render-estimate-card.cjs; behavior in src/public/estimateForm.ts and
 * js/photo-hero.js). Self-contained: it brings its own button styles, scoped
 * to the card, so it looks the same on a page whose own buttons differ (the
 * templates' .cta-btn). One filled button at a time - Generate until a line
 * has a price, then Send. */

/* ── Buttons, as the feature pages draw .btn - scoped to the card ── */
.est-card .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.15rem 2rem;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.est-card .btn-primary {
  background: var(--primary, #2b78e5);
  color: #f9fafb;
  box-shadow: 0 0 0 1px rgba(13, 24, 44, 0.9);
}
.est-card .btn-primary:hover { background: var(--primary-dark, #2362d2); transform: translateY(-1px); }
.est-card .btn-secondary { background: transparent; border-color: rgba(146, 165, 186, 0.6); color: #e5e7eb; }
.est-card .btn-secondary:hover { border-color: #e5e7eb; }
.est-card .btn:focus-visible { outline: 2px solid #96cffa; outline-offset: 3px; }
[data-theme-resolved="light"] .est-card .btn:focus-visible { outline-color: #2362d2; }
[data-theme-resolved="light"] .est-card .btn-primary { box-shadow: none; }
/* Light hover stated here, so it never depends on which sheet loads last. */
[data-theme-resolved="light"] .est-card .btn-secondary:hover { border-color: rgba(13, 24, 44, 0.55); color: #0d182c; }

.est-wrap { width: 100%; max-width: 30rem; }

/* ── The describe-the-job box (js/photo-hero.js) ── */
/* ── Estimate generator box (the hero CTA, js/photo-hero.js) ──
   The photo-to-estimate hero's parts, text first: the job box and
   Generate show on every device, and the photo buttons are the second
   way in. Phones: the box sits right under the headline. */
.photo-drop {
  position: relative;
  padding: 1rem;
  border: 1.5px dashed rgba(101, 180, 245, 0.45);
  border-radius: 1rem;
  background: rgba(43, 120, 229, 0.06);
  transition: border-color 0.2s, background 0.2s;
}
.photo-drop--over { border-color: #65b4f5; background: rgba(43, 120, 229, 0.14); }
.photo-drop--busy { pointer-events: none; opacity: 0.85; }
.photo-drop__form { display: flex; flex-direction: column; gap: 0.625rem; margin: 0; }
.photo-drop__label { font-size: 0.875rem; font-weight: 600; color: #cad7e2; }
.photo-drop__field { position: relative; }
.photo-drop__text {
  display: block;
  width: 100%;
  min-height: 5rem;
  box-sizing: border-box;
  padding: 0.75rem 2.75rem 0.75rem 0.875rem;
  border: 1px solid rgba(146, 165, 186, 0.45);
  border-radius: 0.75rem;
  background: rgba(13, 24, 44, 0.55);
  color: #f1f5f9;
  font: inherit;
  font-size: 1rem;
  line-height: 1.45;
  resize: vertical;
}
.photo-drop__text::placeholder { color: #92a5ba; }
.photo-drop__text:focus { outline: none; border-color: #65b4f5; box-shadow: 0 0 0 3px rgba(101, 180, 245, 0.25); }
.photo-drop__mic {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #96cffa;
  cursor: pointer;
}
.photo-drop__mic[hidden] { display: none; }
.photo-drop__mic:hover { background: rgba(101, 180, 245, 0.14); }
.photo-drop__mic:focus-visible { outline: 2px solid #65b4f5; outline-offset: 1px; }
.photo-drop__mic.is-recording { color: #ffffff; background: #c2410c; animation: photoMicPulse 1.4s ease-out infinite; }
@keyframes photoMicPulse {
  0% { box-shadow: 0 0 0 0 rgba(194, 65, 12, 0.45); }
  100% { box-shadow: 0 0 0 10px rgba(194, 65, 12, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .photo-drop__mic.is-recording { animation: none; }
}
.photo-drop__build { width: 100%; justify-content: center; }
.photo-drop__or { display: flex; align-items: center; gap: 0.625rem; margin: 0.875rem 0 0.625rem; font-size: 0.75rem; color: #92a5ba; }
.photo-drop__or::before,
.photo-drop__or::after { content: ''; flex: 1; height: 1px; background: rgba(146, 165, 186, 0.3); }
.photo-drop__row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.photo-drop__row .btn { padding: 0.75rem 1rem; font-size: 1rem; }
.photo-drop__btn { position: relative; flex: 1 1 10rem; cursor: pointer; }
.photo-drop__btn svg { vertical-align: -0.2em; margin-right: 0.35rem; }
.photo-drop__btn:focus-within { outline: 2px solid #65b4f5; outline-offset: 3px; }
/* The input stays a real, keyboard-reachable control under the label. */
.photo-drop__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
/* Mouse-and-keyboard computers: "Use your phone" (a QR code) replaces
   "Take a photo", which only opens a file picker there. */
/* Scoped to the card so they outrank its own .est-card .btn display. */
.est-card .photo-drop__btn--qr { display: none; font-family: inherit; }
@media (hover: hover) and (pointer: fine) {
  .est-card .photo-drop__btn--camera { display: none; }
  .est-card .photo-drop__btn--qr { display: inline-flex; align-items: center; justify-content: center; }
}
.hero-qr { display: flex; align-items: center; gap: 1rem; margin-top: 0.875rem; padding: 0.875rem; border: 1px solid rgba(146, 165, 186, 0.35); border-radius: 0.875rem; background: rgba(13, 24, 44, 0.85); }
.hero-qr[hidden] { display: none; }
.hero-qr__code { flex: none; display: flex; align-items: center; justify-content: center; width: 132px; height: 132px; border-radius: 0.5rem; overflow: hidden; background: #ffffff; color: #0d182c; font-size: 0.8rem; line-height: 1.35; text-align: center; }
.hero-qr__code svg { display: block; width: 100%; height: 100%; }
.hero-qr__title { margin: 0 0 0.25rem; font-weight: 700; color: #f1f5f9; }
.hero-qr__body { margin: 0 0 0.625rem; font-size: 0.875rem; line-height: 1.45; color: #b7c4d3; }
.hero-qr__status { margin: 0 0 0.625rem; padding: 0.45rem 0.6rem; border: 1px solid rgba(146, 165, 186, 0.35); border-radius: 0.5rem; font-size: 0.8125rem; line-height: 1.4; color: #b7c4d3; }
.hero-qr__status.is-live { color: #f1f5f9; border-color: rgba(41, 190, 111, 0.55); }
.hero-qr__close { min-height: 2.25rem; padding: 0.35rem 0.9rem; border: 1px solid rgba(146, 165, 186, 0.5); border-radius: 0.5rem; background: transparent; color: #f1f5f9; font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.hero-qr__close:hover { border-color: #65b4f5; }
.hero-qr__close:focus-visible { outline: 2px solid #65b4f5; outline-offset: 2px; }
[data-theme-resolved="light"] .photo-drop { border-color: rgba(43, 120, 229, 0.45); background: rgba(43, 120, 229, 0.05); }
[data-theme-resolved="light"] .photo-drop--over { background: rgba(43, 120, 229, 0.12); }
[data-theme-resolved="light"] .photo-drop__label { color: #1f2937; }
[data-theme-resolved="light"] .photo-drop__text { background: #ffffff; color: #0d182c; border-color: rgba(98, 118, 141, 0.45); }
[data-theme-resolved="light"] .photo-drop__text::placeholder { color: #62768d; }
[data-theme-resolved="light"] .photo-drop__mic { color: #2362d2; }
[data-theme-resolved="light"] .photo-drop__or { color: #4f6175; }
[data-theme-resolved="light"] .photo-drop__or::before,
[data-theme-resolved="light"] .photo-drop__or::after { background: #d5dde6; }
[data-theme-resolved="light"] .photo-drop__row .btn-secondary { border-color: rgba(98, 118, 141, 0.5); color: #0d182c; }
[data-theme-resolved="light"] .hero-qr { background: #ffffff; border-color: #d5dde6; }
[data-theme-resolved="light"] .hero-qr__code { border: 1px solid rgba(98, 118, 141, 0.25); }
[data-theme-resolved="light"] .hero-qr__title { color: #0d182c; }
[data-theme-resolved="light"] .hero-qr__body,
[data-theme-resolved="light"] .hero-qr__status { color: #4f6175; }
[data-theme-resolved="light"] .hero-qr__status.is-live { color: #0d182c; border-color: rgba(21, 128, 61, 0.5); }
[data-theme-resolved="light"] .hero-qr__close { color: #0d182c; border-color: rgba(98, 118, 141, 0.5); }

/* ── The card ── */
/* ── The estimate (js/photo-hero.js + src/public/estimateForm.ts): one
   card read top to bottom - describe the job, or type the lines; one
   total, one Send. The hero's right column on desktop, right under the
   headline on phones. One filled button at a time: Generate until a line
   has a price, then Send (estimateForm.ts swaps them). ── */
.est-card { width: 100%; max-width: 30rem; padding: 1.1rem; border: 1px solid rgba(146, 165, 186, 0.28); border-radius: 1rem; background: rgba(13, 24, 44, 0.85); color: #e1e9f1; }
.est-card__eyebrow { margin: 0 0 0.6rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #96cffa; }
/* Out of free estimates (a returning visitor): said before they build, with
   the one filled button - Subscribe - while it shows. */
.est-notice { margin: 0 0 0.9rem; padding: 0.85rem 0.9rem; border: 1px solid rgba(245, 158, 11, 0.5); border-radius: 0.75rem; background: rgba(245, 158, 11, 0.1); }
.est-notice[hidden] { display: none; }
.est-notice__title { margin: 0 0 0.25rem; font-size: 0.95rem; font-weight: 700; color: #fcd34d; }
.est-notice__body { margin: 0 0 0.7rem; font-size: 0.875rem; line-height: 1.45; color: #e1e9f1; }
.est-card .est-notice__cta { width: 100%; padding: 0.7rem 1rem; font-size: 0.98rem; text-decoration: none; }
.est-card .est-notice__alt { width: 100%; margin-top: 0.5rem; padding: 0.65rem 1rem; font-size: 0.95rem; text-decoration: none; }
.est-card .est-notice__alt[hidden] { display: none; }
[data-theme-resolved="light"] .est-notice { background: #fff7ed; border-color: rgba(217, 119, 6, 0.45); }
[data-theme-resolved="light"] .est-notice__title { color: #9a3412; }
[data-theme-resolved="light"] .est-notice__body { color: #1f2937; }

/* The AI way in: the card's top section, tinted, with the filled button. */
.est-card .est-ai { padding: 0.9rem; border: 1px solid rgba(101, 180, 245, 0.45); border-radius: 0.75rem; background: rgba(43, 120, 229, 0.08); }
.est-card .est-ai.photo-drop--over { border-color: #65b4f5; background: rgba(43, 120, 229, 0.16); }
.est-ai__tag { display: inline-block; margin-left: 0.35rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: rgba(101, 180, 245, 0.18); color: #96cffa; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; vertical-align: 0.1em; }
.est-ai .photo-drop__text { min-height: 4.5rem; }
.est-card .photo-drop__build,
.est-actions .btn { padding: 0.85rem 1rem; font-size: 1.02rem; }
.est-card .btn-secondary { box-shadow: none; }
.photo-drop__lead { display: none; }
/* Computers: the photo starts are links ("Use your phone" / "Upload a
   photo") - nearly every photo start is on a phone (Clarity 09-08..10-08:
   23 of 24), where they stay outlined buttons. */
@media (hover: hover) and (pointer: fine) {
  .est-ai .photo-drop__or { display: none; }
  .est-ai .photo-drop__row { align-items: center; gap: 0.25rem 1rem; margin-top: 0.7rem; font-size: 0.875rem; }
  .est-ai .photo-drop__lead { display: inline; color: #b7c4d3; }
  .est-card .est-ai .photo-drop__row .btn { flex: none; padding: 0.1rem 0; border: 0; border-radius: 0.25rem; background: none; color: #96cffa; font-size: 0.875rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
  .est-card .est-ai .photo-drop__row .btn:hover { color: #f1f5f9; transform: none; }
  .est-ai .photo-drop__row .btn svg { display: none; }
  [data-theme-resolved="light"] .est-card .est-ai .photo-drop__row .btn { color: #2362d2; }
  [data-theme-resolved="light"] .est-card .est-ai .photo-drop__row .btn:hover { color: #0d182c; }
}
.est-or { margin: 0.95rem 0 0.75rem; }
.est-form { margin: 0; }
.est-form__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.6rem; }
.est-field { display: flex; flex-direction: column; justify-content: space-between; gap: 0.25rem; min-width: 0; font-size: 0.78rem; font-weight: 600; color: #b7c4d3; }
.est-field em { font-style: normal; font-weight: 400; color: #8a9bb0; }
.est-field--wide { grid-column: 1 / -1; }
.est-form input { width: 100%; min-width: 0; min-height: 2.5rem; padding: 0.45rem 0.6rem; border: 1px solid rgba(146, 165, 186, 0.35); border-radius: 0.5rem; background: rgba(255, 255, 255, 0.04); color: #f1f5f9; font: inherit; font-size: 16px; }
.est-form input::placeholder { color: #7f91a6; }
.est-form input:focus { outline: none; border-color: #2b78e5; box-shadow: 0 0 0 1px #2b78e5; }
.est-form input[aria-invalid="true"] { border-color: #f59e0b; box-shadow: 0 0 0 1px #f59e0b; }
.est-lines { width: 100%; border-collapse: collapse; table-layout: fixed; }
.est-lines th { padding: 0 0.3rem 0.35rem 0; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #92a5ba; text-align: left; }
.est-lines th:nth-child(2) { width: 3.4rem; }
.est-lines th:nth-child(3) { width: 5.6rem; }
.est-lines th:nth-child(4) { width: 2rem; }
/* Top-aligned, so a price with its amount under it doesn't push the
   row's other inputs down; the remove button centers on the inputs. */
.est-lines td { padding: 0 0.3rem 0.4rem 0; vertical-align: top; }
.est-lines .est-remove { margin-top: 0.25rem; }
.est-lines td:nth-child(4) { padding-right: 0; }
.est-lines input[data-line-qty],
.est-lines input[data-line-price] { padding-left: 0.4rem; padding-right: 0.4rem; text-align: right; }
.est-remove { width: 2rem; height: 2rem; border: 0; border-radius: 0.4rem; background: none; color: #8a9bb0; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.est-remove:hover { color: #f1f5f9; background: rgba(146, 165, 186, 0.15); }
/* A line's amount, under its price, when the quantity isn't 1. */
.est-line-amt { display: block; margin-top: 0.2rem; font-size: 0.75rem; color: #b7c4d3; text-align: right; white-space: nowrap; }
.est-line-amt[hidden] { display: none; }
.est-add-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0.1rem 0 0.75rem; }
.est-add { padding: 0.4rem 0.7rem; border: 1px dashed rgba(101, 180, 245, 0.55); border-radius: 0.5rem; background: none; color: #96cffa; font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.est-add-tax { padding: 0.4rem 0.2rem; border: 0; background: none; color: #96cffa; font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.est-add-tax[hidden] { display: none; }
.est-totals { padding-top: 0.6rem; border-top: 1px solid rgba(146, 165, 186, 0.25); }
.est-sum { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.35rem; font-size: 0.9rem; color: #b7c4d3; }
.est-sum[hidden] { display: none; }
.est-sum > span:first-child,
.est-sum .est-remove--sm { margin-right: auto; }
.est-tax { display: flex; align-items: center; gap: 0.4rem; }
.est-form .est-tax input { width: 4.5rem; min-height: 2.1rem; padding: 0.3rem 0.45rem; text-align: right; }
.est-remove--sm { width: 1.75rem; height: 1.75rem; font-size: 1.05rem; }
.est-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.95rem; color: #b7c4d3; }
.est-total strong { font-size: 1.35rem; color: #8aebb7; }
/* Who it is from and for: asked as soon as a line is started. */
.est-who { margin-top: 0.9rem; animation: estWhoIn 0.25s ease-out; }
.est-who[hidden] { display: none; }
.est-who__group { min-width: 0; margin: 0 0 0.75rem; padding: 0; border: 0; }
.est-who__group:last-child { margin-bottom: 0; }
.est-who__group legend { margin-bottom: 0.4rem; padding: 0; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #92a5ba; }
@keyframes estWhoIn { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .est-who { animation: none; } }
.est-error { margin: 0.6rem 0 0; padding: 0.5rem 0.65rem; border-radius: 0.5rem; background: rgba(245, 158, 11, 0.12); color: #fcd34d; font-size: 0.85rem; line-height: 1.4; }
.est-error[hidden] { display: none; }
.est-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.5rem; margin-top: 0.9rem; }
.est-fine { width: 100%; max-width: 30rem; margin: 0.7rem 0 0; font-size: 0.8rem; line-height: 1.45; color: #8a9bb0; text-align: center; }
.est-wrap:has(.photo-drop--busy) .est-fine { color: #96cffa; font-weight: 600; }
@media (max-width: 420px) {
  .est-form__grid,
  .est-actions { grid-template-columns: minmax(0, 1fr); }
}
/* Phones: each line's description gets the full width (it was ~140px,
   too narrow to read back), with quantity, price and remove under it. */
@media (max-width: 480px) {
  .est-lines thead { display: none; }
  .est-lines,
  .est-lines tbody { display: block; }
  .est-lines tr { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 2rem; grid-template-areas: "desc desc desc" "qty price remove"; gap: 0.35rem; margin-bottom: 0.7rem; }
  .est-lines td { display: block; padding: 0; }
  .est-lines td:nth-child(1) { grid-area: desc; }
  .est-lines td:nth-child(2) { grid-area: qty; }
  .est-lines td:nth-child(3) { grid-area: price; }
  .est-lines td:nth-child(4) { grid-area: remove; }
  /* A blank label, so remove lines up with the quantity and price inputs. */
  .est-lines td:nth-child(4)::before { content: "\00a0"; display: block; margin-bottom: 0.15rem; font-size: 0.7rem; }
  .est-lines td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 0.15rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #92a5ba; }
  [data-theme-resolved="light"] .est-lines td[data-label]::before { color: #4f6175; }
}
[data-theme-resolved="light"] .est-card { background: #ffffff; border-color: rgba(13, 24, 44, 0.12); color: #1f2937; box-shadow: 0 4px 16px rgba(13, 24, 44, 0.06), 0 12px 40px rgba(13, 24, 44, 0.08); }
[data-theme-resolved="light"] .est-card__eyebrow { color: #2362d2; }
[data-theme-resolved="light"] .est-card .est-ai { background: #f2f7fe; border-color: rgba(43, 120, 229, 0.4); }
[data-theme-resolved="light"] .est-ai__tag { background: rgba(43, 120, 229, 0.12); color: #2362d2; }
[data-theme-resolved="light"] .est-ai .photo-drop__lead,
[data-theme-resolved="light"] .est-field,
[data-theme-resolved="light"] .est-total,
[data-theme-resolved="light"] .est-lines th,
[data-theme-resolved="light"] .est-who__group legend { color: #4f6175; }
[data-theme-resolved="light"] .est-form input { background: #ffffff; color: #0d182c; border-color: rgba(98, 118, 141, 0.45); }
[data-theme-resolved="light"] .est-form input::placeholder { color: #62768d; }
[data-theme-resolved="light"] .est-remove:hover { color: #0d182c; background: rgba(13, 24, 44, 0.06); }
[data-theme-resolved="light"] .est-add { color: #2362d2; border-color: rgba(35, 98, 210, 0.45); }
[data-theme-resolved="light"] .est-add-tax { color: #2362d2; }
[data-theme-resolved="light"] .est-sum,
[data-theme-resolved="light"] .est-line-amt { color: #4f6175; }
[data-theme-resolved="light"] .est-totals { border-top-color: rgba(13, 24, 44, 0.12); }
[data-theme-resolved="light"] .est-total strong { color: #15803d; }
[data-theme-resolved="light"] .est-error { background: #fff7ed; color: #9a3412; }
[data-theme-resolved="light"] .est-card .btn-secondary { border-color: rgba(98, 118, 141, 0.5); color: #0d182c; }
[data-theme-resolved="light"] .est-fine,
[data-theme-resolved="light"] .est-field em { color: #62768d; }
[data-theme-resolved="light"] .est-wrap:has(.photo-drop--busy) .est-fine { color: #2b78e5; }
