:root{
  --bg-1:#FBF7EE;
  --bg-2:#F2E7D2;
  --bg-3:#EDE0C4;
  --ink:#1C1815;
  --ink-soft:#5C5548;
  --ink-faint:#9C9280;
  --gold:#B8873B;
  --gold-light:#DCB86B;
  --gold-dark:#8C6526;
  --accent:#B8873B;
  --accent-2:#8C6526;
  --accent-grad: linear-gradient(135deg, #DCB86B 0%, #B8873B 55%, #8C6526 100%);
  --card-bg: rgba(255,255,255,0.72);
  --card-border: rgba(28,24,21,0.10);
  --text-1:var(--ink);
  --text-2:var(--ink-soft);
  --text-3:var(--ink-faint);
  --danger:#B3402B;
  --success:#3E7A54;
  --radius-lg:24px;
  --radius-md:14px;
  --radius-sm:10px;
  --shadow-soft: 0 20px 50px rgba(90,68,20,0.16);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font-family:var(--font);
  background: radial-gradient(circle at 20% 20%, var(--bg-2), var(--bg-1) 60%), var(--bg-3);
  color:var(--text-1);
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:clamp(14px, 5vw, 32px) clamp(8px, 4vw, 16px);
  overflow-x:hidden;
}

.bg-decor{position:fixed; inset:0; overflow:hidden; z-index:0; pointer-events:none;}
.blob{position:absolute; border-radius:50%; filter:blur(90px); opacity:0.30;}
.blob-1{width:420px; height:420px; background:var(--gold-light); top:-120px; left:-100px; animation: float1 14s ease-in-out infinite;}
.blob-2{width:380px; height:380px; background:var(--gold); bottom:-140px; right:-100px; animation: float2 16s ease-in-out infinite;}
.blob-3{width:300px; height:300px; background:#E8D5B0; top:40%; left:60%; animation: float1 18s ease-in-out infinite reverse;}

@keyframes float1{
  0%,100%{transform:translate(0,0);}
  50%{transform:translate(40px,60px);}
}
@keyframes float2{
  0%,100%{transform:translate(0,0);}
  50%{transform:translate(-50px,-30px);}
}

.wrap{
  position:relative;
  z-index:1;
  width:100%;
  max-width:640px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:clamp(10px, 3vw, 16px);
}

.card{
  position:relative;
  width:100%;
  background:var(--card-bg);
  border:1px solid var(--card-border);
  border-radius:var(--radius-lg);
  padding:clamp(20px, 6vw, 40px);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:var(--shadow-soft);
  animation: rise 0.6s cubic-bezier(.2,.8,.2,1);
  overflow:hidden;
}

@keyframes rise{
  from{opacity:0; transform:translateY(24px);}
  to{opacity:1; transform:translateY(0);}
}

.survey-header{text-align:center;}
.logo-plate{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin:0 auto clamp(14px, 4vw, 20px);
  padding:clamp(9px, 2.8vw, 13px) clamp(13px, 4vw, 18px);
  border-radius:var(--radius-md);
  background:radial-gradient(circle at 50% 35%, #2A2620 0%, #1C1815 70%, #14110E 100%);
  box-shadow:0 14px 34px rgba(20,17,14,0.35);
}
.brand-logo{
  display:block;
  width:100%;
  max-width:clamp(105px, 32vw, 150px);
  height:auto;
}
.survey-header h1{
  margin:0 0 8px;
  font-family:var(--font-serif);
  font-size:clamp(20px, 5.5vw, 30px);
  font-weight:700;
  letter-spacing:-0.01em;
  color:var(--ink);
}
.survey-header p{
  margin:0 0 clamp(18px, 5vw, 28px);
  color:var(--text-2);
  font-size:clamp(13px, 3.6vw, 15px);
  line-height:1.5;
}

.progress-track{
  width:100%;
  height:6px;
  background:rgba(28,24,21,0.08);
  border-radius:999px;
  overflow:hidden;
  margin-bottom:8px;
}
.progress-bar{
  height:100%;
  width:0%;
  background:var(--accent-grad);
  border-radius:999px;
  transition:width 0.4s cubic-bezier(.2,.8,.2,1);
}
.progress-meta{
  display:flex;
  justify-content:space-between;
  font-size:12px;
  color:var(--text-3);
  margin-bottom:clamp(18px, 5vw, 28px);
  font-weight:600;
  letter-spacing:0.02em;
}

.questions-container{
  position:relative;
  min-height:120px;
  /* allow native vertical scroll; horizontal drag is handled by our own swipe JS */
  touch-action:pan-y;
}

.question{
  display:none;
  animation: fadeSlide 0.4s cubic-bezier(.2,.8,.2,1);
}
.question.active{display:block;}

@keyframes fadeSlide{
  from{opacity:0; transform:translateX(16px);}
  to{opacity:1; transform:translateX(0);}
}

.question-label{
  display:block;
  font-size:clamp(16px, 4.5vw, 18px);
  font-weight:700;
  margin-bottom:6px;
  color:var(--text-1);
}
.question-label .req{color:var(--gold-dark); margin-left:4px;}
.question-help{
  font-size:13px;
  color:var(--text-3);
  margin-bottom:clamp(14px, 4vw, 18px);
}

/* Text / textarea / email / number inputs */
.input-field, textarea.input-field{
  width:100%;
  padding:clamp(12px, 3.2vw, 14px) clamp(12px, 3.6vw, 16px);
  background:rgba(255,255,255,0.55);
  border:1.5px solid var(--card-border);
  border-radius:var(--radius-md);
  color:var(--text-1);
  font-family:var(--font);
  /* 16px minimum keeps iOS Safari from auto-zooming the page on focus */
  font-size:16px;
  outline:none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  resize:vertical;
}
.input-field::placeholder{color:var(--text-3);}
.input-field:focus{
  border-color:var(--gold);
  background:rgba(255,255,255,0.85);
  box-shadow:0 0 0 4px rgba(184,135,59,0.18);
}

/* Select */
select.input-field{
  appearance:none;
  -webkit-appearance:none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'><path stroke='%235C5548' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/></svg>");
  background-repeat:no-repeat;
  background-position:right 14px center;
  padding-right:36px;
  cursor:pointer;
  text-overflow:ellipsis;
}
select.input-field option{background:#FFFDF8; color:var(--text-1);}

/* Phone (country code + number) */
.phone-field{
  display:flex;
  gap:10px;
}
.phone-country-select{
  flex:0 0 44%;
  min-width:0;
  padding-right:30px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.phone-number-input{
  flex:1;
  min-width:0;
}
@media (max-width:480px){
  .phone-field{flex-direction:column;}
  .phone-country-select{flex:1;}
}

/* Choice options (radio / checkbox) */
.options-list{
  display:flex;
  flex-direction:column;
  gap:clamp(6px, 1.7vw, 7px);
}
.option-item{
  display:flex;
  align-items:center;
  gap:clamp(7px, 2.1vw, 8px);
  padding:clamp(8px, 2.2vw, 10px) clamp(8px, 2.5vw, 11px);
  border:1.5px solid var(--card-border);
  border-radius:var(--radius-md);
  background:rgba(255,255,255,0.4);
  cursor:pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.option-item:hover{border-color:rgba(184,135,59,0.55); background:rgba(184,135,59,0.10);}
.option-item.selected{border-color:var(--gold); background:rgba(184,135,59,0.16);}
.option-item input{accent-color:var(--gold); width:18px; height:18px; flex-shrink:0; cursor:pointer;}
.option-item span{font-size:14px; line-height:1.4; color:var(--text-1);}

/* Conditional follow-up field (e.g. "Yes" -> name the app) */
.conditional-field{
  margin-top:14px;
  padding-top:16px;
  border-top:1px dashed var(--card-border);
  animation: fadeSlide 0.35s cubic-bezier(.2,.8,.2,1);
}
.follow-up-label{
  display:block;
  font-size:14px;
  font-weight:600;
  margin-bottom:10px;
  color:var(--text-2);
}
.follow-up-label .req{color:var(--gold-dark); margin-left:4px;}

/* Field group — several fields bundled into one card/step (e.g. name + email) */
.field-group-fields{
  display:flex;
  flex-direction:column;
  gap:clamp(16px, 4.5vw, 22px);
}
.field-group-label{
  display:block;
  font-size:14px;
  font-weight:600;
  margin-bottom:8px;
  color:var(--text-2);
}
.field-group-label .req{color:var(--gold-dark); margin-left:4px;}
.field-group-footnote{
  margin:16px 0 0;
  font-size:11.5px;
  line-height:1.6;
  color:var(--text-3);
}

/* Rating (stars / scale) */
.rating-row{display:flex; gap:clamp(5px, 1.8vw, 8px); flex-wrap:wrap;}
.rating-btn{
  width:clamp(36px, 9vw, 48px);
  height:clamp(36px, 9vw, 48px);
  display:flex; align-items:center; justify-content:center;
  border-radius:12px;
  border:1.5px solid var(--card-border);
  background:rgba(255,255,255,0.4);
  color:var(--text-2);
  font-weight:700;
  cursor:pointer;
  transition: all 0.2s;
  font-size:clamp(12px, 3vw, 15px);
}
.rating-btn:hover{border-color:var(--gold);}
.rating-btn.selected{
  background:var(--accent-grad);
  border-color:transparent;
  color:var(--ink);
  transform:scale(1.08);
}
.rating-scale-labels{display:flex; justify-content:space-between; margin-top:8px; font-size:12px; color:var(--text-3);}

.field-error{
  color:var(--danger);
  font-size:13px;
  margin-top:8px;
  display:none;
}
.field-error.show{display:block;}

/* Nav */
.nav-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-top:clamp(15px, 4.2vw, 22px);
  gap:clamp(4px, 1.75vw, 8px);
}
.dots{
  display:flex;
  gap:clamp(4px, 1.5vw, 6px);
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  justify-content:center;
}
.dot{
  width:7px; height:7px;
  flex-shrink:0;
  border-radius:50%;
  background:rgba(28,24,21,0.14);
  transition: all 0.25s;
}
.dot.active{background:var(--gold-dark); width:20px; border-radius:4px;}
.dot.done{background:var(--gold);}

.btn{
  border:none;
  border-radius:var(--radius-sm);
  padding:clamp(7px, 2.1vw, 9px) clamp(10px, 3.2vw, 15px);
  font-family:var(--font);
  font-weight:700;
  font-size:clamp(13px, 3.4vw, 14px);
  cursor:pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  white-space:nowrap;
  flex-shrink:0;
}
.btn:active{transform:scale(0.97);}
.btn-primary{
  background:var(--accent-grad);
  color:var(--ink);
  box-shadow:0 8px 24px rgba(140,101,38,0.35);
}
.btn-primary:hover{box-shadow:0 10px 30px rgba(140,101,38,0.5);}
.btn-primary:disabled{opacity:0.5; cursor:not-allowed; box-shadow:none;}
.btn-ghost{
  background:transparent;
  color:var(--text-2);
  border:1.5px solid var(--card-border);
}
.btn-ghost:hover{border-color:var(--ink-faint); color:var(--text-1);}
.btn-ghost:disabled{opacity:0.35; cursor:not-allowed;}
.hidden{display:none !important;}

/* Success view */
.success-view{
  text-align:center;
  padding:20px 0 8px;
  animation: rise 0.5s cubic-bezier(.2,.8,.2,1);
}
.success-logo-plate{margin:0 auto 22px;}

.success-icon-wrap{
  position:relative;
  width:fit-content;
  margin:0 auto 20px;
}
.success-icon{
  width:clamp(52px, 14vw, 64px);
  height:clamp(52px, 14vw, 64px);
  border-radius:50%;
  background:var(--accent-grad);
  color:var(--ink);
  font-size:clamp(24px, 6vw, 30px);
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 10px 30px rgba(140,101,38,0.4);
  animation: milestonePop 0.6s cubic-bezier(.2,.8,.2,1);
}
.success-view h2{margin:0 0 8px; font-family:var(--font-serif); font-size:clamp(20px, 5vw, 24px); font-weight:700; color:var(--ink);}
.success-view p{margin:0 auto 24px; max-width:380px; color:var(--text-2); font-size:clamp(13px, 3.6vw, 15px); line-height:1.6;}

/* Instagram follow badge on the thank-you card */
.success-actions{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:16px;
}
.social-follow{
  display:inline-flex;
  align-items:center;
  gap:12px;
  padding:8px 20px 8px 8px;
  border-radius:999px;
  border:1.5px solid var(--card-border);
  background:rgba(255,255,255,0.5);
  text-decoration:none;
  transition:border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.social-follow:hover{
  border-color:rgba(200,55,171,0.35);
  background:rgba(255,255,255,0.8);
  transform:translateY(-1px);
  box-shadow:0 8px 20px rgba(200,55,171,0.12);
}
.social-follow:active{transform:scale(0.97);}
.social-follow-icon{flex-shrink:0; border-radius:9px;}
.social-follow-text{display:flex; flex-direction:column; text-align:left; line-height:1.35;}
.social-follow-label{font-size:10.5px; font-weight:700; color:var(--text-3); text-transform:uppercase; letter-spacing:0.05em;}
.social-follow-handle{font-size:14px; font-weight:700; color:var(--ink);}

/* Confetti burst around the success checkmark */
.confetti{
  position:absolute;
  top:50%;
  left:50%;
  width:0;
  height:0;
}
.confetti-piece{
  position:absolute;
  top:0;
  left:0;
  width:6px;
  height:6px;
  margin:-3px 0 0 -3px;
  border-radius:2px;
  background:var(--gold);
  opacity:0;
}
.confetti.play .confetti-piece{animation:confettiBurst 0.9s ease-out forwards;}
.confetti-piece:nth-child(1){--angle:0deg; --dist:58px; background:var(--gold); animation-delay:0.02s;}
.confetti-piece:nth-child(2){--angle:30deg; --dist:66px; background:var(--gold-light); animation-delay:0.06s;}
.confetti-piece:nth-child(3){--angle:60deg; --dist:52px; background:#E8D5B0; animation-delay:0.10s;}
.confetti-piece:nth-child(4){--angle:90deg; --dist:70px; background:var(--gold-dark); animation-delay:0.03s;}
.confetti-piece:nth-child(5){--angle:120deg; --dist:56px; background:var(--gold); animation-delay:0.08s;}
.confetti-piece:nth-child(6){--angle:150deg; --dist:64px; background:var(--gold-light); animation-delay:0.01s;}
.confetti-piece:nth-child(7){--angle:180deg; --dist:60px; background:#E8D5B0; animation-delay:0.09s;}
.confetti-piece:nth-child(8){--angle:210deg; --dist:68px; background:var(--gold-dark); animation-delay:0.04s;}
.confetti-piece:nth-child(9){--angle:240deg; --dist:54px; background:var(--gold); animation-delay:0.07s;}
.confetti-piece:nth-child(10){--angle:270deg; --dist:72px; background:var(--gold-light); animation-delay:0.02s;}
.confetti-piece:nth-child(11){--angle:300deg; --dist:58px; background:#E8D5B0; animation-delay:0.05s;}
.confetti-piece:nth-child(12){--angle:330deg; --dist:64px; background:var(--gold-dark); animation-delay:0.00s;}

@keyframes confettiBurst{
  0%{opacity:1; transform:rotate(var(--angle)) translateY(0) scale(1);}
  100%{opacity:0; transform:rotate(var(--angle)) translateY(calc(-1 * var(--dist))) scale(0.4);}
}

/* Milestone screen — a mid-survey checkpoint, not the final "done" state */
.milestone-question{padding-top:8px;}
.milestone{
  text-align:center;
  padding:8px 0 4px;
}
.milestone-icon{
  width:clamp(48px, 13vw, 60px);
  height:clamp(48px, 13vw, 60px);
  margin:0 auto 18px;
  border-radius:50%;
  background:var(--accent-grad);
  color:var(--ink);
  font-size:clamp(22px, 5.5vw, 28px);
  font-weight:700;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 10px 30px rgba(140,101,38,0.35);
  animation: milestonePop 0.6s cubic-bezier(.2,.8,.2,1), milestonePulse 2.4s ease-in-out 0.6s infinite;
}
@keyframes milestonePop{
  0%{opacity:0; transform:scale(0.4);}
  60%{opacity:1; transform:scale(1.12);}
  100%{transform:scale(1);}
}
@keyframes milestonePulse{
  0%,100%{box-shadow:0 10px 30px rgba(140,101,38,0.35);}
  50%{box-shadow:0 10px 36px rgba(140,101,38,0.55), 0 0 0 8px rgba(184,135,59,0.10);}
}
.milestone-heading{
  margin:0 0 8px;
  font-family:var(--font-serif);
  font-size:clamp(18px, 5vw, 22px);
  font-weight:700;
  color:var(--ink);
}
.milestone-message{
  margin:0 auto 26px;
  max-width:420px;
  color:var(--text-2);
  font-size:clamp(13px, 3.4vw, 14px);
  line-height:1.6;
}
.milestone-connect{
  margin:0 auto;
  max-width:420px;
  padding:clamp(14px, 4vw, 18px) clamp(16px, 4.5vw, 20px);
  border-radius:var(--radius-md);
  background:rgba(184,135,59,0.08);
  border:1px solid rgba(184,135,59,0.25);
  text-align:left;
}
.milestone-connect-heading{
  margin:0 0 6px;
  font-size:15px;
  font-weight:700;
  color:var(--ink);
}
.milestone-connect-text{
  margin:0;
  font-size:13px;
  line-height:1.6;
  color:var(--text-2);
}

.error-banner{
  margin-top:20px;
  padding:14px 16px;
  border-radius:var(--radius-md);
  background:rgba(179,64,43,0.08);
  border:1px solid rgba(179,64,43,0.35);
  color:var(--danger);
  font-size:14px;
}

.site-footer{
  position:relative;
  z-index:1;
  margin-top:16px;
  color:var(--text-3);
  font-size:12px;
  text-align:center;
  padding:0 12px;
}
.site-footer strong{color:var(--text-2); font-weight:600;}

/* Extra breathing room clawed back on very small phones (≤ ~375px wide) */
@media (max-width:380px){
  .card{padding:16px 14px;}
  .nav-row{gap:4px;}
  .btn{padding:7px 8px; font-size:12.5px;}
  .dots{gap:3px;}
  .dot{width:6px; height:6px;}
  .dot.active{width:16px;}
  .rating-btn{width:34px; height:34px; font-size:12px;}
}