:root{
  --bg:#fbf5ec;
  --panel:#fffaf3;
  --panel2:#fff6ea;
  --white:#ffffff;
  --text:#13213a;
  --muted:#61708b;
  --line:#eadccc;
  --line2:#f2e5d7;
  --accent:#ff7818;
  --accent-dark:#e95f00;
  --accent-soft:#fff0e4;
  --success:#1f9d67;
  --shadow:0 18px 42px rgba(30,23,16,.09);
  --shadow-soft:0 10px 26px rgba(30,23,16,.055);
  --radius:28px;
  --maxw:430px;
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
html,body{margin:0;padding:0;min-height:100%;}
html{scroll-behavior:smooth;}
body{
  background:radial-gradient(circle at 50% -15%,#fff4e5 0%,#fbf5ec 45%,#f6eee4 100%);
  color:var(--text);
  font-family:Inter,Arial,Helvetica,sans-serif;
  overflow-x:hidden;
}
button,input{font:inherit;}
a{color:inherit;text-decoration:none;}
img{max-width:100%;display:block;}

.app{
  width:100%;
  max-width:var(--maxw);
  min-height:100vh;
  margin:0 auto;
  padding:14px 12px 24px;
  position:relative;
}

.topbar{
  min-height:46px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  margin-bottom:10px;
}
.brand{display:inline-flex;align-items:center;}
.brand-logo{
  display:block;
  width:142px;
  max-width:56vw;
  height:auto;
  object-fit:contain;
}

.screen{display:none;}
.screen.active{display:block;animation:screenIn .28s ease both;}
@keyframes screenIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}

/* HERO */
.hero-card{
  background:linear-gradient(180deg,#fffaf3 0%,#fff8ef 54%,#fff0df 100%);
  border:1px solid rgba(234,220,204,.78);
  border-radius:var(--radius);
  box-shadow:var(--shadow-soft);
  overflow:hidden;
  position:relative;
}
.hero-copy{
  padding:20px 18px 0;
  position:relative;
  z-index:2;
  transition:opacity .34s ease,transform .34s ease;
}
.hero-card.starting .hero-copy{opacity:0;transform:translateY(-12px);}
.eyebrow{
  display:block;
  color:var(--accent-dark);
  font-size:11px;
  line-height:1.15;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.085em;
  margin:0 0 11px;
}
.hero-title{
  margin:0 0 9px;
  font-size:30px;
  line-height:1.06;
  letter-spacing:-.066em;
  font-weight:900;
  color:var(--text);
}
.accent-word{
  color:var(--accent-dark);
  text-shadow:0 8px 20px rgba(255,120,24,.10);
}
.hero-sub{
  margin:0;
  color:var(--muted);
  font-size:14.5px;
  line-height:1.48;
  letter-spacing:-.016em;
  max-width:340px;
  font-weight:650;
}
.primary-btn{
  width:100%;
  min-height:52px;
  border:0;
  border-radius:17px;
  background:linear-gradient(180deg,#ff8730 0%,#ff6b0d 100%);
  color:#fff;
  cursor:pointer;
  font-weight:900;
  font-size:15.5px;
  letter-spacing:-.02em;
  box-shadow:0 13px 24px rgba(255,120,24,.21);
  transition:transform .16s ease,box-shadow .16s ease,filter .16s ease;
}
.primary-btn:active{transform:scale(.985);box-shadow:0 8px 18px rgba(255,120,24,.17);}
.start-btn{margin-top:16px;}
.hero-note{
  margin-top:12px;
  display:flex;
  align-items:flex-start;
  gap:9px;
  color:#64708a;
  font-size:13px;
  line-height:1.34;
  font-weight:800;
}
.note-icon{
  width:23px;
  height:23px;
  border-radius:50%;
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#fff8f0;
  border:1px solid #ffc7a3;
  color:var(--accent-dark);
  font-weight:900;
  margin-top:-2px;
}
.hero-art-wrap{
  padding:2px 0 0;
  min-height:232px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  overflow:hidden;
  background:linear-gradient(180deg,rgba(255,248,239,0) 0%,#fff0df 100%);
}
.hero-art{
  width:106%;
  max-width:410px;
  margin:0 auto -10px;
  object-fit:contain;
  transform-origin:center bottom;
  filter:drop-shadow(0 16px 22px rgba(38,27,17,.075));
  transition:opacity .28s ease,transform .48s cubic-bezier(.22,.82,.24,1);
}
.hero-card.starting .hero-art{opacity:0;transform:translateY(-24px) scale(.82);}
.footer-links{
  margin:14px auto 0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:15px;
  flex-wrap:wrap;
  color:#758096;
  font-size:11.5px;
  font-weight:650;
}

/* QUIZ */
.quiz-card{
  background:linear-gradient(180deg,#fffaf3 0%,#fff7ed 54%,#fff3e5 100%);
  border:1px solid rgba(234,220,204,.78);
  border-radius:var(--radius);
  box-shadow:var(--shadow-soft);
  overflow:hidden;
  min-height:calc(100vh - 86px);
}
.progress-shell{
  padding:16px 18px 13px;
  background:rgba(255,250,243,.88);
  border-bottom:1px solid rgba(234,220,204,.72);
  transition:opacity .28s ease,transform .28s ease;
}
.progress-row{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:11px;}
.back-link{
  border:0;
  background:transparent;
  color:var(--text);
  font-size:14.5px;
  font-weight:900;
  padding:6px 0;
  cursor:pointer;
}
.progress-percent{color:#667188;font-size:14px;font-weight:900;}
.progress-track{height:8px;border-radius:999px;overflow:hidden;background:#eee4d8;}
.progress-fill{width:0%;height:100%;border-radius:999px;background:linear-gradient(90deg,#ff8a34,#ff6f12);transition:width .24s ease;}
.quiz-visual{
  height:188px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px 10px 0;
  background:linear-gradient(180deg,#fff7ed 0%,#fffaf3 70%,rgba(255,250,243,0) 100%);
  transition:opacity .28s ease,transform .28s ease,height .2s ease;
}
.quiz-art{max-height:186px;width:auto;object-fit:contain;filter:drop-shadow(0 12px 18px rgba(38,27,17,.08));}
.quiz-card[data-step-type="state"] .quiz-visual{height:150px;}
.quiz-card[data-step-type="state"] .quiz-art{max-height:148px;}
.quiz-card[data-step-type="lead"] .quiz-visual{display:none;}
.quiz-card[data-step-type="lead"] .quiz-art{display:none;}
.question-shell{padding:0 18px 20px;transition:opacity .28s ease,transform .28s ease;}
.quiz-body{animation:questionIn .24s ease both;}
@keyframes questionIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
.question-title{
  margin:0 0 16px;
  font-size:27px;
  line-height:1.1;
  letter-spacing:-.064em;
  font-weight:900;
  color:var(--text);
}
.quiz-card[data-step-type="lead"] .question-title{font-size:24px;margin-bottom:6px;}
.quiz-card[data-step-type="state"] .question-title{font-size:27px;margin-bottom:13px;}
.options{display:grid;gap:10px;}
.option{
  width:100%;
  min-height:62px;
  border-radius:19px;
  border:2px solid #e7dccc;
  background:rgba(255,255,255,.94);
  color:#17243d;
  padding:13px 15px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:15.6px;
  font-weight:900;
  line-height:1.2;
  letter-spacing:-.035em;
  cursor:pointer;
  text-align:left;
  transition:background .16s ease,border-color .16s ease,transform .16s ease,box-shadow .16s ease;
}
.option:active{transform:scale(.99);}
.option.selected{border-color:var(--accent);background:var(--accent-soft);box-shadow:0 10px 24px rgba(255,120,24,.10);}
.option-mark{flex:0 0 auto;width:25px;height:25px;border-radius:50%;border:3px solid #c7bdaf;background:#fff;position:relative;}
.option.selected .option-mark{border-color:var(--accent);background:var(--accent);}
.option.selected .option-mark::after{content:"";position:absolute;top:50%;left:50%;width:7px;height:7px;border-radius:50%;background:#fff;transform:translate(-50%,-50%);}

.input-stack{display:grid;gap:11px;}
.state-picker{position:relative;z-index:5;}
.state-trigger{
  width:100%;
  min-height:58px;
  border-radius:18px;
  border:2px solid #ffb47f;
  background:#fff;
  color:#17243d;
  padding:0 15px;
  outline:0;
  font-size:15.5px;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  cursor:pointer;
  box-shadow:0 0 0 4px rgba(255,120,24,.08);
}
.state-trigger .placeholder{color:#6d7485;}
.state-caret{font-size:20px;line-height:1;transform:translateY(-1px);}
.state-menu{
  display:none;
  margin-top:8px;
  border-radius:18px;
  background:rgba(255,255,255,.98);
  border:1px solid #e7dccc;
  box-shadow:0 18px 38px rgba(42,31,20,.16);
  overflow:hidden;
}
.state-picker.open .state-menu{display:block;animation:stateMenuIn .18s ease both;}
@keyframes stateMenuIn{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}
.state-search{
  width:calc(100% - 20px);
  margin:10px;
  min-height:44px;
  border-radius:13px;
  border:1px solid #e7dccc;
  background:#fffaf3;
  color:var(--text);
  padding:0 13px;
  font-size:14px;
  font-weight:800;
  outline:0;
}
.state-list{max-height:235px;overflow:auto;padding:2px 8px 10px;scrollbar-width:thin;}
.state-item{
  width:100%;
  min-height:42px;
  border:0;
  border-radius:12px;
  background:transparent;
  color:#27344c;
  padding:0 12px;
  text-align:left;
  font-size:14px;
  font-weight:850;
  cursor:pointer;
}
.state-item:active,.state-item.selected{background:var(--accent-soft);color:var(--accent-dark);}
.state-empty{padding:14px 12px;color:#7b8497;font-size:13px;font-weight:800;text-align:center;}
.center-action{margin:14px auto 0;width:min(100%,280px);}

/* LEAD */
.lead-subtitle{margin:0 0 10px;color:#65708a;font-size:13.5px;line-height:1.42;font-weight:750;}
.lead-form-panel{
  display:grid;
  gap:9px;
  padding:12px;
  border-radius:22px;
  background:rgba(255,250,243,.84);
  border:1px solid #eadccc;
  box-shadow:0 10px 22px rgba(30,23,16,.045);
}
.lead-form-panel.focused{box-shadow:0 18px 42px rgba(255,120,24,.12);border-color:#ffc79f;}
.text-input,.email-input,.tel-input{
  width:100%;
  min-height:56px;
  border-radius:17px;
  border:2px solid #e7dccc;
  background:#fff;
  color:#17243d;
  padding:0 15px;
  outline:0;
  font-size:15.5px;
  font-weight:850;
  transition:border-color .16s ease,box-shadow .16s ease;
}
.text-input:focus,.email-input:focus,.tel-input:focus{border-color:#ffb47f;box-shadow:0 0 0 4px rgba(255,120,24,.09);}
.text-input::placeholder,.email-input::placeholder,.tel-input::placeholder{color:#747b86;font-weight:850;}
.consent-line{
  color:#69758c;
  font-size:11.2px;
  line-height:1.42;
  font-weight:700;
  text-align:center;
  padding:0 4px;
  margin-top:2px;
}
.see-more-btn{
  border:0;
  background:transparent;
  color:var(--accent-dark);
  font-weight:900;
  padding:0;
  cursor:pointer;
  text-decoration:underline;
}
.consent-more{
  display:none;
  margin:-2px 2px 0;
  color:#798294;
  font-size:10.8px;
  line-height:1.42;
  font-weight:650;
  text-align:center;
}
.consent-more.show{display:block;}
.lead-form-panel .center-action{
  position:sticky;
  bottom:10px;
  z-index:6;
  margin-top:2px;
  width:100%;
}
.error{display:none;margin-top:8px;color:#c33a2f;font-size:12px;font-weight:800;line-height:1.4;}
.error.show{display:block;}

.quiz-card.entering .progress-shell,.quiz-card.entering .question-shell{opacity:0;transform:translateY(12px);}
.quiz-card.entering .quiz-visual{opacity:1;}
.art-clone{
  position:fixed;
  z-index:9999;
  object-fit:contain;
  pointer-events:none;
  transition:left .58s cubic-bezier(.18,.88,.22,1),top .58s cubic-bezier(.18,.88,.22,1),width .58s cubic-bezier(.18,.88,.22,1),height .58s cubic-bezier(.18,.88,.22,1),opacity .58s ease,transform .58s cubic-bezier(.18,.88,.22,1);
  filter:drop-shadow(0 14px 20px rgba(38,27,17,.10));
}


.quiz-card{
  position:relative;
}
.quiz-card.is-processing::after{
  content:"";
  position:absolute;
  z-index:30;
  left:50%;
  top:44%;
  width:30px;
  height:30px;
  margin-left:-15px;
  margin-top:-15px;
  border-radius:50%;
  border:4px solid #f0dfcf;
  border-top-color:var(--accent);
  background:rgba(255,250,243,.35);
  animation:spin .78s linear infinite;
  opacity:.95;
  filter:drop-shadow(0 8px 14px rgba(255,120,24,.18));
}
.quiz-card.is-processing .option:not(.selected),
.quiz-card.is-processing .state-trigger,
.quiz-card.is-processing .center-action{
  pointer-events:none;
  opacity:.82;
}
.option.selected .option-mark{
  animation:softPulse .42s ease both;
}
@keyframes softPulse{
  0%{transform:scale(1)}
  50%{transform:scale(1.1)}
  100%{transform:scale(1)}
}
.primary-btn.btn-loading{
  color:transparent;
  position:relative;
  pointer-events:none;
}
.primary-btn.btn-loading::after{
  content:"";
  position:absolute;
  width:22px;
  height:22px;
  border-radius:50%;
  border:3px solid rgba(255,255,255,.45);
  border-top-color:#fff;
  left:50%;
  top:50%;
  margin-left:-11px;
  margin-top:-11px;
  animation:spin .72s linear infinite;
}

/* STATUS / LOADING */
.status-card{
  background:linear-gradient(180deg,#fffaf3 0%,#fff7ed 100%);
  border:1px solid rgba(234,220,204,.78);
  border-radius:var(--radius);
  box-shadow:var(--shadow-soft);
  padding:28px 20px;
  text-align:center;
}
.loader{
  width:72px;
  height:72px;
  border-radius:50%;
  border:8px solid #f2dfcd;
  border-top-color:var(--accent);
  margin:4px auto 18px;
  animation:spin .9s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}
.status-card h2{margin:0 0 10px;font-size:27px;line-height:1.13;letter-spacing:-.055em;font-weight:900;}
.status-card p{margin:0;color:#65708a;font-size:15px;line-height:1.55;font-weight:700;}
.thinking-feed{
  margin-top:22px;
  text-align:left;
  min-height:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 4px;
}
.thinking-line{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:0;
  color:#3f4b62;
  font-size:14px;
  line-height:1.45;
  font-weight:850;
  min-height:30px;
  width:100%;
  text-align:center;
  transition:opacity .2s ease, transform .2s ease;
}
.thinking-line.fade-out{
  opacity:0;
  transform:translateY(-4px);
}
.thinking-dot{display:none;}
.typing-cursor::after{
  content:"";
  display:inline-block;
  width:7px;
  height:1.15em;
  margin-left:3px;
  background:var(--accent);
  vertical-align:-3px;
  animation:blink .85s steps(1) infinite;
}
@keyframes blink{50%{opacity:0}}
.result-badge{width:78px;height:78px;margin:0 auto 16px;border-radius:50%;background:#ecfff5;border:1px solid #cfeedd;color:var(--success);display:flex;align-items:center;justify-content:center;font-size:36px;font-weight:900;}
.result-card .primary-btn{margin-top:18px;}
.disclaimer{margin-top:14px;color:#7d8798;font-size:11px;line-height:1.55;font-weight:600;}

@media (max-width:380px){
  .app{padding:12px 10px 22px;}
  .topbar{min-height:42px;margin-bottom:8px;}
  .brand-logo{width:136px;}
  .hero-copy{padding:18px 16px 0;}
  .eyebrow{font-size:10.5px;margin-bottom:10px;}
  .hero-title{font-size:28px;}
  .hero-sub{font-size:14px;line-height:1.45;}
  .primary-btn{min-height:50px;}
  .hero-art-wrap{min-height:218px;}
  .hero-art{width:108%;margin-bottom:-9px;}
  .footer-links{display:none;}
  .quiz-card{min-height:calc(100vh - 72px);}
  .progress-shell{padding:14px 16px 12px;}
  .quiz-visual{height:178px;}
  .quiz-art{max-height:176px;}
  .quiz-card[data-step-type="state"] .quiz-visual{height:142px;}
  .quiz-card[data-step-type="state"] .quiz-art{max-height:140px;}
  .quiz-card[data-step-type="lead"] .quiz-visual{display:none;}
  .quiz-card[data-step-type="lead"] .quiz-art{display:none;}
  .question-shell{padding:0 16px 18px;}
  .question-title{font-size:25px;margin-bottom:14px;}
  .quiz-card[data-step-type="lead"] .question-title{font-size:24px;}
  .option{min-height:60px;font-size:15px;border-radius:18px;}
  .state-list{max-height:218px;}
  .lead-form-panel{padding:12px;gap:9px;}
}

@media (max-width:340px){
  .hero-title{font-size:26px;}
  .hero-art-wrap{min-height:202px;}
  .quiz-visual{height:160px;}
  .quiz-art{max-height:158px;}
  .quiz-card[data-step-type="state"] .quiz-visual{height:130px;}
  .quiz-card[data-step-type="state"] .quiz-art{max-height:128px;}
  .question-title{font-size:23px;}
  .option{min-height:56px;font-size:14px;}
}

@media (min-width:768px){
  body{
    background:
      radial-gradient(circle at 50% -12%,#fff3e3 0%,#fbf5ec 42%,#f7efe5 100%);
  }
  .app{
    max-width:1080px;
    min-height:100vh;
    padding:28px 28px 34px;
  }
  .topbar{
    width:100%;
    margin:0 auto 18px;
    justify-content:flex-start;
  }
  .brand-logo{width:170px;max-width:210px;}
  #heroScreen,
  #quizScreen,
  #loadingScreen,
  #resultScreen{
    width:100%;
  }
  .hero-card,
  .quiz-card,
  .status-card{
    width:460px;
    margin:0 auto;
  }
  .hero-card{
    max-height:none;
  }
  .hero-copy{padding:22px 22px 0;}
  .hero-title{font-size:33px;}
  .hero-sub{font-size:15px;max-width:380px;}
  .hero-art-wrap{min-height:268px;}
  .hero-art{width:104%;max-width:448px;}
  .quiz-card{min-height:640px;}
  .quiz-visual{height:210px;}
  .quiz-art{max-height:208px;}
  .quiz-card[data-step-type="state"] .quiz-visual{height:168px;}
  .quiz-card[data-step-type="state"] .quiz-art{max-height:166px;}
  .quiz-card[data-step-type="lead"] .quiz-visual{display:none;}
  .question-title{font-size:29px;}
}

@media (min-width:1100px){
  .app{max-width:1120px;}
  .hero-card,.quiz-card,.status-card{width:480px;}
}

/* Duplicate / error popup */
.message-modal{
  position:fixed;
  inset:0;
  z-index:9999;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(19,33,58,.42);
  backdrop-filter:blur(6px);
}
.message-modal.show{display:flex;animation:screenIn .18s ease both;}
.message-modal-card{
  width:min(100%,380px);
  background:#fffaf3;
  border:1px solid rgba(234,220,204,.95);
  border-radius:26px;
  box-shadow:0 28px 80px rgba(30,23,16,.22);
  padding:24px 20px 20px;
  text-align:center;
  position:relative;
}
.message-modal-close{
  position:absolute;
  top:10px;
  right:12px;
  width:34px;
  height:34px;
  border:0;
  border-radius:50%;
  background:#fff0e4;
  color:#e95f00;
  font-size:24px;
  line-height:1;
  font-weight:900;
  cursor:pointer;
}
.message-modal-icon{
  width:56px;
  height:56px;
  margin:0 auto 12px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#fff0e4;
  color:#ff7818;
  font-size:28px;
  font-weight:900;
  border:1px solid #ffc7a3;
}
.message-modal-card h3{
  margin:0 0 8px;
  font-size:25px;
  line-height:1.1;
  letter-spacing:-.04em;
  color:#13213a;
}
.message-modal-card p{
  margin:0 0 18px;
  color:#61708b;
  line-height:1.45;
  font-size:14px;
  font-weight:700;
}
.message-modal-btn{min-height:48px;}
