/* valeriopex · demo della pagina "Consulente SEO e AI" (prefisso .sa-).
   Check "pronto per i motori AI" + simulazione dichiarata di una risposta AI con le fonti e di una pagina di risultati. */

/* ---- check: domande sì / no / non so ------------------------------------- */
.sa-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.9rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line-d); }
.sa-head__p { font-size: 0.82rem; color: var(--ink-soft); white-space: nowrap; }
.sa-head__p b { color: var(--ink); font: 700 1rem/1 var(--font-display); }
.sa-head__bar { height: 6px; border-radius: 6px; background: rgb(255 255 255 / 0.08); overflow: hidden; }
.sa-head__bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width 400ms var(--ease-out); }
.sa-ex { padding: 0.45rem 0.75rem; border-radius: 999px; border: 0; background: rgb(255 255 255 / 0.06); box-shadow: inset 0 0 0 1px var(--line-d); color: var(--ink); font: 500 0.76rem/1 var(--font-text); cursor: pointer; }
.sa-ex:hover { box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / 0.6); }
.sa-ex:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.sa-g { margin-top: 1.1rem; }
.sa-g__h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.2rem 0.6rem; margin-bottom: 0.5rem; }
.sa-g__h span { font: 600 0.66rem/1 var(--font-label); letter-spacing: 0.1em; color: var(--accent); }
.sa-g__h b { font: 700 1.02rem/1.2 var(--font-display); letter-spacing: -0.01em; }
.sa-g__h small { font-size: 0.78rem; color: var(--ink-soft); }

.sa-q { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.5rem 1rem; margin: 0; padding: 0.7rem 0.8rem; border: 0; border-radius: 12px; background: rgb(255 255 255 / 0.025); transition: background 200ms; }
.sa-q + .sa-q { margin-top: 0.35rem; }
.sa-q__t { float: left; padding: 0; font-size: 0.88rem; line-height: 1.38; color: var(--ink); }
.sa-q__t small { display: block; margin-top: 0.2rem; font-size: 0.74rem; line-height: 1.35; color: var(--ink-soft); }
.sa-q__o { display: inline-flex; gap: 0.25rem; padding: 0.2rem; border-radius: 999px; background: rgb(0 0 0 / 0.35); box-shadow: inset 0 0 0 1px var(--line-d); }
.sa-o { position: relative; cursor: pointer; }
.sa-o input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sa-o span { display: block; padding: 0.42rem 0.62rem; border-radius: 999px; font: 600 0.74rem/1 var(--font-text); color: var(--ink-soft); white-space: nowrap; transition: background 160ms, color 160ms; }
.sa-o:hover span { color: var(--ink); }
.sa-o input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.sa-o--si input:checked + span { background: var(--accent); color: #0A0A0A; }
.sa-o--no input:checked + span { background: var(--bad); color: #0A0A0A; }
.sa-o--ns input:checked + span { background: var(--warn); color: #0A0A0A; }
.sa-q.is-si { background: rgb(var(--accent-rgb) / 0.05); }
.sa-q.is-no { background: rgb(255 107 91 / 0.06); }
.sa-q.is-ns { background: rgb(255 194 61 / 0.05); }

/* risultato */
.sa-res { margin-top: 1.2rem; }
.sa-res__k { font: 600 0.62rem/1 var(--font-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.sa-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.25rem; margin-bottom: 0.8rem; }
.sa-big .sa-score { font: 800 2.4rem/1 var(--font-display); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.sa-big span { font: 600 0.95rem/1 var(--font-display); color: var(--ink-soft); }
.sa-big small { flex-basis: 100%; margin-top: 0.3rem; font: 600 0.6rem/1 var(--font-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.sa-res.is-ok .sa-score { color: var(--accent); } .sa-res.is-mid .sa-score { color: var(--warn); } .sa-res.is-bad .sa-score { color: var(--bad); }
.sa-pil { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; }
.sa-pil li { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 0.6rem; font-size: 0.8rem; color: var(--ink-soft); }
.sa-pil b { font: 700 0.86rem/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.sa-pil i { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: rgb(255 255 255 / 0.08); overflow: hidden; }
.sa-pil em { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--bad); transition: width 500ms var(--ease-out), background 300ms; }
.sa-pil .is-mid em { background: var(--warn); }
.sa-pil .is-ok em { background: var(--accent); }
.sa-res .dm__verdict { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--line-d); }
.sa-res.is-wait .dm__verdict b { color: var(--ink); font-weight: 600; }
.sa-res.is-wait .sa-pri { display: none; }
.sa-pri { margin-top: 0.8rem; font: 600 0.62rem/1 var(--font-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.sa-res .dm__verdict ol { margin-top: 0.45rem; }
.sa-chips:empty { display: none; }
.sa-c { position: relative; padding-left: 1.3rem !important; }
.sa-c::before { content: ""; position: absolute; left: 0.45rem; top: 50%; width: 0.45rem; height: 0.45rem; margin-top: -0.225rem; border-radius: 50%; }
.sa-c--si::before { background: var(--accent); }
.sa-c--no::before { background: var(--bad); }
.sa-c--ns::before { background: var(--warn); }

/* ---- simulazione ----------------------------------------------------------- */
.sa-sim { font-size: 0.88rem; }
.sa-tabs { display: inline-flex; gap: 0.25rem; margin: 0.9rem 0 0.9rem; padding: 0.22rem; border-radius: 999px; background: rgb(0 0 0 / 0.35); box-shadow: inset 0 0 0 1px var(--line-d); }
.sa-tabs button { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.5rem 0.85rem; border: 0; border-radius: 999px; background: none; color: var(--ink-soft); font: 600 0.78rem/1 var(--font-text); cursor: pointer; }
.sa-tabs button[aria-selected="true"] { background: #F4F4F0; color: #0A0A0A; }
.sa-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sa-ico { width: 0.9rem; height: 0.9rem; flex: none; border: 1.6px solid currentColor; }
.sa-ico--chat { border-radius: 50% 50% 50% 2px; }
.sa-ico--serp { border-radius: 50%; position: relative; }
.sa-ico--serp::after { content: ""; position: absolute; right: -0.32rem; bottom: -0.28rem; width: 0.38rem; height: 1.6px; background: currentColor; transform: rotate(45deg); }

.sa-views { display: grid; }
.sa-view { grid-area: 1 / 1; min-width: 0; opacity: 0; visibility: hidden; transition: opacity 400ms var(--ease-out), visibility 0s 400ms; }
.sa-view.is-on { opacity: 1; visibility: visible; transition: opacity 400ms var(--ease-out); }

/* chat */
.sa-chat { padding: 1rem; border-radius: 16px; background: rgb(0 0 0 / 0.35); box-shadow: inset 0 0 0 1px var(--line-d); }
.sa-user { margin-left: auto; width: fit-content; max-width: 85%; padding: 0.6rem 0.85rem; border-radius: 16px 16px 4px 16px; background: #2a2c27; color: var(--ink); line-height: 1.45; }
.sa-bot { display: grid; grid-template-columns: 1.7rem 1fr; gap: 0.7rem; margin-top: 0.9rem; }
.sa-av { width: 1.7rem; height: 1.7rem; border-radius: 50%; background: conic-gradient(from 45deg, var(--accent), #8FB4FF, var(--accent)); position: relative; }
.sa-av::after { content: ""; position: absolute; inset: 0.42rem; border-radius: 50%; background: #121311; }
.sa-ans { line-height: 1.55; color: #E8E8E2; }
.sa-ans p + p, .sa-ans ol + p { margin-top: 0.55rem; }
.sa-ans__ol { margin: 0.45rem 0 0; padding-left: 1.15rem; display: grid; gap: 0.35rem; }
.sa-w { opacity: 0; transition: opacity 180ms; }
.sa-w.is-on { opacity: 1; }
.sa-brand { font-weight: 700; color: var(--ink); }
.sa-brand.is-me { background: rgb(var(--accent-rgb) / 0.16); box-shadow: 0 0 0 2px rgb(var(--accent-rgb) / 0.16); border-radius: 4px; }
.sa-cite { display: inline-grid; place-items: center; min-width: 1.15rem; height: 1.15rem; margin-left: 0.1rem; padding: 0 0.25rem; border-radius: 6px; background: rgb(255 255 255 / 0.12); color: var(--ink); font: 700 0.62rem/1 var(--font-label); vertical-align: 0.3em; }
.sa-cite[data-n="1"] { background: var(--accent); color: #0A0A0A; }
.sa-w.is-on .sa-cite { animation: sapop 420ms cubic-bezier(.34,1.6,.64,1); }
@keyframes sapop { 0% { transform: scale(0.3); } 100% { transform: none; } }

.sa-srcs { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px solid var(--line-d); opacity: 0; transform: translateY(8px); transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); }
.sa-chat.is-src .sa-srcs { opacity: 1; transform: none; }
.sa-srcs__k, .sa-why p { font: 600 0.6rem/1 var(--font-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.sa-srcs ol { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
.sa-srcs li { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 0.45rem; align-items: start; padding: 0.55rem 0.6rem; border-radius: 10px; background: rgb(255 255 255 / 0.04); box-shadow: inset 0 0 0 1px var(--line-d); }
.sa-srcs li b { display: block; font-size: 0.74rem; line-height: 1.2; }
.sa-srcs li small { display: block; margin-top: 0.15rem; font-size: 0.68rem; line-height: 1.3; color: var(--ink-soft); }
.sa-srcs li em { position: absolute; top: -0.4rem; right: -0.3rem; width: 1.1rem; height: 1.1rem; border-radius: 6px; display: grid; place-items: center; background: #2a2c27; font: 700 0.6rem/1 var(--font-label); font-style: normal; }
.sa-srcs li.is-me { box-shadow: inset 0 0 0 1.5px var(--accent); }
.sa-srcs li.is-me em { background: var(--accent); color: #0A0A0A; }
.sa-fav { flex: none; width: 1.25rem; height: 1.25rem; border-radius: 50%; display: inline-grid; place-items: center; background: #3a3c36; color: var(--ink); font: 700 0.6rem/1 var(--font-label); }
.is-me > .sa-fav, .is-me .sa-fav { background: var(--accent); color: #0A0A0A; }

.sa-why { margin-top: 0.8rem; padding: 0.75rem 0.8rem; border-radius: 12px; border: 1.5px dashed rgb(var(--accent-rgb) / 0.5); opacity: 0; transform: translateY(8px); transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); }
.sa-chat.is-why .sa-why { opacity: 1; transform: none; }
.sa-why p { color: var(--accent); }
.sa-why ul { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.35rem; }
.sa-why li { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; font-size: 0.8rem; line-height: 1.35; color: #E8E8E2; }
.sa-why li span::before { content: "✓"; margin-right: 0.45rem; color: var(--accent); font-weight: 700; }
.sa-why li em { flex: none; padding: 0.2rem 0.45rem; border-radius: 999px; background: rgb(255 255 255 / 0.06); font: 600 0.58rem/1 var(--font-label); letter-spacing: 0.08em; text-transform: uppercase; font-style: normal; color: var(--ink-soft); }

/* pagina dei risultati con il riepilogo AI in alto */
.sa-serp { position: relative; padding: 1rem; border-radius: 16px; background: #F7F7F3; color: #1b1c18; }
.sa-sq { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.9rem; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.1), 0 6px 18px -12px rgb(0 0 0 / 0.5); }
.sa-sq__lens { position: relative; width: 0.85rem; height: 0.85rem; border: 2px solid #6b6d63; border-radius: 50%; flex: none; }
.sa-sq__lens::after { content: ""; position: absolute; right: -0.35rem; bottom: -0.3rem; width: 0.4rem; height: 2px; background: #6b6d63; transform: rotate(45deg); }
.sa-sq__t { font-size: 0.86rem; }
.sa-ai { margin-top: 0.8rem; padding: 0.85rem 0.9rem; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08); }
.sa-ai__k { display: flex; align-items: center; gap: 0.45rem; font: 700 0.8rem/1 var(--font-display); }
.sa-spark { width: 0.9rem; height: 0.9rem; background: linear-gradient(135deg, #7aa7ff, #9a7bff 50%, #4fbf8f); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.sa-ai__g { display: grid; grid-template-columns: minmax(0, 1fr) 11.5rem; gap: 0.8rem; margin-top: 0.65rem; }
.sa-ai__txt { position: relative; display: grid; }
.sa-skel, .sa-ai__p { grid-area: 1 / 1; }
.sa-skel { display: grid; gap: 0.5rem; align-content: start; transition: opacity 300ms; }
.sa-skel i { height: 0.7rem; border-radius: 6px; background: linear-gradient(90deg, #ecebe5 0%, #dcdbd3 40%, #ecebe5 80%) 0 0 / 200% 100%; animation: sashim 1.1s linear infinite; }
.sa-skel i:nth-child(2) { width: 92%; } .sa-skel i:nth-child(3) { width: 96%; } .sa-skel i:nth-child(4) { width: 60%; }
@keyframes sashim { to { background-position: -200% 0; } }
.sa-ai__p { font-size: 0.82rem; line-height: 1.55; color: #2a2c27; opacity: 0; transition: opacity 500ms; }
.sa-serp.is-load .sa-skel { opacity: 0; }
.sa-serp.is-load .sa-ai__p { opacity: 1; }
.sa-serp .sa-brand { color: #11120F; }
.sa-serp .sa-brand.is-me { background: #DDF7A0; box-shadow: 0 0 0 2px #DDF7A0; }
.sa-serp .sa-cite { background: #e3e2da; color: #11120F; }
.sa-serp .sa-cite[data-n="1"] { background: #11120F; color: var(--accent); }
.sa-ai__src { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; align-content: start; }
.sa-ai__src li { display: grid; grid-template-columns: auto 1fr; gap: 0.45rem; padding: 0.45rem 0.5rem; border-radius: 10px; background: #F3F2EC; opacity: 0; transform: translateX(8px); transition: opacity 400ms, transform 400ms var(--ease-out), box-shadow 400ms; }
.sa-ai__src li:nth-child(2) { transition-delay: 120ms; } .sa-ai__src li:nth-child(3) { transition-delay: 240ms; }
.sa-serp.is-load .sa-ai__src li { opacity: 1; transform: none; }
.sa-ai__src b { display: block; font-size: 0.7rem; line-height: 1.25; }
.sa-ai__src small { display: block; margin-top: 0.1rem; font-size: 0.64rem; color: #55574F; }
.sa-serp .sa-fav { background: #d9d8cf; color: #11120F; }
.sa-serp .is-me .sa-fav { background: #11120F; color: var(--accent); }
.sa-serp.is-done .sa-ai__src li.is-me { box-shadow: 0 0 0 2px #11120F; }
.sa-res2 { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.2rem; }
.sa-res2 li { position: relative; padding: 0.6rem 0.4rem; border-radius: 10px; transition: background 500ms, box-shadow 500ms; }
.sa-res2 li + li { border-top: 1px solid rgb(0 0 0 / 0.07); }
.sa-res2 small { display: flex; align-items: center; gap: 0.4rem; font-size: 0.68rem; color: #55574F; }
.sa-res2 small .sa-fav { width: 1rem; height: 1rem; font-size: 0.52rem; }
.sa-res2 b { display: block; margin-top: 0.25rem; font: 600 0.9rem/1.25 var(--font-display); color: #1f3fa0; }
.sa-res2 p { margin-top: 0.2rem; font-size: 0.76rem; line-height: 1.45; color: #55574F; }
.sa-serp.is-done .sa-res2 li.is-me { background: #fff; box-shadow: 0 0 0 2px #11120F; }
.sa-tag-me { position: absolute; right: 0.6rem; top: -0.75rem; z-index: 1; padding: 0.35rem 0.6rem; background: var(--accent); color: #0A0A0A; font: 700 0.6rem/1 var(--font-label); letter-spacing: 0.1em; text-transform: uppercase; transform: rotate(-3deg) scale(0.6); opacity: 0; transition: opacity 400ms 300ms, transform 500ms 300ms cubic-bezier(.34,1.6,.64,1); box-shadow: 0 8px 18px -10px rgb(0 0 0 / 0.6); }
.sa-serp.is-done .sa-tag-me { opacity: 1; transform: rotate(-3deg); }

.sa-sim__note { margin-top: 0.9rem; font-size: 0.76rem; line-height: 1.4; color: var(--ink-soft); }
@media (min-width: 1101px) { .demo-grid > .sa-simp { position: sticky; top: 5.5rem; } }

/* ---- prova: i file di questo sito ----------------------------------------- */
.sa-files { position: relative; display: grid; gap: 0.8rem; }
.sa-file { margin: 0; border-radius: 16px; overflow: hidden; background: #0b0c0a; box-shadow: inset 0 0 0 1px var(--line-d), 0 40px 80px -40px rgb(0 0 0 / 0.9); }
.sa-file:nth-child(2) { margin-left: clamp(0rem, 4vw, 2.4rem); }
.sa-file:nth-child(3) { margin-left: clamp(0rem, 8vw, 4.8rem); }
.sa-file__h { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.9rem; background: #151613; border-bottom: 1px solid var(--line-d); font: 600 0.72rem/1 var(--font-label); color: var(--ink-soft); }
.sa-file__h::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); box-shadow: 0.8rem 0 0 rgb(255 255 255 / 0.18), 1.6rem 0 0 rgb(255 255 255 / 0.18); margin-right: 1.8rem; }
.sa-file__h a { margin-left: auto; color: var(--accent); text-decoration: none; }
.sa-file__h a:hover { text-decoration: underline; }
.sa-file pre { margin: 0; padding: 0.85rem 1rem; overflow-x: auto; font: 500 0.76rem/1.6 ui-monospace, "SF Mono", Menlo, monospace; color: #cfd0c8; white-space: pre-wrap; word-break: break-word; }
.sa-file .k { color: var(--accent); }
.sa-file .s { color: #8FB4FF; }
.sa-file .c { color: #7d7f76; }

@media (max-width: 560px) {
  .sa-head { grid-template-columns: auto 1fr; }
  .sa-ex { grid-column: 1 / -1; justify-self: start; }
  .sa-q { grid-template-columns: 1fr; }
  .sa-q__o { justify-self: start; }
  .sa-srcs ol { grid-template-columns: 1fr; }
  .sa-ai__g { grid-template-columns: 1fr; }
  .sa-why li { flex-direction: column; gap: 0.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sa-w { opacity: 1; }
  .sa-skel i { animation: none; }
}
