/*
 * Quick-quote popup — ported from design/home.html (.qp-teaser, .qp).
 *
 * Everything is scoped under .qp / .qp-teaser so the popup renders correctly
 * even if the active theme is not dream-auto-garage. Tokens fall back to the
 * design's hex values when the theme's custom properties are absent.
 */

.qp-teaser,
.qp{
  --qp-panel:var(--c-panel,#0E0E10);
  --qp-white:var(--c-white,#FFFFFF);
  --qp-black:var(--c-black,#0A0A0B);
  --qp-grey-2:var(--c-grey-2,#A6A6A3);
  --qp-gold:var(--c-gold,#C9A24A);
  --qp-r:var(--r,12px);
  --qp-ease:var(--ease,cubic-bezier(.2,.7,.2,1));
  --qp-shadow:var(--shadow,0 30px 80px rgba(0,0,0,.55));
  --qp-display:var(--f-display,"Space Grotesk","Inter",system-ui,sans-serif);
  --qp-body:var(--f-body,"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif);
  --qp-mono:var(--f-mono,ui-monospace,"SF Mono",Menlo,Consolas,monospace);
  font-family:var(--qp-body);
  box-sizing:border-box;
}
.qp-teaser *,.qp *{ box-sizing:border-box; }

/* ---------- teaser ---------- */
.qp-teaser{
  position:fixed; right:16px; bottom:16px; z-index:60;
  display:flex; align-items:center; gap:12px;
  padding:10px 10px 10px 16px;
  background:rgba(14,14,16,.95); color:var(--qp-white);
  border:1px solid rgba(201,162,74,.5); border-radius:999px;
  box-shadow:var(--qp-shadow); backdrop-filter:blur(10px);
  transform:translateY(24px); opacity:0; visibility:hidden;
  transition:transform .4s var(--qp-ease), opacity .3s, visibility .3s;
}
.qp-teaser[hidden]{ display:none; }
.qp-teaser.is-visible{ transform:none; opacity:1; visibility:visible; }
.qp-teaser .qp-open{
  display:inline-flex; align-items:center; gap:10px;
  background:none; border:0; padding:0; color:inherit; cursor:pointer;
  font-family:var(--qp-display); font-size:16px; font-weight:700;
}
.qp-teaser .qp-open i{ width:8px; height:8px; border-radius:50%; background:var(--qp-gold); animation:qp-pulse 1.8s infinite; }
@keyframes qp-pulse{ 70%{ box-shadow:0 0 0 8px rgba(201,162,74,0); } 100%{ box-shadow:0 0 0 0 rgba(201,162,74,0); } }
.qp-teaser .qp-x{
  width:32px; height:32px; display:grid; place-items:center;
  background:rgba(255,255,255,.06); border:0; border-radius:50%;
  color:var(--qp-grey-2); cursor:pointer;
}
.qp-teaser .qp-x:hover{ color:var(--qp-white); }
.qp-teaser .qp-x svg{ width:13px; height:13px; display:block; }

/* ---------- dialog ---------- */
.qp{
  position:fixed; right:0; bottom:0; left:0; z-index:70;
  display:flex; flex-direction:column;
  max-height:calc(100svh - 24px);
  background:var(--qp-panel); color:var(--qp-white);
  border:1px solid rgba(255,255,255,.08); border-radius:18px 18px 0 0;
  box-shadow:var(--qp-shadow);
  transform:translateY(100%); visibility:hidden;
  transition:transform .45s var(--qp-ease), visibility .45s;
}
.qp.is-open{ transform:none; visibility:visible; }
@media (min-width:640px){
  .qp{
    left:auto; right:20px; bottom:20px; width:400px;
    max-height:calc(100svh - 40px); border-radius:18px;
    transform:translateY(24px) scale(.98); opacity:0;
    transition:transform .35s var(--qp-ease), opacity .25s, visibility .35s;
  }
  .qp.is-open{ transform:none; opacity:1; }
}

.qp-head{ display:flex; align-items:center; gap:14px; padding:16px 18px; border-bottom:1px solid rgba(255,255,255,.06); }
.qp-head b{ display:block; font-family:var(--qp-display); font-size:17px; line-height:1.1; }
.qp-head small{ display:block; font-size:12px; color:var(--qp-grey-2); }
.qp-close{ margin-left:auto; width:36px; height:36px; display:grid; place-items:center; background:rgba(255,255,255,.06); border:0; border-radius:50%; color:inherit; cursor:pointer; }
.qp-close svg{ width:13px; height:13px; display:block; }

.qp-progress{ height:3px; background:rgba(255,255,255,.08); }
.qp-progress i{ display:block; height:100%; width:33%; background:var(--qp-gold); transition:width .4s var(--qp-ease); }

.qp-body{ padding:18px; overflow:auto; }
.qp-step{ display:none; }
.qp-step.is-active{ display:block; animation:qp-fade .3s var(--qp-ease); }
@keyframes qp-fade{ from{ opacity:0; transform:translateY(6px); } }
.qp-q{ font-family:var(--qp-display); font-size:22px; font-weight:700; line-height:1.15; letter-spacing:-.02em; }
.qp-hint{ margin:6px 0 14px; font-size:13px; color:var(--qp-grey-2); }

/* choices */
.qp .choices{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.qp .choice{ position:relative; }
.qp .choice input{ position:absolute; opacity:0; inset:0; margin:0; cursor:pointer; }
.qp .choice span{
  display:flex; align-items:center; gap:10px; min-height:44px; padding:8px 10px;
  border:1.5px solid rgba(255,255,255,.1); border-radius:var(--qp-r);
  background:rgba(255,255,255,.04); color:var(--qp-white);
  font-size:13px; font-weight:500;
  transition:border-color .2s, background .2s;
}
.qp .choice span::before{
  content:""; width:18px; height:18px; flex:none;
  border:1.5px solid rgba(255,255,255,.3); border-radius:5px;
  background:transparent no-repeat center/12px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='%230A0A0B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.qp .choice input:checked + span{ border-color:var(--qp-gold); background:rgba(201,162,74,.1); }
.qp .choice input:checked + span::before{ background-color:var(--qp-gold); border-color:var(--qp-gold); }
.qp .choice input:focus-visible + span{ box-shadow:0 0 0 3px rgba(201,162,74,.35); }

/* fields */
.qp .field{ display:block; margin-top:12px; }
.qp .field > span{ display:block; margin-bottom:8px; font-family:var(--qp-mono); font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--qp-grey-2); }
.qp .field input{
  width:100%; min-height:46px; padding:12px 14px;
  border:1.5px solid rgba(255,255,255,.1); border-radius:var(--qp-r);
  background:rgba(255,255,255,.04); color:var(--qp-white); font:inherit;
}
.qp .field input:focus{ outline:none; border-color:var(--qp-gold); box-shadow:0 0 0 3px rgba(201,162,74,.2); }
.qp-hp{ position:absolute; left:-9999px; width:1px; height:1px; opacity:0; }

/* footer buttons */
.qp-foot{ display:flex; gap:10px; padding:14px 18px 18px; border-top:1px solid rgba(255,255,255,.06); }
.qp .btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:46px; padding:0 18px; border-radius:999px;
  border:1.5px solid transparent; cursor:pointer;
  font-family:var(--qp-display); font-size:15px; font-weight:700;
  transition:transform .25s var(--qp-ease), background .25s, border-color .25s;
}
.qp .btn:hover{ transform:translateY(-2px); }
.qp-foot .btn{ flex:1; }
.qp .btn-white{ background:var(--qp-white); color:var(--qp-black); border-color:var(--qp-white); padding-right:6px; }
.qp .btn-white .ico{ width:32px; height:32px; display:grid; place-items:center; border-radius:50%; background:var(--qp-black); color:var(--qp-white); transition:background .25s, transform .3s var(--qp-ease); }
.qp .btn-white .ico svg{ width:15px; height:15px; display:block; }
.qp .btn-white:hover .ico{ background:var(--qp-gold); color:var(--qp-black); transform:rotate(-45deg); }
.qp .btn-ghost{ background:rgba(255,255,255,.06); color:var(--qp-white); border-color:rgba(255,255,255,.16); }
.qp .btn-ghost:hover{ border-color:var(--qp-gold); }
.qp-back{ flex:0 0 auto !important; padding:0 16px; }

/* done state */
.qp-done{ text-align:center; padding:12px 0 8px; }
.qp-done .tick{ width:56px; height:56px; margin:0 auto 14px; display:grid; place-items:center; border-radius:50%; background:var(--qp-gold); color:var(--qp-black); }
.qp-done .tick svg{ width:26px; height:26px; display:block; }
.qp-done p{ margin-top:8px; font-size:14px; color:var(--qp-grey-2); }
.qp-done .btn{ margin-top:14px; }

.qp-error{ display:none; margin-top:10px; font-size:13px; color:#F08A7E; }
.qp-error.is-visible{ display:block; }

.qp :focus-visible{ outline:2px solid var(--qp-gold); outline-offset:3px; }

@media (prefers-reduced-motion:reduce){
  .qp-teaser,.qp,.qp .btn,.qp-progress i,.qp-step.is-active{
    transition:none !important; animation:none !important;
  }
}
