/* N-Hance Ottawa-Nepean: estimate request form (/estimate/)
   Loaded after styles.css, so it reuses the brand variables defined there. */

/* The home page reserves space for its sticky call bar; this page has none. */
body.est-body { padding-bottom: 0; }

.est-wrap [hidden], .est-card [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.est-section { padding: clamp(28px, 6vw, 64px) 0 clamp(40px, 7vw, 80px); }
.est-wrap { max-width: 720px; }
.est-head { text-align: center; margin-bottom: 22px; }
.est-head h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); margin-bottom: 8px; }
.est-head p { color: var(--muted); margin: 0 auto; max-width: 480px; }

.est-card { padding: clamp(18px, 4.5vw, 34px); box-shadow: 0 10px 34px rgba(0, 0, 0, .07); scroll-margin-top: 80px; }
.est-card p { color: inherit; }

/* Progress */
.est-progress ol { display: flex; list-style: none; margin: 0 0 26px; padding: 0; }
.est-progress li { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--muted); text-align: center; }
.est-progress li::before { content: ""; position: absolute; top: 16px; left: calc(-50% + 22px); right: calc(50% + 22px); height: 3px; border-radius: 2px; background: var(--line); }
.est-progress li:first-child::before { display: none; }
.est-progress li.is-done::before, .est-progress li.is-current::before { background: var(--orange); }
.est-progress .n { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--white); border: 2px solid #cfcfd3; color: var(--muted); font-weight: 700; }
.est-progress li.is-current .n { background: var(--orange-dark); border-color: var(--orange-dark); color: var(--white); }
.est-progress li.is-current { color: var(--charcoal); }
.est-progress li.is-done .n { background: var(--white); border-color: var(--orange-dark); color: var(--orange-dark); font-size: 0; }
.est-progress li.is-done .n::after { content: "\2713"; font-size: 1.05rem; }
.est-progress li.is-done { color: var(--charcoal); }

/* Step headings */
.est-step-title { font-size: clamp(1.3rem, 3.6vw, 1.6rem); margin-bottom: .35em; }
.est-step-title:focus { outline: none; }
.est-step-sub { color: var(--muted); margin: 0 0 22px; }

/* Service tiles */
.est-group { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.est-group legend { padding: 0; margin-bottom: 10px; font-weight: 600; color: var(--muted); }
.est-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .est-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.est-tile { position: relative; display: block; cursor: pointer; }
.est-tile input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.est-tile-box { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 10px; border: 2px solid var(--line); border-radius: 12px; background: var(--white); font-weight: 700; line-height: 1.2; transition: border-color .15s, background .15s; }
.est-tile:hover .est-tile-box { border-color: #cfcfd3; }
.est-tile-check { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #b8b8bc; background: var(--white); display: flex; align-items: center; justify-content: center; }
.est-tile-text { min-width: 0; overflow-wrap: break-word; }
.est-tile-text small { display: block; margin-top: 2px; font-weight: 500; font-size: .8rem; color: var(--muted); }
@media (max-width: 389px) {
  .est-tile-box { padding: 8px; gap: 6px; font-size: .92rem; }
  .est-tile-check { flex-basis: 20px; width: 20px; height: 20px; }
}
@media (max-width: 354px) { .est-tiles { grid-template-columns: minmax(0, 1fr); } .est-tile-box { min-height: 52px; } }
.est-tile input:checked + .est-tile-box { border-color: var(--orange-dark); background: #fff4ee; }
.est-tile input:checked + .est-tile-box .est-tile-check { background: var(--orange-dark); border-color: var(--orange-dark); }
.est-tile input:checked + .est-tile-box .est-tile-check::after { content: ""; width: 6px; height: 11px; margin-top: -2px; border: solid var(--white); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.est-tile input:focus-visible + .est-tile-box { outline: 3px solid var(--charcoal); outline-offset: 2px; }

/* Follow-up blocks */
.est-follow { border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 10px; margin: 0 0 14px; padding: 4px 16px 6px; background: var(--bg-soft); min-width: 0; }
.est-follow legend { font-weight: 700; padding: 0 6px; margin-left: -6px; font-size: .95rem; }
.est-follow .est-field { margin-top: 12px; margin-bottom: 8px; }

/* Fields */
.est-field { margin: 0 0 18px; }
.est-field label { display: block; margin-bottom: 6px; font-weight: 600; }
.est-field .req { color: #b3261e; margin-left: 2px; }
.est-field .opt { font-weight: 400; color: var(--muted); font-size: .9em; }
.est-field input[type=text], .est-field input[type=tel], .est-field input[type=email], .est-field select, .est-field textarea {
  display: block; width: 100%; padding: 12px 14px; font: inherit; font-size: 1rem; color: var(--charcoal);
  background: var(--white); border: 1.5px solid #b9b9be; border-radius: 10px; -webkit-appearance: none; appearance: none;
}
.est-field select { padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%233d3d3f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.est-field textarea { resize: vertical; min-height: 110px; }
.est-field input:focus, .est-field select:focus, .est-field textarea:focus { outline: 3px solid rgba(253, 90, 3, .35); outline-offset: 0; border-color: var(--orange-dark); }
.est-field input::placeholder, .est-field textarea::placeholder { color: #8a8a8e; }
.est-field.has-error input, .est-field.has-error select, .est-field.has-error textarea { border-color: #b3261e; background: #fff8f7; }
.est-postal { text-transform: uppercase; }
.est-row { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 640px) { .est-row { grid-template-columns: 1fr 1fr; } }
.est-hint { margin: 6px 0 0; font-size: .875rem; color: var(--muted); }
.est-error { margin: 6px 0 0; font-size: .9rem; font-weight: 600; color: #b3261e; }
.est-error::before { content: "! "; content: "! " / ""; font-weight: 800; }
.est-group .est-error { margin-top: 10px; }
.est-privacy { margin: 4px 0 0; }

/* Honeypot: off-screen so people never see it (bots usually fill it in) */
.est-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Photos */
.est-photos { margin-bottom: 8px; }
.est-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.est-photo-btn { display: inline-flex; width: 100%; min-height: 56px; border-style: dashed; font-size: 1.05rem; cursor: pointer; }
@media (min-width: 640px) { .est-photo-btn { width: auto; padding-inline: 32px; } }
.est-file:focus-visible + .est-photo-btn { outline: 3px solid var(--charcoal); outline-offset: 3px; }
.est-thumbs { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 640px) { .est-thumbs { grid-template-columns: repeat(6, 1fr); } }
.est-thumbs:empty { display: none; }
.est-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg-soft); border: 1px solid var(--line); }
.est-thumb img { width: 100%; height: 100%; object-fit: cover; }
.est-thumb.is-loading { display: flex; align-items: center; justify-content: center; }
.est-thumb.is-loading::after { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--orange-dark); animation: est-spin .8s linear infinite; }
.est-thumb-x { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .7); color: var(--white); font-size: 1.25rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.est-thumb-x:hover { background: #000; }
.est-thumb-x:focus-visible { outline: 3px solid var(--white); outline-offset: 0; box-shadow: 0 0 0 5px var(--charcoal); }

/* Alerts */
.est-alert { margin: 4px 0 18px; padding: 12px 14px; border-radius: 10px; font-weight: 600; line-height: 1.45; }
.est-alert--error { background: #fdecea; border: 1px solid #f3b9b3; color: #8c1d18; }
.est-alert a { color: inherit; white-space: nowrap; }

/* Navigation */
.est-nav { display: flex; flex-direction: column-reverse; gap: 12px; margin-top: 22px; }
.est-nav .btn { width: 100%; min-height: 52px; font-size: 1.05rem; cursor: pointer; font-family: inherit; }
@media (min-width: 640px) {
  .est-nav { flex-direction: row; justify-content: space-between; }
  .est-nav .btn { width: auto; min-width: 150px; }
  .est-nav .est-next { margin-left: auto; }
}
.est-nav .btn:focus-visible { outline: 3px solid var(--charcoal); outline-offset: 2px; }
.est-nav .btn[disabled] { opacity: .65; cursor: progress; transform: none; }
.est-nav .est-next.is-sending::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .45); border-top-color: var(--white); animation: est-spin .8s linear infinite; }
.est-call { margin: 18px 0 0; text-align: center; color: var(--muted); }
.est-call a { font-weight: 700; white-space: nowrap; }

/* Thank-you */
.est-thanks { text-align: center; padding: 10px 0 4px; }
.est-thanks-icon { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; background: var(--orange-dark); color: var(--white); display: flex; align-items: center; justify-content: center; }
.est-thanks h2 { font-size: clamp(1.5rem, 4.5vw, 1.9rem); }
.est-thanks h2:focus { outline: none; }
.est-thanks .btn-row { margin-top: 20px; }

@keyframes est-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .est-tile-box { transition: none; }
  .est-thumb.is-loading::after, .est-nav .est-next.is-sending::before { animation-duration: 2.5s; }
}
