/* ============================================================
   UPSIDE — QUICK FORM (ad landing page)
   ------------------------------------------------------------
   Phone first. Sized so step 1 fits above the fold on a 390 x 660
   viewport: an iPhone inside Instagram's in-app browser, with the
   app's own bars taking the rest. Desktop simply centres the same
   column on a soft background.
   ============================================================ */

.qf-body {
  background: #f3f2ef;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

/* ---------- top bar ---------- */
.qf-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: #fff;
  border-bottom: 1px solid rgba(10,10,10,0.08);
}
.qf-top__logo { height: 30px; width: auto; }
.qf-top__call {
  display: inline-flex; align-items: center; gap: 7px;
  font: 700 0.86rem/1 var(--f-body); color: #fff; text-decoration: none;
  background: var(--ink); padding: 10px 15px; border-radius: 999px; min-height: 40px;
}
.qf-top__call svg { width: 16px; height: 16px; }

/* ---------- column ---------- */
.qf-main { flex: 1; width: 100%; display: flex; justify-content: center; }
.qf {
  width: 100%; max-width: 520px;
  background: #fff;
  padding: 14px max(18px, env(safe-area-inset-left)) 24px;
  display: flex; flex-direction: column;
}
@media (min-width: 560px) {
  .qf-main { padding: 28px 16px 40px; }
  .qf { border-radius: 24px; box-shadow: 0 18px 50px rgba(0,0,0,0.08); padding: 22px 28px 30px; min-height: 0; }
}

/* ---------- progress ---------- */
.qf-progress { display: flex; align-items: center; gap: 10px; min-height: 36px; margin-bottom: 8px; }
.qf-back {
  flex: none; width: 36px; height: 36px; margin-left: -8px; border: 0; background: none;
  border-radius: 50%; display: grid; place-items: center; color: var(--ink); cursor: pointer;
}
.qf-back svg { width: 22px; height: 22px; }
.qf-back:active { background: var(--mist); }
.qf-progress__track { flex: 1; height: 6px; background: #ecebe8; border-radius: 999px; overflow: hidden; }
.qf-progress__fill { display: block; height: 100%; width: 20%; background: var(--accent); border-radius: 999px; transition: width .35s cubic-bezier(.22,1,.36,1); }
.qf-progress__txt { flex: none; font: 600 0.72rem/1 var(--f-body); color: var(--tx-3); font-variant-numeric: tabular-nums; }
.qf.is-done .qf-progress { visibility: hidden; }

/* ---------- steps ---------- */
.qf-step { display: none; }
.qf-step.is-on { display: block; animation: qf-in .32s cubic-bezier(.22,1,.36,1); }
@keyframes qf-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .qf-step.is-on { animation: none; } .qf-progress__fill { transition: none; } }

.qf-h {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(1.45rem, 6.4vw, 1.8rem); line-height: 1.12; letter-spacing: -0.03em;
  margin: 6px 0 6px; color: var(--ink); outline: none;
}
.qf-sub { font-size: 0.92rem; line-height: 1.45; color: var(--tx-2); margin: 0 0 18px; }
.qf-sub b { color: var(--ink); font-weight: 600; }

/* ---------- agent chip ---------- */
.qf-agent {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px 9px 9px; border-radius: 16px; background: #f6f5f2; margin: 2px 0 14px;
}
.qf-agent img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none; }
.qf-agent b { display: block; font-size: 0.92rem; letter-spacing: -0.01em; }
.qf-agent span { display: block; font-size: 0.74rem; color: var(--tx-2); }
.qf-agent__badge {
  margin-left: auto; flex: none; font-size: 0.62rem !important; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ok) !important; background: var(--ok-tint); padding: 5px 8px; border-radius: 999px;
}

/* ---------- step 1 tiles ---------- */
.qf-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qf-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  min-height: 116px; padding: 14px 14px 13px; border-radius: 18px;
  border: 1.5px solid #e4e2dd; background: #fff; cursor: pointer; font: inherit; color: var(--ink);
  transition: border-color .15s ease, transform .1s ease, background .15s ease;
  touch-action: manipulation;
}
.qf-tile:active { transform: scale(0.97); }
.qf-tile__ico {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: auto;
}
.qf-tile__ico svg { width: 22px; height: 22px; }
.qf-tile b { font-size: 1.08rem; letter-spacing: -0.02em; margin-top: 12px; }
.qf-tile i { font-style: normal; font-size: 0.76rem; color: var(--tx-2); line-height: 1.3; }
.qf-tile.is-on { border-color: var(--accent); background: #fff6f6; }
.qf-tile.is-on .qf-tile__ico { background: var(--accent); color: #fff; }
@media (hover: hover) { .qf-tile:hover { border-color: var(--ink); } }

.qf-trust { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.qf-trust li { display: flex; align-items: center; gap: 5px; font-size: 0.76rem; color: var(--tx-2); }
.qf-trust svg { width: 14px; height: 14px; color: var(--ok); flex: none; }

/* ---------- option rows ---------- */
.qf-opts { display: flex; flex-direction: column; gap: 9px; }
.qf-opts--grid { display: grid; grid-template-columns: 1fr 1fr; }
.qf-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 58px; padding: 14px 16px; border-radius: 15px; text-align: left;
  border: 1.5px solid #e4e2dd; background: #fff; cursor: pointer;
  font: 600 1rem/1.25 var(--f-body); color: var(--ink); letter-spacing: -0.01em;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
  touch-action: manipulation;
}
.qf-opts--grid .qf-opt { justify-content: center; text-align: center; font-size: 0.92rem; padding: 12px 10px; }
.qf-opt svg { width: 18px; height: 18px; color: var(--tx-3); flex: none; }
.qf-opt:active { transform: scale(0.98); }
.qf-opt.is-on { border-color: var(--accent); background: #fff6f6; }
.qf-opt.is-on svg { color: var(--accent); }
@media (hover: hover) { .qf-opt:hover { border-color: var(--ink); } }

/* ---------- contact ---------- */
.qf-field { margin-bottom: 13px; }
.qf-field label { display: block; font: 600 0.82rem/1.2 var(--f-body); color: var(--ink); margin-bottom: 6px; }
.qf-opt-tag { font-weight: 500; color: var(--tx-3); font-size: 0.74rem; margin-left: 4px; }
.qf-field input {
  width: 100%; height: 54px; padding: 0 15px; border-radius: 14px;
  border: 1.5px solid #dcdad5; background: #fff;
  font: 500 16px/1 var(--f-body); color: var(--ink);   /* 16px: iOS will not zoom */
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.qf-field input::placeholder { color: #a5a29c; }
.qf-field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(10,10,10,0.07); }
.qf-field.is-bad input { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(237,28,36,0.10); }

.qf-bad { display: none; font-size: 0.78rem; color: var(--accent-deep); margin: 6px 2px 0; line-height: 1.4; }
.qf-bad.is-on { display: block; }
.qf-bad a { color: inherit; font-weight: 700; }

.qf-consent {
  display: flex; gap: 11px; align-items: flex-start; cursor: pointer;
  padding: 12px; border-radius: 14px; background: #f6f5f2; margin-top: 4px;
  border: 1.5px solid transparent;
}
.qf-consent.is-bad { border-color: var(--accent); }
.qf-consent input {
  flex: none; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer;
}
.qf-consent span { font-size: 0.68rem; line-height: 1.5; color: var(--tx-2); }

/* The button sits at the bottom of the screen on the contact step, above
   the phone's home bar, so it is always under the thumb — even with the
   keyboard closed and the consent text pushing the fields up. */
.qf-cta {
  position: sticky; bottom: 0; z-index: 5;
  margin: 14px calc(-1 * max(18px, env(safe-area-inset-left))) -24px;
  padding: 12px max(18px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0, #fff 14px);
}
@media (min-width: 560px) { .qf-cta { position: static; margin: 16px 0 0; padding: 0; background: none; } }

.qf-submit {
  width: 100%; min-height: 58px; border: 0; border-radius: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--accent); color: #fff; text-decoration: none;
  font: 700 1.06rem/1 var(--f-body); letter-spacing: -0.01em;
  box-shadow: 0 10px 24px rgba(237,28,36,0.28);
  transition: transform .1s ease, background .15s ease;
  touch-action: manipulation;
}
.qf-submit svg { width: 20px; height: 20px; }
.qf-submit:active { transform: scale(0.98); }
.qf-submit:disabled { opacity: 0.75; }
.qf-submit.is-busy svg { animation: qf-nudge .8s ease-in-out infinite; }
@keyframes qf-nudge { 50% { transform: translateX(4px); } }
.qf-submit--dark { background: var(--ink); box-shadow: 0 10px 24px rgba(0,0,0,0.18); margin-top: 6px; }
.qf-bad--send { text-align: center; }
.qf-fine { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.72rem; color: var(--tx-3); margin: 10px 0 0; }
.qf-fine svg { width: 13px; height: 13px; }
.qf-fine a { color: var(--tx-2); }

/* ---------- done ---------- */
.qf-done { text-align: center; padding-top: 10px; }
.qf-done__tick {
  width: 72px; height: 72px; border-radius: 50%; margin: 6px auto 10px;
  display: grid; place-items: center; background: var(--ok); color: #fff;
  box-shadow: 0 0 0 10px var(--ok-tint);
  animation: qf-pop .45s cubic-bezier(.34,1.56,.64,1);
}
.qf-done__tick svg { width: 36px; height: 36px; }
@keyframes qf-pop { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
.qf-done .qf-sub b { white-space: nowrap; }
.qf-agent--done { text-align: left; margin: 0 0 14px; }
.qf-ghost {
  display: flex; align-items: center; justify-content: center; min-height: 54px; margin-top: 10px;
  border-radius: 16px; border: 1.5px solid #dcdad5; color: var(--ink); text-decoration: none; font-weight: 700;
}
.qf-link { display: inline-block; margin-top: 18px; font-size: 0.86rem; color: var(--tx-2); }

/* ---------- footer ---------- */
.qf-foot {
  text-align: center; padding: 18px 20px max(20px, env(safe-area-inset-bottom));
  font-size: 0.66rem; line-height: 1.5; color: var(--tx-3);
}
.qf-foot img { width: 24px; height: 24px; opacity: 0.6; display: block; margin: 0 auto 6px; }
.qf-foot p { margin: 0; }
.qf-foot a { color: var(--tx-2); }
/* On the contact step the footer would sit under the sticky button. */
.qf-body.qf-on-contact .qf-foot { padding-bottom: 28px; }

/* Very short screens (landscape, or a phone with a big in-app header). */
@media (max-height: 600px) and (max-width: 559px) {
  .qf-agent { display: none; }
  .qf-tile { min-height: 96px; }
}
.qf-back[hidden] { display: grid !important; visibility: hidden; }
.qf-tile { min-height: 104px; }
.qf-agent > div { min-width: 0; }
.qf-vhelp { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: #fff8ea; border: 1px solid rgba(176,122,18,0.3); text-align: left; }
.qf-vhelp p { margin: 0 0 8px; font-size: 0.84rem; line-height: 1.45; color: #5c4100; }
.qf-ghost--sm { min-height: 44px; margin-top: 0; width: 100%; background: #fff; font: inherit; font-weight: 700; cursor: pointer; }

/* ---------- iPhone "save contact" guide ---------- */
.qf-guide { position: fixed; inset: 0; z-index: 60; background: rgba(10,10,10,0.5); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s ease; }
.qf-guide.is-on { opacity: 1; }
.qf-guide__card {
  position: relative; width: 100%; max-width: 520px; background: #fff;
  border-radius: 24px 24px 0 0; padding: 22px 20px max(22px, env(safe-area-inset-bottom));
  transform: translateY(24px); transition: transform .25s cubic-bezier(.22,1,.36,1);
}
.qf-guide.is-on .qf-guide__card { transform: none; }
@media (min-width: 560px) { .qf-guide { align-items: center; } .qf-guide__card { border-radius: 24px; } }
.qf-guide__x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; background: none; font-size: 1.6rem; color: var(--tx-3); cursor: pointer; }
.qf-guide__who { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.qf-guide__who img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.qf-guide__who b { display: block; font-size: 1rem; }
.qf-guide__who span { font-size: 0.82rem; color: var(--tx-2); }
.qf-guide__h { font-family: var(--f-display); font-size: 1.4rem; letter-spacing: -0.02em; margin: 0 0 12px; }
.qf-guide__steps { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.qf-guide__steps li { display: flex; gap: 12px; font-size: 0.95rem; line-height: 1.45; }
.qf-guide__steps li > span { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 0.85rem; display: grid; place-items: center; }
.qf-guide__steps small { display: block; margin-top: 3px; font-size: 0.8rem; color: var(--accent-deep); }
.qf-guide__after { margin-top: 14px; text-align: center; }
.qf-guide__after p { font-size: 0.85rem; color: var(--tx-2); margin: 0 0 8px; }
.qf-guide__done { border: 0; background: none; cursor: pointer; font: inherit; margin-top: 10px; }
.qf-guide[hidden], .qf-guide__after[hidden] { display: none; }
.qf-guide__note { font-size: 0.82rem; line-height: 1.45; color: #5c4100; background: #fff8ea; border: 1px solid rgba(176,122,18,0.3); border-radius: 12px; padding: 9px 12px; margin: -4px 0 14px; }
