/* The quote panel (quote.js), loaded after phone.css. Desktop: it slides in from the left over the text column, so the
   house stays in view on the right, and the house switch stays usable above the dim. Phones (≤860px): a sheet rises
   over the picture. */

:root { --danger: #ef8a73; }

.quote { position: fixed; inset: 0; z-index: 40; visibility: hidden; transition: visibility 0s linear 0.45s; }
.quote-open .quote { visibility: visible; transition: none; }
.quote-open { overflow: hidden; } /* nothing scrolls behind it */

.quote-scrim {
  position: absolute;
  inset: 0;
  background: rgba(var(--veil), 0.22);
  opacity: 0;
  transition: opacity 0.45s ease;
}
.quote-open .quote-scrim { opacity: 1; }

.quote-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: clamp(440px, 42vw, 600px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px var(--m) 44px;
  background: var(--ground);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.06), 40px 0 80px rgba(0, 0, 0, 0.4); /* taste-skill-ignore: panel edge over the photo */
  transform: translateX(-102%);
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ink) 25%, transparent) transparent;
}
.quote-open .quote-panel { transform: none; transition-duration: 0.6s; }
.quote-panel.dragging { transition: none; }

.quote-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.quote-close {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s var(--ease-out);
}
.quote-close svg { width: 12px; height: 12px; }
.quote-close:hover { border-color: var(--accent); }
.quote-close:active { transform: scale(0.94); }
.quote-grip { display: none; }

.quote-body { margin-top: 64px; }
.quote-kicker { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.quote-title {
  margin-top: 12px;
  font-size: clamp(30px, 2.6vw, 40px);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
  outline: none;
}
.quote-intro { margin-top: 12px; font-size: 18px; line-height: 1.5; color: color-mix(in srgb, var(--ink) 75%, transparent); }

/* ---------------------------------------------------------------- fields */

.q-group { margin-top: 24px; }
.q-label, .q-field > label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--muted);
}
.q-star { color: var(--accent); font-weight: 600; }
.q-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 24px 16px; align-items: start; }

.quote input:not([type="hidden"]),
.quote textarea {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 3.5%, transparent);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px; /* 16px keeps phones from zooming in on focus */
  caret-color: var(--accent);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.quote textarea { height: 132px; min-height: 96px; padding: 13px 16px; line-height: 24px; resize: vertical; }
.quote ::placeholder { color: color-mix(in srgb, var(--ink) 55%, transparent); }
.quote input:focus, .quote textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.quote ::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }

/* email: the gold asterisk and an envelope in the box */
.q-email-box { position: relative; }
.q-email-box svg {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  color: var(--accent);
  pointer-events: none;
}
.quote .q-email-box input { padding-left: 44px; }

.q-msg { display: none; align-items: flex-start; gap: 7px; margin-top: 8px; font-size: 13px; line-height: 18px; color: var(--danger); }
.q-msg svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.q-field.bad .q-msg { display: flex; }
.quote .q-field.bad input {
  border-color: var(--danger);
  background-color: color-mix(in srgb, var(--danger) 6%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent);
}

/* ---------------------------------------------------------------- the house card, and Change's list */

.q-house { container-type: inline-size; }
/* a narrow card (phones, small desktop windows): size and price on lines of their own, rather than the line breaking
   wherever it runs out */
@container (max-width: 440px) {
  .q-txt small .nw { display: block; }
  .q-dot { display: none; }
}
.q-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 7px 18px 7px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  transition: background-color 0.5s ease, border-color 0.5s ease;
}
.q-card.flash { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: var(--accent); transition: none; }
.q-thumb { flex: none; width: 112px; height: 70px; border-radius: 6px; background: var(--frame-bg) center / cover; }
.q-unsure {
  display: grid;
  place-items: center;
  background: none;
  border: 1px dashed color-mix(in srgb, var(--ink) 28%, transparent);
  font-size: 22px;
  color: var(--muted);
}
.q-txt { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.q-txt b { font-size: 18px; font-weight: 600; }
.q-txt small { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.q-change {
  flex: none;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 14px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
}
.q-change:hover { color: var(--ink); }

.q-pickwrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.38s cubic-bezier(0.32, 0.72, 0, 1); }
.q-house.open .q-pickwrap { grid-template-rows: 1fr; }
.q-pickwrap > div { overflow: hidden; min-height: 0; }
.q-pick { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.q-house:not(.open) .q-pick { visibility: hidden; transition: visibility 0s linear 0.38s; }
.q-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 6px 16px 6px 6px;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 2.5%, transparent);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, transform 0.12s var(--ease-out);
}
.q-option:hover, .q-option:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  outline: none;
}
.q-option:active { transform: scale(0.99); }
.q-option .q-thumb { width: 84px; height: 52px; }
.q-option .q-txt b { font-size: 16px; }
.q-option .q-txt small { font-size: 13px; }
.q-option > svg { flex: none; width: 7px; height: 14px; color: var(--accent); opacity: 0.7; }

/* ---------------------------------------------------------------- send, and the thank-you */

.q-send { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; margin-top: 28px; }
.q-send .btn { border: 0; cursor: pointer; }
.q-send .btn:disabled { opacity: 0.7; cursor: progress; }
.q-alt { font-size: 14px; color: var(--muted); }
.q-alt a { color: var(--ink); font-weight: 600; text-decoration: none; transition: color 0.15s; }
.q-alt a:hover { color: var(--accent); }
.q-legend { margin-top: 14px; font-size: 13px; color: var(--muted); }

.quote-done .quote-title { font-size: clamp(26px, 2.2vw, 32px); }
.quote-done .quote-intro b { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.quote-done .textbtn { margin-top: 24px; color: var(--accent); }
.quote [hidden] { display: none; }

/* ---------------------------------------------------------------- the hero while it's open */

/* the tour and the part dots step aside; the house switch rises above the dim, so the house can still be changed */
.quote-open :is(.tour-btn, .tour-sep, .markers) { opacity: 0; pointer-events: none; }
@media (min-width: 861px) {
  .quote-open .house-switch { z-index: 41; }
}

/* ---------------------------------------------------------------- phones: a sheet */

@media (max-width: 860px) {
  .quote-scrim { background: rgba(var(--veil), 0.55); }
  .quote-panel {
    top: calc(64px + env(safe-area-inset-top));
    right: 0;
    width: auto;
    padding: 30px var(--m) calc(28px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.09), 0 -12px 32px rgba(0, 0, 0, 0.45); /* taste-skill-ignore: sheet edge over the photo */
    transform: translateY(100%);
  }
  /* the handle: drag it down to close (quote.js) */
  .quote-grip { display: block; position: absolute; top: 0; left: 0; right: 0; height: 30px; touch-action: none; cursor: grab; }
  .quote-grip::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 50%;
    width: 38px;
    height: 4px;
    margin-left: -19px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--ink) 30%, transparent);
  }
  .quote-top { position: absolute; top: 14px; right: 12px; }
  .quote-top .wordmark { display: none; }
  .quote-close { width: 44px; height: 44px; }
  .quote-body { margin-top: 0; }
  .quote-title { margin-top: 8px; font-size: 26px; letter-spacing: -0.02em; padding-right: 48px; }
  .quote-form .quote-intro { display: none; }

  .q-group { margin-top: 18px; }
  .q-label, .q-field > label { font-size: 13px; margin-bottom: 6px; }
  .q-two { grid-template-columns: 1fr; gap: 18px; }
  .quote input:not([type="hidden"]) { height: 48px; }
  .quote textarea { height: 100px; padding-top: 12px; line-height: 22px; resize: none; }

  .q-card { gap: 12px; padding: 6px 14px 6px 6px; }
  .q-card .q-thumb { width: 84px; height: 54px; }
  .q-txt b { font-size: 16px; }
  .q-txt small { font-size: 12.5px; line-height: 17px; }
  .q-change { font-size: 13px; }
  .q-option { gap: 12px; min-height: 64px; padding: 5px 12px 5px 5px; }
  .q-option .q-thumb { width: 64px; height: 42px; }
  .q-option .q-txt b { font-size: 15px; }
  .q-option .q-txt small { font-size: 12px; line-height: 16px; }

  .q-send { flex-direction: column; align-items: stretch; gap: 12px; margin-top: 20px; }
  .q-send .btn { text-align: center; padding: 15px; }
  .q-alt, .q-legend { text-align: center; font-size: 13px; }
}
