/* ---------- Pagina a schermo intero (template canvas, niente tema) ---------- */
body.afm-canvas{margin:0; background:#fff; min-height:100vh; -webkit-font-smoothing:antialiased;}
body.afm-canvas .afm-wrap{padding-top:8px;}

/* ============================================================
   AnswerForMe - Onboarding
   Tema chiaro, mobile-first, responsive desktop
   ============================================================ */

.afm-wrap{
    --afm-blue:#185FA5; --afm-blue-d:#0C447C; --afm-green:#6FB83C;
    --afm-ink:#1A2B3C; --afm-muted:#6B7785; --afm-soft:#8A97A4;
    --afm-line:#E2E8EF; --afm-bg:#F4F6F8;
    max-width:440px; margin:0 auto; padding:0 16px 32px;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
    color:var(--afm-ink); box-sizing:border-box;
}
.afm-wrap *{box-sizing:border-box;}

/* ---------- Header con Trilly (sempre in alto a sinistra) ---------- */
.afm-header{display:flex; align-items:center; gap:12px; padding:16px 4px 18px;}
.afm-wordmark .afm-name{font-size:21px; font-weight:700; letter-spacing:-.2px; line-height:1;}
.afm-c1{color:var(--afm-blue-d);} .afm-c2{color:#378ADD;} .afm-c3{color:var(--afm-green);}
.afm-wordmark .afm-tag{font-size:12px; color:var(--afm-soft); margin-top:2px;}
.afm-trilly{flex:0 0 auto; overflow:visible;}
.afm-head-logo{flex:0 0 auto; width:auto; height:46px; display:block; filter:drop-shadow(0 4px 6px rgba(16,38,74,.12));}
.afm-head-video{width:48px; height:48px; border-radius:24%; overflow:hidden; background:#fff; object-fit:cover; filter:none; box-shadow:0 4px 10px rgba(16,38,74,.16);}
.afm-head-video > img{width:100%; height:100%; object-fit:cover; display:block;}
@media (prefers-reduced-motion: no-preference){ img.afm-head-logo{animation:afm-bob 3.4s ease-in-out infinite; transform-origin:center bottom;} }

/* ---------- Animazioni della mascotte ---------- */
@media (prefers-reduced-motion: no-preference){
    .afm-trilly .afm-eyes{animation:afm-blink 4.5s infinite;}
    .afm-trilly.t-breathe .afm-body{animation:afm-bob 3s ease-in-out infinite;}
    .afm-trilly.t-wave .afm-body{animation:afm-wave 1.5s ease-in-out infinite;}
    .afm-trilly.t-curious .afm-pupils{animation:afm-look 3s ease-in-out infinite;}
    .afm-trilly.t-party .afm-body{animation:afm-hop 1.3s ease-in-out infinite;}
}
.afm-trilly .afm-eyes{transform-box:fill-box; transform-origin:center;}
.afm-trilly .afm-body{transform-box:fill-box; transform-origin:center bottom;}
@keyframes afm-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
@keyframes afm-blink{0%,92%,100%{transform:scaleY(1)}96%{transform:scaleY(.12)}}
@keyframes afm-wave{0%,100%{transform:rotate(-6deg)}50%{transform:rotate(6deg)}}
@keyframes afm-look{0%,100%{transform:translateX(-2px)}50%{transform:translateX(2px)}}
@keyframes afm-hop{0%,100%{transform:translateY(0) scale(1,1)}28%{transform:translateY(0) scale(1.05,.95)}55%{transform:translateY(-9px) scale(.98,1.02)}80%{transform:translateY(0) scale(1,1)}}

/* ---------- Schermate ---------- */
.afm-screen{animation:afm-fade .25s ease;}
.afm-screen[hidden]{display:none;}
@keyframes afm-fade{from{opacity:0; transform:translateY(6px)}to{opacity:1; transform:none}}
.afm-center{text-align:center;}

.afm-alert{background:#FFF6E5; border:1px solid #F2D69A; color:#7A5A12; font-size:13px;
    padding:10px 14px; border-radius:10px; margin-bottom:16px;}

/* ---------- Bubble di Trilly ---------- */
.afm-bubble{background:#EAF4FB; color:#13314A; font-size:14px; line-height:1.5;
    padding:11px 14px; border-radius:14px; border-top-left-radius:4px; margin-bottom:18px;}

/* ---------- Card piano ---------- */
.afm-plan-card{border:1.5px solid var(--afm-blue); border-radius:14px; overflow:hidden; margin-bottom:18px;}
.afm-plan-head{display:flex; justify-content:space-between; align-items:center; padding:14px 16px; background:#F3F8FC;}
.afm-muted{font-size:13px; color:var(--afm-muted);}
.afm-small{font-size:11px;}
.afm-plan-name{font-size:18px; font-weight:600; color:var(--afm-ink); margin:2px 0;}
.afm-price-box{text-align:right;}
.afm-price{font-size:26px; font-weight:700; color:var(--afm-blue); line-height:1;}
.afm-feat{list-style:none; margin:0; padding:14px 16px;}
.afm-feat li{position:relative; padding-left:26px; font-size:13.5px; color:#3A4754; line-height:1.4; margin-bottom:10px;}
.afm-feat li:last-child{margin-bottom:0;}
.afm-promo-note{margin:0 16px 14px; padding:8px 12px; background:#EAF4FB; color:#185FA5; font-size:12.5px; font-weight:600; border-radius:9px; text-align:center;}
.afm-feat li::before{content:""; position:absolute; left:0; top:3px; width:16px; height:16px;
    border-radius:50%; background:var(--afm-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/12px no-repeat;}

/* ---------- Progress steps ---------- */
.afm-steps{display:flex; align-items:center; margin:6px 0 18px;}
.afm-steps i{flex:1; height:2px; background:var(--afm-line); margin:0 6px;}
.afm-dot{width:26px; height:26px; border-radius:50%; background:#fff; border:1.5px solid #D8DEE6;
    color:#A4AFBB; display:flex; align-items:center; justify-content:center; font-size:13px; flex:0 0 auto;}
.afm-dot.afm-on{background:var(--afm-blue); border-color:var(--afm-blue); color:#fff;}

/* ---------- Form ---------- */
.afm-h2{font-size:18px; font-weight:600; margin:0 0 2px;}
.afm-sub{font-size:13px; color:var(--afm-muted); margin:0 0 18px; line-height:1.5;}
.afm-row{display:flex; gap:10px;}
.afm-row .afm-field{flex:1;}
.afm-field{margin-bottom:12px;}
.afm-field label{display:block; font-size:12px; color:var(--afm-muted); margin-bottom:5px;}
.afm-field input{width:100%; height:42px; border:1px solid #D8DEE6; border-radius:9px; padding:0 12px;
    font-size:14px; color:var(--afm-ink); background:#fff; outline:none; transition:border-color .15s;}
.afm-field input:focus{border-color:var(--afm-blue);}
.afm-phone{display:flex; align-items:center; border:1px solid #D8DEE6; border-radius:9px; overflow:hidden; height:42px;}
.afm-phone:focus-within{border-color:var(--afm-blue);}
.afm-prefix{padding:0 12px; font-size:14px; background:var(--afm-bg); border-right:1px solid #D8DEE6; line-height:42px;}
.afm-phone input{flex:1; height:40px; border:none; outline:none; padding:0 12px; font-size:14px; color:var(--afm-ink);}
.afm-hint{font-size:11px; color:var(--afm-soft); margin-top:6px;}
.afm-err{background:#FCEDED; border:1px solid #F1B5B5; color:#9A2B2B; font-size:13px; padding:9px 12px; border-radius:9px; margin:6px 0 12px;}

/* ---------- Bottoni ---------- */
.afm-btn{width:100%; height:48px; background:var(--afm-blue); color:#fff; border:none; border-radius:11px;
    font-size:15px; font-weight:600; cursor:pointer; margin-top:6px; transition:background .15s, transform .05s;}
.afm-btn:hover{background:var(--afm-blue-d);}
.afm-btn:active{transform:scale(.99);}
.afm-btn[disabled]{opacity:.6; cursor:default;}
.afm-link{display:block; width:100%; background:none; border:none; color:var(--afm-blue); font-size:13px;
    cursor:pointer; margin-top:12px; text-align:center;}
.afm-trust{text-align:center; margin-top:14px; font-size:12px; color:var(--afm-soft);}

/* ---------- Licenza ---------- */
.afm-check{margin:4px auto 10px; width:46px; height:46px;}
.afm-license{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:20px; font-weight:700;
    letter-spacing:1px; color:var(--afm-blue-d); background:#F3F8FC; border:1px dashed var(--afm-blue);
    border-radius:11px; padding:14px; margin:8px 0; word-break:break-all;}
.afm-stores{display:flex; gap:10px; justify-content:center; margin:18px 0 6px;}
.afm-store{flex:1; max-width:160px; text-decoration:none; text-align:center; padding:11px 0; border-radius:10px;
    background:var(--afm-ink); color:#fff; font-size:14px; font-weight:600;}

/* ---------- Desktop ---------- */
@media (min-width:860px){
    .afm-wrap{max-width:520px; padding-bottom:48px;}
    .afm-header{padding:24px 4px 26px;}
    .afm-wordmark .afm-name{font-size:24px;}
    .afm-trilly{width:62px; height:62px;}
    .afm-head-logo{height:52px;}
    .afm-head-video{width:54px; height:54px;}
    .afm-screen[data-screen="riepilogo"],
    .afm-screen[data-screen="dati"],
    .afm-screen[data-screen="licenza"]{max-width:460px; margin:0 auto;}
}

/* ---------- Dati per la fattura ---------- */
.afm-fiscal-head{margin:22px 0 2px; font-size:15px; font-weight:600; color:var(--afm-ink);
    padding-top:16px; border-top:1px solid var(--afm-line);}
.afm-fiscal-sub{margin:0 0 14px;}
#afm-cf{text-transform:uppercase; letter-spacing:.5px;}
.afm-field-comune{position:relative; flex:1.6;}
.afm-field-cap{flex:1;}
#afm-provincia{background:#F4F6F8; color:var(--afm-ink); font-weight:600;}
.afm-ac{position:absolute; left:0; right:0; top:calc(100% + 4px); z-index:30;
    background:#fff; border:1px solid #D8DEE6; border-radius:10px; box-shadow:0 8px 24px rgba(20,40,70,.12);
    max-height:230px; overflow-y:auto;}
.afm-ac-item{display:flex; justify-content:space-between; align-items:center; gap:10px;
    padding:10px 12px; cursor:pointer; font-size:14px; color:var(--afm-ink);}
.afm-ac-item:hover{background:#EEF4FB;}
.afm-ac-item em{font-style:normal; font-size:12px; font-weight:600; color:var(--afm-blue);
    background:#EAF1FA; border-radius:5px; padding:1px 7px;}

/* ---------- Crea password (schermata licenza) ---------- */
.afm-pwbox{margin:20px 0 6px; padding:16px; text-align:left;
    border:1px solid var(--afm-line); border-radius:14px; background:#FAFCFE;}
.afm-pwhead{font-size:15px; font-weight:600; color:var(--afm-ink); margin-bottom:2px;}
.afm-pwbox .afm-sub{margin-bottom:12px;}
.afm-pwbox .afm-btn{margin-top:4px;}
