/* Simulatore SWOT per Google Ads (agenzia/simulatore-swot-google-ads.html, 22/11/2026).
   Si aggiunge a site.css e simulatori.css: tema del simulatore, hero con l'anteprima della matrice, campi, matrice
   SWOT, diagnosi e report. Le animazioni della hero partono solo con la classe is-anim (simulatore-swot.js) e senza
   prefers-reduced-motion: senza JavaScript, con il movimento ridotto e in stampa si vede subito lo stato finale.
   Effetti di comparsa e numeri che salgono: eccezione «wow» del titolare (.claude/rules/design.md). */

/* ---------- tema: petrolio (gli altri simulatori sono verde, ambra, blu Google e viola) ---------- */
.sim-t-swot { --a: #0e7490; --a-strong: #155e75; --a-hi: #22d3ee; --a-soft: #ecfeff; --a-ring: rgba(14, 116, 144, .22);
  --sw-s: #34d399; --sw-w: #f87171; --sw-o: #60a5fa; --sw-t: #fbbf24; }
.sim-t-swot .sim-out { --p-bg: #062a33; --p-line: rgba(34, 211, 238, .2); --p-card: rgba(34, 211, 238, .05); --p-acc: #22d3ee; }

/* ==========================================================================
   HERO: anteprima della matrice SWOT, con ROAS e linea di pareggio
   ========================================================================== */
.swh-hero .hero-split { align-items: center; }
.swh-hero .swh-nota { margin-top: 18px; max-width: 620px; font-size: 15px; color: var(--dark-text); }
.swh { position: relative; padding: clamp(14px, 2.4vw, 20px); border: 1px solid var(--dark-line); border-radius: var(--r-xl);
  background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .7); color: var(--dark-text); }
.swh-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; font: 600 12px/1.3 var(--mono); letter-spacing: .03em; color: var(--dark-muted); }
.swh-chip { padding: 3px 9px; border: 1px solid color-mix(in srgb, var(--a-hi) 45%, transparent); border-radius: 999px; color: var(--a-hi); }

.swh-roas { margin-top: 14px; padding: 14px 14px 10px; border: 1px solid var(--dark-line); border-radius: 16px; background: rgba(255, 255, 255, .04); }
.swh-roas-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 14px; }
.swh-roas-row > span { display: block; font-size: 12.5px; color: var(--dark-muted); }
.swh-num { display: block; font: 800 clamp(34px, 4.4vw, 46px)/1 var(--sans); letter-spacing: -.03em; color: #fff; font-variant-numeric: tabular-nums; }
.swh-kv { margin: 0; font-size: 13px; line-height: 1.5; text-align: right; color: var(--dark-text); }
.swh-kv b { color: #fff; font-variant-numeric: tabular-nums; }
.swh-kv .be { color: #fcd34d; }
.swh-track { position: relative; height: 12px; margin: 30px 0 8px; border-radius: 999px; background: rgba(255, 255, 255, .09); }
.swh-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 62.5%; border-radius: inherit; background: linear-gradient(90deg, var(--a), var(--a-hi)); transform-origin: left center; }
.swh-be { position: absolute; left: 50%; top: -9px; bottom: -9px; width: 0; border-left: 2px dashed #fbbf24; transform-origin: top center; }
.swh-be span { position: absolute; bottom: calc(100% + 4px); left: 0; transform: translateX(-50%); font: 700 10.5px/1 var(--mono); letter-spacing: .04em; color: #fcd34d; white-space: nowrap; }
.swh-scale { display: flex; justify-content: space-between; font: 600 10.5px/1 var(--mono); color: var(--dark-muted); }

/* matrice 2×2: righe fattori interni ed esterni, colonne a favore e contro */
.swh-matrix { display: grid; grid-template-columns: 16px repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.swh-ax { font: 700 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dark-muted); }
.swh-ax.col { padding-left: 4px; }
.swh-ax.row { display: grid; place-items: center; writing-mode: vertical-rl; transform: rotate(180deg); }
.swh-cell { --c: var(--sw-s); position: relative; padding: 11px 12px 12px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px;
  background: color-mix(in srgb, var(--c) 8%, transparent); transition: border-color .45s var(--ease), background-color .45s var(--ease), box-shadow .45s var(--ease); }
.swh-cell.w { --c: var(--sw-w); }
.swh-cell.o { --c: var(--sw-o); }
.swh-cell.t { --c: var(--sw-t); }
.swh-cell .l { float: right; font: 800 22px/1 var(--sans); color: var(--c); }
.swh-cell strong { display: block; font-size: 13.5px; line-height: 1.25; color: #fff; }
.swh-cell p { margin: 5px 0 9px; font-size: 12px; line-height: 1.4; color: var(--dark-text); }
.swh-dots { display: flex; gap: 4px; }
.swh-dots i { display: block; width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.swh-dots i.on { background: var(--c); }
.swh-cell.is-on { border-color: color-mix(in srgb, var(--c) 70%, transparent); background: color-mix(in srgb, var(--c) 17%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent), 0 12px 30px -14px color-mix(in srgb, var(--c) 70%, transparent); }
.swh-strat { margin: 12px 0 0; padding: 10px 12px; min-height: 4.1em; border: 1px dashed var(--dark-line); border-radius: 12px; background: rgba(255, 255, 255, .03); font-size: 13px; line-height: 1.45; color: var(--dark-text); }
.swh-strat b { margin-right: 6px; font-family: var(--mono); color: var(--a-hi); }
.swh-cap { margin: 12px 4px 0; font-size: 13px; line-height: 1.5; color: var(--dark-muted); }

/* ingresso: i quadranti si compongono, il ROAS sale, la linea di pareggio si disegna (solo con .is-anim) */
@media (prefers-reduced-motion: no-preference) {
  .swh.is-anim .swh-cell { animation: swh-in .7s var(--ease) both; animation-delay: calc(var(--k, 0) * 150ms + 250ms); }
  .swh.is-anim .swh-dots i.on { animation: swh-dot .4s var(--ease) both; animation-delay: calc(var(--k, 0) * 150ms + 650ms + var(--j, 0) * 90ms); }
  .swh.is-anim .swh-fill { animation: swh-grow 1.6s var(--ease) both .3s; }
  .swh.is-anim .swh-be { animation: swh-draw .9s var(--ease) both 1.1s; }
  .swh.is-anim .swh-be span { animation: swh-fade .5s ease both 1.8s; }
  .swh.is-anim .swh-strat span { animation: swh-fade .45s ease both; }
}
@keyframes swh-in { from { opacity: 0; transform: translateY(14px) scale(.94); } }
@keyframes swh-dot { from { transform: scale(0); } }
@keyframes swh-grow { from { transform: scaleX(0); } }
@keyframes swh-draw { from { transform: scaleY(0); } }
@keyframes swh-fade { from { opacity: 0; } }

/* ==========================================================================
   STRUMENTO
   ========================================================================== */
.swot-sec-head { max-width: 780px; margin: 0 0 26px; }
.swot-sec-head .lead { margin: 10px 0 0; }

.swot-in fieldset { margin: 0 0 12px; padding: 0; border: 0; min-width: 0; }
.swot-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.swot-field { margin-bottom: 14px; }
.swot-field label { display: block; margin-bottom: 6px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.swot-field label small { font-weight: 500; color: var(--muted); }
.swot-field input, .swot-field select, .swot-q textarea { display: block; width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #64748b; border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink); font: 500 16px/1.35 var(--sans); }
.swot-field input[type="number"] { font-variant-numeric: tabular-nums; }
.swot-hint { margin: 5px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.swot-field input:focus-visible, .swot-field select:focus-visible, .swot-q textarea:focus-visible, .swot-q input:focus-visible,
.swot-check input:focus-visible, .swot-report:focus-visible { outline: 3px solid var(--a); outline-offset: 2px; }
.swot-field input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.swot-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.swot-err { margin: 12px 0 0; font-weight: 600; color: var(--bad); }
.swot-err:empty { display: none; }

/* pannello dei risultati (stile .sim-out di simulatori.css) */
.sim-kpi small { display: block; margin-top: 3px; font-size: 12px; line-height: 1.3; color: var(--p-muted); }
.swot-bar { position: relative; height: 12px; margin: 26px 0 6px; border-radius: 999px; background: var(--p-track); }
.swot-bar-fill { position: absolute; top: 0; bottom: 0; left: 0; width: var(--v, 0%); border-radius: inherit; background: var(--p-acc); transition: width .5s var(--ease); }
.swot-mk { position: absolute; top: -7px; bottom: -7px; left: var(--x, 0%); border-left: 2px dashed #fbbf24; }
.swot-mk span { position: absolute; bottom: calc(100% + 3px); left: 0; transform: translateX(-50%); font: 700 10.5px/1 var(--mono); color: #fcd34d; white-space: nowrap; }
.swot-mk.ob { border-left-color: #fff; }
.swot-mk.ob span { top: calc(100% + 3px); bottom: auto; color: #fff; }
.swot-mk[hidden] { display: none; }
.swot-txt { margin: 26px 0 0; display: grid; gap: 10px; }
.swot-txt div { padding: 12px 14px; border: 1px solid var(--p-line); border-radius: 12px; background: var(--p-card); }
.swot-txt h4 { margin: 0 0 4px; font-size: 13px; font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--p-acc); }
.swot-txt p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--p-text); }

/* matrice SWOT da compilare */
.swot-matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.swot-q { --c: var(--ok); border-top: 4px solid var(--c); }
.swot-q.w { --c: var(--bad); }
.swot-q.o { --c: var(--info); }
.swot-q.t { --c: var(--warn); }
.swot-q-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.swot-letter { display: inline-grid; flex: none; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); font: 800 21px/1 var(--sans); }
.swot-q h3 { margin: 0; font-size: 1.15rem; }
.swot-q-head small { display: block; font-size: 13px; color: var(--muted); }
.swot-q label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--ink); }
.swot-q textarea { min-height: 112px; resize: vertical; font-weight: 400; line-height: 1.5; }
.swot-rate { margin-top: 14px; }
.swot-rate label { display: flex; justify-content: space-between; gap: 10px; }
.swot-rate output { font-variant-numeric: tabular-nums; color: var(--c); font-weight: 800; }
.swot-rate input { display: block; width: 100%; min-height: 44px; margin: 0; accent-color: var(--c); cursor: pointer; }

.swot-checks-card { margin-top: 18px; }
.swot-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 14px 0 0; padding: 0; list-style: none; }
.swot-check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink-2); cursor: pointer; line-height: 1.4; }
.swot-check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--a); cursor: pointer; }
.swot-check:has(input:checked) { border-color: var(--a); background: var(--a-soft); }

/* diagnosi */
.swot-diag { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 22px; align-items: start; }
.swot-score { display: flex; align-items: center; gap: 20px; margin: 6px 0 14px; }
.swot-ring { --p: 0; display: grid; flex: none; place-items: center; width: 128px; height: 128px; border-radius: 50%;
  background: conic-gradient(var(--a) calc(var(--p) * 1%), var(--line) 0); }
.swot-ring output { display: grid; place-items: center; width: 104px; height: 104px; border-radius: 50%; background: var(--bg); font: 800 21px/1 var(--sans); letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.swot-score p { margin: 0; }
.swot-prio { display: grid; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; counter-reset: prio; }
.swot-prio li { counter-increment: prio; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); color: var(--ink-2); line-height: 1.5; }
.swot-prio li::before { content: counter(prio); grid-row: span 2; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--a); color: #fff; font: 700 13px/1 var(--sans); }
.swot-tag { justify-self: start; padding: 2px 8px; border-radius: 999px; font: 700 11.5px/1.5 var(--mono); letter-spacing: .04em; background: var(--bad-soft); color: var(--bad); }
.swot-tag.media { background: var(--warn-soft); color: var(--warn); }
.swot-tag.opp { background: var(--ok-soft); color: var(--ok); }
.swot-tag:empty { display: none; }
.swot-cross { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.swot-cross > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.swot-cross b { display: inline-flex; gap: 4px; margin-bottom: 4px; font: 800 15px/1 var(--mono); }
.swot-cross b i { font-style: normal; }
.swot-cross b .s { color: var(--ok); } .swot-cross b .w { color: var(--bad); } .swot-cross b .o { color: var(--info); } .swot-cross b .t { color: var(--warn); }
.swot-cross p { margin: 0; font-size: 15px; color: var(--ink-2); }

/* report */
.swot-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.swot-status { min-height: 1.5em; margin: 12px 0 0; font-weight: 600; color: var(--ok); }
.swot-report { margin: 12px 0 0; padding: 18px; max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2);
  font: 13.5px/1.65 var(--mono); color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.swot-legal { margin-top: 18px; font-size: 13.5px; color: var(--muted); }

html:not(.js) .swot-js { display: none; }

@media (max-width: 900px) {
  .swot-diag { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .swot-matrix, .swot-checks, .swot-cross { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .swot-row2 { grid-template-columns: 1fr; }
  .swh-cell { padding: 10px; }
  .swh-cell .l { font-size: 18px; }
  .swot-score { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .swh-cell, .swot-bar-fill { transition: none; }
}

/* ---------- stampa: tutto visibile e leggibile su carta bianca ---------- */
@media print {
  .swh-hero { padding: 0 0 12px; background: #fff; color: #000; }
  .swh-hero .aurora { display: none; }
  .swh-hero h1, .swh-hero .lead, .swh-hero .swh-nota, .swh-hero .hero-points, .swh-hero .crumbs, .swh-hero .crumbs a, .swh-hero .eyebrow,
  .swh, .swh * { color: #000 !important; }
  .swh { background: #fff; border-color: #999; box-shadow: none; }
  .swh-cell, .swh-roas, .swh-strat { border-color: #999; background: #fff; }
  .swh *, .swh.is-anim * { animation: none !important; opacity: 1 !important; transform: none !important; }
  .swh-ax.row { transform: rotate(180deg) !important; }
  /* i titoli h2 entrano a tenda con lo scorrimento (site.css, titolo-tenda): su carta devono esserci tutti */
  .sim-t-swot section h2 { animation: none !important; clip-path: none !important; opacity: 1 !important; }
  .swh-hero .hero-actions, .swot-js, .swot-actions { display: none !important; }
  .swot-report { max-height: none; overflow: visible; background: #fff; border-color: #999; color: #000; }
  .swot-bar, .swot-mk { display: none; }
  .swot-txt div { background: #fff; border-color: #999; }
  .swot-txt h4, .swot-txt p, .sim-kpi small { color: #000; }
  /* «Stampa / Salva PDF» (classe swot-stampa da simulatore-swot.js): solo risultati, diagnosi e report, come
     nel simulatore originale; con il comando di stampa del browser si stampa la pagina intera */
  html.swot-stampa body > :not(main), html.swot-stampa main > section:not(.swot-print), html.swot-stampa .swot-in { display: none !important; }
  html.swot-stampa .sim { grid-template-columns: 1fr; }
}
