/* ==========================================================================
   Aimek — estimateur et assistant.
   Feuille chargée uniquement là où ces composants sont utilisés.
   Reprend les tokens de main.css : aucune couleur ni graisse n'est réinventée.
   ========================================================================== */

/* ---------- Estimateur ---------- */
.estimator{max-width:760px;margin-inline:auto}
.est-head{margin-bottom:26px}
.est-progress{height:4px;border-radius:2px;background:var(--line);overflow:hidden}
.est-progress span{display:block;height:100%;background:var(--accent);border-radius:2px;transition:width .45s cubic-bezier(.22,.61,.36,1)}
.est-count{margin:10px 0 0;font-family:var(--mono);font-size:.74rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}

.est-card{background:var(--white);border:1px solid var(--line);border-radius:var(--radius);padding:clamp(24px,4vw,40px);box-shadow:var(--shadow)}
.est-title{font-size:clamp(1.35rem,2.6vw,1.85rem);margin-bottom:.3em}
.est-help{color:var(--muted);margin:0 0 26px;font-size:.98rem}

.est-options{display:grid;gap:12px}
@media (min-width:620px){
	.est-options{grid-template-columns:1fr 1fr}
	.est-options--dense{grid-template-columns:1fr 1fr}
}
.est-option{display:flex;align-items:center;gap:14px;width:100%;text-align:left;padding:16px 18px;background:var(--paper);border:1.5px solid var(--line);border-radius:var(--radius-sm);font:inherit;color:var(--ink);cursor:pointer;transition:border-color .16s,background-color .16s,transform .16s}
.est-option:hover{border-color:var(--ink);background:var(--white)}
.est-option:active{transform:scale(.99)}
.est-option.is-selected{border-color:var(--accent);background:var(--accent-soft);box-shadow:0 0 0 1px var(--accent)}
.est-option-icon{flex:none;display:grid;place-items:center;width:44px;height:44px;border-radius:11px;background:var(--white);border:1px solid var(--line);color:var(--accent)}
.est-option.is-selected .est-option-icon{background:var(--accent);border-color:var(--accent);color:#fff}
/* Logo de plateforme : dans sa couleur, puis en blanc une fois choisi. */
.est-option-icon--logo .platform-logo--woocommerce{transform:scale(1.35)}
.est-option.is-selected .est-option-icon--logo .platform-logo{color:#fff}
.est-option-body{display:flex;flex-direction:column;gap:2px;min-width:0}
.est-option-body strong{font-weight:620;font-size:1rem;line-height:1.3}
.est-option-body span{font-size:.87rem;color:var(--muted);line-height:1.4}
.est-check{flex:none;margin-left:auto;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;border:1.5px solid var(--line);color:transparent;transition:.16s}
.est-option.is-selected .est-check{background:var(--accent);border-color:var(--accent);color:#fff}
.est-next{margin-top:24px}
.est-back{display:inline-block;margin-top:18px;padding:8px 4px;background:none;border:0;font:inherit;font-size:.92rem;color:var(--muted);cursor:pointer}
.est-back:hover{color:var(--ink);text-decoration:underline}

/* Résultat */
/* Le resultat vit dans le formulaire de contact : on annule le padding
   herite pour ne pas empiler deux cartes et deborder sur mobile. */
.est-result{margin:0 0 28px;min-width:0}
.est-contact{min-width:0}
.est-loading{color:var(--muted);text-align:center;padding:30px 0;margin:0}
.est-price-card{background:var(--ink);color:var(--paper);border-radius:var(--radius);padding:clamp(24px,4vw,34px);text-align:center;position:relative;overflow:hidden}
.est-price-card::after{content:"";position:absolute;right:-70px;top:-70px;width:230px;height:230px;border-radius:50%;background:var(--accent);opacity:.2}
.est-price-card>*{position:relative;z-index:1}
.est-price-label{font-family:var(--mono);font-size:.72rem;letter-spacing:.09em;text-transform:uppercase;color:#c7d2fe;margin:0 0 12px}
.est-project{margin:0 0 6px;font-size:1.05rem;color:var(--muted-dark)}
.est-price{margin:0;font-size:clamp(1.75rem,7vw,3rem);font-weight:700;letter-spacing:-.03em;line-height:1.15;color:#fff;overflow-wrap:anywhere;text-wrap:balance}
.est-price-note{margin:16px 0 0;font-size:.86rem;color:var(--muted-dark);max-width:44ch;margin-inline:auto}

.est-sub{font-family:var(--mono);font-size:.72rem;letter-spacing:.09em;text-transform:uppercase;color:var(--muted);margin:28px 0 14px}
.est-includes .checklist li{font-size:.97rem}
.est-caveats{margin-top:22px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--paper);padding:14px 18px}
.est-caveats summary{cursor:pointer;font-weight:600;font-size:.95rem}
.est-caveats ul{margin:12px 0 4px;padding-left:1.2em;color:var(--muted);font-size:.93rem}
.est-caveats li{margin-bottom:.3em}
/* Les boutons du site sont en nowrap (utile dans l'en-tete). Dans une colonne
   etroite, un libelle long elargirait alors toute la page : ici on autorise le repli. */
.est-actions .btn-row{margin-top:0}
.est-actions .btn{white-space:normal;text-align:center;max-width:100%}
@media (max-width:560px){
	.est-actions .btn-row{flex-direction:column}
	.est-actions .btn{width:100%}
}

/* Sur la page de l'estimateur, la barre d'action mobile proposerait d'aller
   la ou l'on est deja : on la retire pour liberer l'ecran. */
body.page-estimation .mobile-bar{display:none}

/* Sur la page de l'estimateur, l'objectif est la premiere question, pas la promesse.
   Sur mobile, l'en-tete est donc resserre pour rapprocher le parcours du haut
   de l'ecran : le visiteur a clique pour estimer, pas pour relire l'accroche. */
@media (max-width:720px){
	body.page-estimation .section-hero{padding-block:18px 22px}
	body.page-estimation .section-hero h1{font-size:1.62rem;line-height:1.15;margin-bottom:.35em}
	body.page-estimation .section-hero .lead{font-size:.95rem;line-height:1.5;margin-top:0}
	body.page-estimation .hero-proof{gap:6px 16px;margin-top:16px;font-size:.82rem}
	body.page-estimation .section-estimator{padding-block:8px 40px}
	body.page-estimation .breadcrumbs{padding-top:12px}
}
body.page-estimation .site-footer{padding-bottom:28px}
.est-or{margin:16px 0 0;font-size:.88rem;color:var(--muted);text-align:center}
.est-links{margin-top:26px;padding-top:22px;border-top:1px solid var(--line)}
.est-links a{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;color:var(--ink);text-decoration:none;border-bottom:1px solid var(--line);font-weight:520}
.est-links a:last-child{border-bottom:0}
.est-links a:hover{color:var(--accent)}
/* Le formulaire de contact est deja dans .est-card : sans cette regle, les deux
   paddings se cumulent et volent pres de 100px de largeur utile sur mobile. */
.est-card .aimek-form{padding:0;border:0;background:none;box-shadow:none;border-radius:0}
.est-contact .field{margin-bottom:2px}

/* ---------- Assistant ---------- */
.chat-launcher{position:fixed;right:24px;bottom:94px;z-index:95;display:grid;place-items:center;width:54px;height:54px;padding:0;border:0;border-radius:50%;background:var(--ink);color:#fff;font:inherit;font-size:.88rem;font-weight:600;cursor:pointer;box-shadow:0 14px 30px -12px rgba(11,16,32,.6);transition:transform .2s var(--ease),background-color .2s}
.chat-launcher:hover{transform:translateY(-2px) scale(1.04);background:var(--ink-3)}
.chat-launcher-icon{display:grid;place-items:center}
/* Le libellé devient une info-bulle au survol : il n'occupe plus l'écran. */
.chat-launcher-text{position:absolute;right:calc(100% + 12px);top:50%;padding:8px 13px;border-radius:10px;background:var(--ink);color:#fff;white-space:nowrap;box-shadow:var(--shadow);opacity:0;transform:translate(6px,-50%);pointer-events:none;transition:opacity .2s,transform .2s var(--ease)}
.chat-launcher:hover .chat-launcher-text,.chat-launcher:focus-visible .chat-launcher-text{opacity:1;transform:translate(0,-50%)}
.js-chat.is-open .chat-launcher{display:none}
/* Le panneau n'est construit qu'une fois : c'est cette règle, et elle seule,
   qui l'affiche et le masque. Sans elle, le bouton « Fermer » retire bien la
   classe mais ne referme rien. */
.js-chat.is-open .chat-panel{display:flex}
@media (max-width:899px){
	.chat-launcher{right:14px;bottom:80px;width:50px;height:50px}
	.chat-launcher-text{display:none}
}

.chat-panel{position:fixed;right:22px;bottom:22px;z-index:130;display:none;flex-direction:column;width:min(400px,calc(100vw - 44px));height:min(620px,calc(100vh - 120px));background:var(--paper);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow-lg);overflow:hidden;animation:chat-in .24s cubic-bezier(.22,.61,.36,1)}
@keyframes chat-in{from{opacity:0;transform:translateY(16px) scale(.98)}to{opacity:1;transform:none}}
.chat-head{display:flex;align-items:flex-start;gap:12px;padding:18px 18px 14px;background:var(--ink);color:var(--paper)}
.chat-title{margin:0;font-weight:650;font-size:1rem;color:#fff}
.chat-sub{margin:3px 0 0;font-size:.78rem;color:var(--muted-dark);line-height:1.35}
.chat-close{margin-left:auto;flex:none;display:grid;place-items:center;width:32px;height:32px;border:0;border-radius:50%;background:rgba(255,255,255,.1);color:#fff;cursor:pointer}
.chat-close:hover{background:rgba(255,255,255,.2)}

.chat-log{flex:1;overflow-y:auto;padding:18px;display:flex;flex-direction:column;gap:12px;scroll-behavior:smooth;overscroll-behavior:contain}
.chat-msg{display:flex}
.chat-msg--me{justify-content:flex-end}
.chat-bubble{max-width:86%;padding:12px 15px;border-radius:16px;font-size:.94rem;line-height:1.55}
.chat-msg--bot .chat-bubble{background:var(--white);border:1px solid var(--line);border-bottom-left-radius:5px}
.chat-msg--me .chat-bubble{background:var(--ink);color:var(--paper);border-bottom-right-radius:5px}
.chat-typing{display:flex;gap:4px;align-items:center;padding:14px 16px}
.chat-typing span{width:6px;height:6px;border-radius:50%;background:var(--muted);animation:chat-dot 1.2s infinite}
.chat-typing span:nth-child(2){animation-delay:.18s}
.chat-typing span:nth-child(3){animation-delay:.36s}
@keyframes chat-dot{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}

.chat-chips{display:flex;flex-wrap:wrap;gap:7px}
.chat-chip{padding:8px 13px;border:1px solid var(--line);border-radius:999px;background:var(--white);font:inherit;font-size:.86rem;color:var(--ink);cursor:pointer;transition:.15s}
.chat-chip:hover{border-color:var(--ink);background:var(--paper-2)}
.chat-actions{display:flex;flex-direction:column;gap:8px;align-items:flex-start;padding-left:2px}
.chat-actions .btn{width:100%;justify-content:center}
.chat-link{display:inline-flex;align-items:center;gap:6px;font-size:.87rem;color:var(--accent);text-decoration:none;font-weight:520}
.chat-link:hover{text-decoration:underline}

.chat-form{display:flex;gap:8px;padding:12px;border-top:1px solid var(--line);background:var(--white)}
.chat-form input{flex:1;min-width:0;min-height:44px;padding:10px 14px;border:1.5px solid var(--line);border-radius:999px;background:var(--paper);font:inherit;font-size:.94rem;color:var(--ink)}
.chat-form input:focus{outline:0;border-color:var(--ink);background:var(--white)}
.chat-send{flex:none;display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:var(--accent);color:#fff;cursor:pointer;transition:background-color .15s}
.chat-send:hover{background:var(--accent-hover)}

/* Sur mobile, l'assistant occupe tout l'écran : saisie confortable et clavier géré. */
@media (max-width:720px){
	.chat-panel{right:0;bottom:0;left:0;width:100%;height:100dvh;max-height:100dvh;border-radius:0;border:0}
	.chat-head{padding-top:max(18px,env(safe-area-inset-top))}
	.chat-form{padding-bottom:max(12px,env(safe-area-inset-bottom))}
	.chat-bubble{max-width:90%}
}
html.chat-open{overflow:hidden}
@media (min-width:721px){html.chat-open{overflow:auto}}

/* ---------- Offres ---------- */
.offers{display:grid;gap:18px}
@media (min-width:640px){.offers{grid-template-columns:1fr 1fr}}
@media (min-width:1000px){.offers{grid-template-columns:repeat(3,1fr)}}
.offer{position:relative;display:flex;flex-direction:column;background:var(--white);border:1px solid var(--line);border-radius:var(--radius-lg);padding:28px;box-shadow:var(--shadow-sm);transition:border-color .25s,box-shadow .3s var(--ease),transform .3s var(--ease)}
.offer:hover{border-color:var(--line-2);box-shadow:var(--shadow-lg);transform:translateY(-4px)}
.offer-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:22px}
.offer-icon{display:grid;place-items:center;width:52px;height:52px;border-radius:15px;background:var(--accent-soft);color:var(--accent)}
.offer--shopify .offer-icon{background:#eef6e2;color:#5e8e3e}
.offer--woocommerce .offer-icon{background:#f2ecfa;color:#7f54b3}
.offer--prestashop .offer-icon{background:#fde9f2;color:#c3005a}
.offer-badge{padding:5px 11px;border-radius:999px;background:var(--grad);color:#fff;font-family:var(--mono);font-size:.64rem;font-weight:600;letter-spacing:.09em;text-transform:uppercase}
.offer h3{margin:0 0 .4em;font-size:1.24rem}
.offer-text{font-size:.95rem;color:var(--muted);margin:0 0 24px}
.offer-price{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 8px;margin:auto 0 22px;padding-top:20px;border-top:1px dashed var(--line-2)}
.offer-price small{flex-basis:100%;font-size:.78rem;font-weight:550;color:var(--muted)}
.offer-price strong{font-family:var(--display);font-size:2.5rem;font-weight:800;line-height:1;letter-spacing:-.05em;color:var(--ink)}
.offer-price span{font-size:.84rem;font-weight:650;color:var(--muted)}
.offer-actions{display:flex;flex-direction:column;align-items:center;gap:14px}
.offer-actions .btn{width:100%;justify-content:center}
.offer--featured{background:var(--ink);border-color:var(--ink);color:#d5dbe8;background-image:radial-gradient(90% 70% at 100% 0%,rgba(99,102,241,.34),transparent 60%)}
.offer--featured:hover{border-color:var(--ink)}
.offer--featured h3,.offer--featured .offer-price strong{color:#fff}
.offer--featured .offer-text,.offer--featured .offer-price small,.offer--featured .offer-price span{color:var(--muted-dark)}
.offer--featured .offer-price{border-color:rgba(255,255,255,.16)}
.offer--featured .offer-icon{background:rgba(255,255,255,.08);color:var(--accent-on-dark)}
.offer--featured .link-arrow{color:#fff}
.offer--featured .link-arrow:hover{color:var(--accent-on-dark)}
.offer-note{max-width:72ch;margin:32px auto 0;padding:16px 22px;border:1px dashed var(--line-2);border-radius:var(--radius-sm);font-size:.93rem;color:var(--muted);text-align:center}

@media (prefers-reduced-motion:reduce){
	.est-progress span,.est-option,.offer,.chat-launcher{transition:none}
	.chat-panel{animation:none}
	.chat-typing span{animation:none;opacity:.5}
}

@media print{.chat-launcher,.chat-panel{display:none!important}}

/* Invitation discrète vers l'assistant : au-dessus de la pastille, sans voile,
   sans rien masquer. Le visiteur ferme d'un clic et continue sa lecture. */
.chat-teaser{position:fixed;right:24px;bottom:160px;z-index:96;width:min(330px,calc(100vw - 40px));padding:18px 18px 16px;border-radius:18px;background:var(--white);border:1px solid var(--line);box-shadow:0 22px 48px -18px rgba(11,16,32,.45);opacity:0;transform:translateY(10px) scale(.98);transition:opacity .25s var(--ease),transform .25s var(--ease)}
.chat-teaser.is-in{opacity:1;transform:none}
.chat-teaser-close{position:absolute;top:10px;right:10px;display:grid;place-items:center;width:28px;height:28px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--muted);cursor:pointer}
.chat-teaser-close:hover{background:var(--paper-2);color:var(--ink)}
.chat-teaser-title{margin:0 26px 6px 0;font-family:var(--display);font-size:1.02rem;font-weight:700;color:var(--ink)}
.chat-teaser-text{margin:0;font-size:.88rem;line-height:1.5;color:var(--muted)}
.chat-teaser-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.chat-teaser-chip{padding:6px 11px;border:1px solid var(--line-2);border-radius:999px;background:var(--paper);color:var(--ink);font:inherit;font-size:.79rem;cursor:pointer;transition:border-color .2s,background-color .2s}
.chat-teaser-chip:hover{border-color:var(--accent);background:var(--accent-soft)}
.chat-teaser-actions{display:flex;align-items:center;gap:10px;margin-top:14px}
.chat-teaser-go{flex:1;padding:9px 14px;border:0;border-radius:999px;background:var(--grad-btn);color:#fff;font:inherit;font-size:.88rem;font-weight:650;cursor:pointer}
.chat-teaser-go:hover{filter:brightness(1.06)}
.chat-teaser-later{padding:9px 6px;border:0;background:none;color:var(--muted);font:inherit;font-size:.84rem;cursor:pointer}
.chat-teaser-later:hover{color:var(--ink);text-decoration:underline}
.chat-open .chat-teaser{display:none}
@media (max-width:639px){.chat-teaser{right:12px;left:12px;bottom:150px;width:auto}}
