/* === Funil de Inovação - Produtiva Jr === */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  min-height: 100%;
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  color: #1f3a44;
  -webkit-text-size-adjust: 100%;
  background: #4a8fb8; /* fallback so no white flash if sky paints late */
}

/* On wider screens we still want the locked-viewport feel */
@media (min-width: 821px) {
  html, body { height: 100%; overflow: hidden; }
}

#root {
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

@media (min-width: 821px) {
  #root { height: 100vh; overflow: hidden; }
}

/* === SKY BACKGROUND === */
.sky {
  position: absolute;
  inset: 0;
  background:
    /* atmospheric haze near horizon */
    radial-gradient(ellipse 120% 55% at 50% 100%, rgba(255, 220, 190, 0.35) 0%, rgba(255, 220, 190, 0) 60%),
    /* main sky gradient — deeper blue up high, warmer near horizon */
    linear-gradient(180deg,
      #4a8fb8 0%,
      #6aa8c8 18%,
      #8cc0d6 42%,
      #b3d6e2 68%,
      #d8e8ec 88%,
      #f0e3d4 100%);
  overflow: hidden;
  z-index: 0;
}

/* sun glow — soft, warm, diffuse */
.sun {
  position: absolute;
  top: 6%;
  right: 10%;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 248, 220, 0.95) 0%, rgba(255, 240, 200, 0.5) 18%, rgba(255, 230, 180, 0.18) 38%, rgba(255, 220, 170, 0.0) 65%);
  pointer-events: none;
  filter: blur(2px);
}

/* subtle light rays / volumetric streaks */
.sky::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 88% 18%, rgba(255, 245, 215, 0.18) 0%, rgba(255, 245, 215, 0) 55%),
    radial-gradient(ellipse 80% 50% at 20% 12%, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0) 60%);
  pointer-events: none;
}

/* atmospheric haze layer at horizon */
.horizon {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28%;
  background: linear-gradient(180deg,
    rgba(245, 230, 210, 0) 0%,
    rgba(245, 230, 210, 0.18) 50%,
    rgba(255, 235, 215, 0.4) 100%);
  pointer-events: none;
}

/* === CLOUDS LAYER === */
.cloud-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.bg-cloud {
  position: absolute;
  will-change: transform;
  animation: drift linear infinite;
  filter: drop-shadow(0 6px 18px rgba(31, 58, 68, 0.06));
}

@keyframes drift {
  from { transform: translateX(110vw); }
  to   { transform: translateX(-40vw); }
}

/* === STAGE (camera container) === */
.stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: 75% 50%; /* zoom toward the plane (right side) */
  will-change: transform, filter;
}

/* Continuous, smooth single-curve zoom — gentler scale, no stepped keyframes,
   tracks the plane as it flies right. One easing pass, no hold. */
.stage.flying-out {
  animation: stageZoomTrack 1.3s cubic-bezier(.33, 0, .67, 1) forwards;
}

@keyframes stageZoomTrack {
  0%   { transform: scale(1)    translateX(0)    translateY(0);   filter: blur(0); opacity: 1; }
  100% { transform: scale(1.55) translateX(-10%) translateY(-3%); filter: blur(1.5px); opacity: 0.85; }
}

/* New question dollies in smoothly — single curve, no stepped phases. */
.stage.flying-in {
  animation: stageZoomDolly 0.95s cubic-bezier(.33, 0, .25, 1) both;
}

@keyframes stageZoomDolly {
  0%   { transform: scale(0.78) translateX(6%) translateY(2%); filter: blur(2.5px); opacity: 0.5; }
  100% { transform: scale(1)    translateX(0)  translateY(0);  filter: blur(0);     opacity: 1; }
}

/* === SCENE - the question + character side-by-side === */
.scene {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 64px);
  width: min(1200px, 92vw);
  position: relative;
}

.scene-card-side {
  flex: 1 1 560px;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
}

.scene-plane-side {
  flex: 0 0 auto;
  position: relative;
  width: clamp(280px, 32vw, 460px);
  height: clamp(320px, 42vw, 520px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === QUESTION CARD === */
.q-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 28px;
  padding: 38px 40px 32px;
  width: min(560px, 100%);
  box-shadow:
    0 30px 80px -20px rgba(31, 58, 68, 0.25),
    0 8px 24px -8px rgba(31, 58, 68, 0.12),
    inset 0 1px 0 rgba(255,255,255,0.8);
  border: 1px solid rgba(255, 255, 255, 0.7);
  position: relative;
  animation: cardPop 0.55s cubic-bezier(.34, 1.56, .64, 1) both;
}

@keyframes cardPop {
  0%   { opacity: 0; transform: translateY(28px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.q-step {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7BC4D4;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.q-step .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #7BC4D4;
}

.q-title {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 800;
  line-height: 1.2;
  color: #1f3a44;
  margin-bottom: 22px;
  text-wrap: pretty;
}

.q-input,
.q-textarea {
  width: 100%;
  padding: 16px 18px;
  font-family: inherit;
  font-size: 17px;
  color: #1f3a44;
  background: #f4f9fb;
  border: 2px solid #e0eef2;
  border-radius: 16px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  resize: none;
}

.q-textarea {
  min-height: 120px;
  font-family: inherit;
  line-height: 1.5;
}

.q-input:focus,
.q-textarea:focus {
  border-color: #7BC4D4;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(123, 196, 212, 0.18);
}

.q-input::placeholder,
.q-textarea::placeholder {
  color: #9fb6bd;
}

/* === CHOICE BUTTONS === */
.choices {
  display: grid;
  gap: 12px;
}

.choices.two { grid-template-columns: 1fr 1fr; }

.choice {
  background: #f4f9fb;
  border: 2px solid #e0eef2;
  border-radius: 16px;
  padding: 18px 20px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  color: #1f3a44;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  gap: 14px;
}

.choice:hover {
  border-color: #7BC4D4;
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(123, 196, 212, 0.4);
}

.choice.selected {
  border-color: #7BC4D4;
  background: linear-gradient(135deg, #eaf6f9, #fff);
  box-shadow: 0 8px 20px -8px rgba(123, 196, 212, 0.5);
}

.choice-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(123, 196, 212, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #4ea0b3;
}

/* === SMOKE VEIL — fullscreen smoke wash during transitions === */
.smoke-veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}
.smoke-veil .puff {
  position: absolute;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.5) 45%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0;
  animation: veilSweep 1.2s cubic-bezier(.4, 0, .6, 1) forwards;
  will-change: transform, opacity;
}
@keyframes veilSweep {
  0%   { transform: translate(0, 0) scale(0.6); opacity: 0; }
  25%  { opacity: 1; }
  60%  { opacity: 1; }
  100% { transform: translate(-130vw, var(--ty, 0)) scale(1.3); opacity: 0; }
}

/* === ESCOPO COMPACT GRID (fits 20+ items inside the card) === */
.escopo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  max-height: min(46vh, 380px);
  overflow-y: auto;
  padding: 4px 6px 4px 0;
  scrollbar-width: thin;
  scrollbar-color: #b6dee9 transparent;
}
.escopo-grid::-webkit-scrollbar { width: 8px; }
.escopo-grid::-webkit-scrollbar-thumb { background: #b6dee9; border-radius: 999px; }

.escopo-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f4f9fb;
  border: 1.5px solid #e0eef2;
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #1f3a44;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
  min-height: 44px;
}
.escopo-chip:hover {
  border-color: #7BC4D4;
  background: #fff;
  transform: translateY(-1px);
}
.escopo-chip.selected {
  border-color: #7BC4D4;
  background: linear-gradient(135deg, #eaf6f9, #fff);
  box-shadow: 0 6px 14px -6px rgba(123, 196, 212, 0.5);
  color: #4ea0b3;
}
.escopo-chip span { flex: 1; }

/* === MULTI-SELECT (núcleos) === */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  background: #f4f9fb;
  border: 2px solid #e0eef2;
  border-radius: 999px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #1f3a44;
  cursor: pointer;
  transition: all 0.16s ease;
}

.chip:hover {
  border-color: #7BC4D4;
  transform: translateY(-1px);
}

.chip.selected {
  background: #7BC4D4;
  border-color: #7BC4D4;
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(123, 196, 212, 0.7);
}

/* === FOOTER (nav) === */
.q-footer {
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.btn-back {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #7a98a0;
  cursor: pointer;
  padding: 10px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}
.btn-back:hover { color: #1f3a44; }
.btn-back:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-next {
  background: linear-gradient(135deg, #7BC4D4 0%, #5fb0c2 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px 28px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 24px -8px rgba(123, 196, 212, 0.6);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
}

.btn-next:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -10px rgba(123, 196, 212, 0.7);
}

.btn-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* === PROGRESS BAR === */
.progress-shell {
  position: absolute;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 30px -10px rgba(31, 58, 68, 0.2);
  border: 1px solid rgba(255,255,255,0.8);
}

.progress-bar {
  width: 220px;
  height: 6px;
  border-radius: 999px;
  background: #e0eef2;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7BC4D4, #5fb0c2);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(.7, .05, .25, 1);
}

.progress-label {
  font-size: 12px;
  font-weight: 800;
  color: #4ea0b3;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* === LOGO === */
.brand {
  position: absolute;
  top: 22px;
  left: 28px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 4px 10px rgba(31, 58, 68, 0.15));
}

.brand-text {
  font-size: 13px;
  font-weight: 800;
  color: #1f3a44;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.brand-text small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #7BC4D4;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* === PLANE CHARACTER === */
.plane-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

/* The plane bobs gently while idle, and we apply class to fly off.
   The PNG is drawn facing LEFT — idle keeps that orientation. */
.plane {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(200px, 26vw, 320px);
  height: auto;
  transform: translate(-50%, -50%);
  animation: bob 3.6s ease-in-out infinite;
  will-change: transform;
  z-index: 3;
  filter: drop-shadow(0 14px 22px rgba(31, 58, 68, 0.22));
  user-select: none;
  pointer-events: none;
}

@keyframes bob {
  0%, 100% { transform: translate(-50%, -50%) rotate(-4deg); }
  50%      { transform: translate(-50%, calc(-50% - 14px)) rotate(2deg); }
}

/* fly-out: plane spins/rotates to face RIGHT (head forward), nose pitched up,
   then accelerates off-screen to the right. Uses scaleX(-1) to mirror, with
   rotation tuned so after the flip the nose points UP-right (forward). */
.plane.fly-away {
  animation: flyAway 1.3s cubic-bezier(.33, 0, .67, 1) forwards;
}

@keyframes flyAway {
  0%   { transform: translate(-50%, -50%) rotate(-4deg) scaleX(1);  opacity: 1; }
  18%  { transform: translate(-50%, calc(-50% - 10px)) rotate(0deg) scaleX(-1); opacity: 1; }
  40%  { transform: translate(20%, calc(-50% - 30px)) rotate(15deg) scaleX(-1); opacity: 1; }
  100% { transform: translate(520%, calc(-50% - 160px)) rotate(20deg) scaleX(-1); opacity: 0; }
}

/* fly-in: comes in from the LEFT, already facing left (its natural orientation) */
.plane.fly-in {
  animation: flyIn 0.9s cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes flyIn {
  0%   { transform: translate(-340%, calc(-50% + 50px)) rotate(-14deg); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(-4deg); opacity: 1; }
}

/* === SPEECH BUBBLE === */
.bubble {
  position: absolute;
  bottom: calc(50% + 90px);
  left: 50%;
  transform: translateX(-58%);
  background: #fff;
  border-radius: 22px;
  padding: 16px 20px;
  max-width: 280px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: #1f3a44;
  box-shadow:
    0 18px 40px -12px rgba(31, 58, 68, 0.22),
    0 6px 14px -6px rgba(31, 58, 68, 0.12);
  border: 2px solid rgba(123, 196, 212, 0.25);
  text-wrap: pretty;
  animation: bubbleIn 0.55s cubic-bezier(.34, 1.56, .64, 1) 0.35s both;
  z-index: 4;
}

.bubble::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 38%;
  width: 24px;
  height: 24px;
  background: #fff;
  border-right: 2px solid rgba(123, 196, 212, 0.25);
  border-bottom: 2px solid rgba(123, 196, 212, 0.25);
  transform: rotate(45deg);
  border-radius: 0 0 8px 0;
}

@keyframes bubbleIn {
  0%   { opacity: 0; transform: translateX(-58%) translateY(8px) scale(0.9); }
  100% { opacity: 1; transform: translateX(-58%) translateY(0) scale(1); }
}

/* === SMOKE TRAIL ===
   IDLE: plane faces LEFT, smoke trails to the RIGHT.
   FLYING AWAY: plane has flipped to face RIGHT, smoke trails to the LEFT.
   z-index 2 puts smoke BEHIND the plane (z-index 3). */
.smoke {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.5) 40%, rgba(255,255,255,0) 75%);
  pointer-events: none;
  animation: smokeOut 1.8s ease-out forwards;
  z-index: 2;
  filter: blur(1px);
}

@keyframes smokeOut {
  0%   { transform: scale(0.4); opacity: 0.0; }
  20%  { transform: scale(0.9) translate(8px, -4px); opacity: 0.85; }
  100% { transform: scale(2.6) translate(70px, -22px); opacity: 0; }
}

/* When plane is flying away — each puff is emitted at the plane's current
   trajectory position, so it only drifts/expands/fades a little. The trail
   that follows the plane is the cluster of continuously-emitted puffs. */
.smoke.flying {
  width: 56px;
  height: 56px;
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(245,250,252,0.7) 35%, rgba(220,235,240,0.3) 65%, rgba(220,235,240,0) 80%);
  filter: blur(2px);
  animation: smokeOutFlying 1.5s ease-out forwards;
}

@keyframes smokeOutFlying {
  0%   { transform: scale(0.5); opacity: 0; }
  15%  { transform: scale(1.1) translate(-6px, -4px); opacity: 1; }
  60%  { transform: scale(2.2) translate(-30px, -16px); opacity: 0.6; }
  100% { transform: scale(3.4) translate(-60px, -34px); opacity: 0; }
}

/* === FINAL SCREEN === */
.final-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-radius: 32px;
  padding: 56px 56px 48px;
  max-width: 620px;
  text-align: center;
  box-shadow: 0 30px 80px -20px rgba(31, 58, 68, 0.25);
  border: 1px solid rgba(255,255,255,0.7);
  animation: cardPop 0.6s cubic-bezier(.34, 1.56, .64, 1) both;
}

.final-card h1 {
  font-size: 36px;
  font-weight: 800;
  color: #1f3a44;
  margin-bottom: 14px;
  text-wrap: balance;
}

.final-card p {
  font-size: 17px;
  color: #5a767e;
  line-height: 1.55;
  margin-bottom: 28px;
}

.final-summary {
  text-align: left;
  background: #f4f9fb;
  border-radius: 18px;
  padding: 22px 24px;
  margin-bottom: 28px;
  border: 1px solid #e0eef2;
}

.summary-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px dashed #d4e7ec;
}
.summary-row:last-child { border-bottom: none; }

.summary-label {
  font-size: 11px;
  font-weight: 800;
  color: #7BC4D4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.summary-value {
  font-size: 15px;
  color: #1f3a44;
  font-weight: 600;
  line-height: 1.4;
}

.btn-restart {
  background: linear-gradient(135deg, #7BC4D4 0%, #5fb0c2 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px 32px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px -8px rgba(123, 196, 212, 0.6);
  transition: transform 0.15s;
}
.btn-restart:hover { transform: translateY(-2px); }

/* === HINT === */
.hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-size: 12px;
  color: rgba(31, 58, 68, 0.5);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.6);
  padding: 6px 14px;
  border-radius: 999px;
}

.hint kbd {
  background: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  color: #4ea0b3;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  margin: 0 2px;
}

/* responsive: stack on small screens */
@media (max-width: 820px) {
  /* Hide the keyboard hint on touch devices */
  .hint { display: none; }

  /* Stage becomes a normal flowing block instead of fixed inset */
  .stage {
    position: relative;
    inset: auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 70px 16px 32px;
    align-items: flex-start;
    transform-origin: 50% 30%;
  }

  /* Sky/clouds must cover the full viewport on mobile, even while scrolling.
     Fixed positioning prevents the white gap that appears when content grows
     and the browser chrome resizes the visual viewport. */
  .sky, .cloud-layer {
    position: fixed;
    inset: 0;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    z-index: 0;
  }
  .stage { z-index: 1; }

  /* Mobile cinematic transitions:
     - Plane keeps its own fly-away/fly-in animation (already defined below).
     - Scene gets a subtle camera dolly so the page doesn't feel static, but
       NOT a heavy scale that would overpower the plane's exit.
     - We do NOT animate .stage itself because it's a position:relative scroll
       container on mobile and transforms cause layout glitches. */
  .stage.flying-out, .stage.flying-in { animation: none; transform: none; }
  /* Card fades out AFTER plane has visibly taken off, so user sees the plane
     leaving first, not just elements vanishing. Delay the card exit ~250ms. */
  .stage.flying-out .scene-card-side { animation: cardOutMobile 0.95s cubic-bezier(.55, 0, .67, 1) 0.25s forwards; }
  .stage.flying-in  .scene-card-side { animation: cardInMobile  0.7s cubic-bezier(.2, .7, .3, 1) both; }
  @keyframes cardOutMobile {
    0%   { opacity: 1; transform: translateY(0)    scale(1); filter: blur(0); }
    100% { opacity: 0; transform: translateY(-18px) scale(0.94); filter: blur(2px); }
  }
  @keyframes cardInMobile {
    0%   { opacity: 0; transform: translateY(20px) scale(0.94); filter: blur(2px); }
    100% { opacity: 1; transform: translateY(0)    scale(1);    filter: blur(0); }
  }

  .scene {
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 540px;
  }

  /* Plane appears ABOVE the card on mobile */
  .scene-plane-side {
    order: -1;
    width: 100%;
    max-width: 360px;
    height: auto;
    min-height: 260px;
    margin: 0 auto;
  }

  .plane {
    width: clamp(140px, 50vw, 200px);
  }

  .scene-card-side {
    flex: 1 1 auto;
    width: 100%;
    justify-content: center;
  }

  .q-card {
    width: 100%;
    padding: 24px 22px 22px;
    border-radius: 22px;
  }

  .q-title { font-size: 20px; margin-bottom: 18px; }
  .q-input, .q-textarea, .choice { font-size: 16px; }
  .q-textarea { min-height: 100px; }

  /* Bubble: smaller, repositioned above plane */
  .bubble {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    margin: 0 auto 12px;
    max-width: 240px;
    font-size: 13px;
    padding: 10px 14px;
    animation: bubbleInMobile 0.5s cubic-bezier(.34, 1.56, .64, 1) 0.2s both;
    flex-shrink: 0;
  }
  .bubble::after {
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
  }
  @keyframes bubbleInMobile {
    0%   { opacity: 0; transform: translateY(8px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
  }

  /* Two-option choices stack on mobile */
  .choices.two { grid-template-columns: 1fr; }

  /* Brand smaller on mobile */
  .brand { top: 14px; left: 14px; gap: 8px; }
  .brand img { width: 28px; height: 28px; }
  .brand-text { font-size: 10px; }
  .brand-text small { font-size: 8px; }

  /* Progress bar smaller / repositioned to right */
  .progress-shell {
    top: 14px;
    left: auto;
    right: 14px;
    transform: none;
    padding: 6px 10px;
    gap: 6px;
  }
  .progress-bar { width: 60px; height: 4px; }
  .progress-label { font-size: 9px; }

  /* Final card */
  .final-card { padding: 36px 24px 28px; }
  .final-card h1 { font-size: 26px; }
  .final-card p { font-size: 15px; }

  /* Position the plane wrap content centered */
  .plane-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 4px;
  }
  .plane {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    animation: bobMobile 3.6s ease-in-out infinite;
  }
  @keyframes bobMobile {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50%      { transform: translateY(-8px) rotate(2deg); }
  }
  .plane.fly-away { animation: flyAwayMobile 1.4s cubic-bezier(.5, 0, .75, 0.2) forwards; }
  @keyframes flyAwayMobile {
    /* Start mid-bob position so there's no snap from bobMobile */
    0%   { transform: translate(0, -4px) rotate(-4deg) scaleX(1);  opacity: 1; }
    /* Quick takeoff: rise + face right + start moving */
    15%  { transform: translate(8vw, -16px) rotate(8deg) scaleX(-1); opacity: 1; }
    /* Mid-flight, well visible across the screen */
    45%  { transform: translate(55vw, -32px) rotate(14deg) scaleX(-1); opacity: 1; }
    /* Tail fade as it exits */
    100% { transform: translate(140vw, -60px) rotate(20deg) scaleX(-1); opacity: 0; }
  }
  .plane.fly-in { animation: flyInMobile 0.8s cubic-bezier(.2, .7, .3, 1) both; }
  @keyframes flyInMobile {
    0%   { transform: translate(-140vw, 30px) rotate(-12deg); opacity: 0; }
    60%  { opacity: 1; }
    100% { transform: translate(0, 0) rotate(-4deg); opacity: 1; }
  }
}
