/* AIForge — strumenti online gratuiti e consulenza. © Roberto Di Flumeri */

/* ---------- Elenco ---------- */
.tools-hero { text-align: center; padding-top: 28px; }
.tools-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: .5rem; }
.tools-lead { max-width: 760px; margin: 0 auto 18px; color: #cdd5f7; font-size: 1.02rem; }
.nolimits { list-style: none; padding: 0; margin: 0 auto 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 980px; text-align: left; }
.nolimits li { display: flex; gap: .6rem; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: rgba(74, 222, 128, .07); border: 1px solid rgba(74, 222, 128, .3); }
.nolimits .ico { color: #4ade80; width: 20px; height: 20px; margin-top: 1px; }
.nolimits span { display: flex; flex-direction: column; font-size: .82rem; color: var(--muted); }
.nolimits strong { color: var(--text); font-size: .95rem; }
.tools-search { display: flex; align-items: center; gap: .6rem; max-width: 620px; margin: 0 auto; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(5, 9, 26, .6); }
.tools-search:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .15); }
.tools-search input { border: 0 !important; background: none !important; box-shadow: none !important; padding: .9rem 0; font-size: 1rem; }
.tools-search .ico { color: var(--muted); }
.tools-popular, .tools-group { margin-top: 30px; }
.tools-popular h2, .tools-group h2 { margin-bottom: .3rem; }
.tools-group-head { margin-bottom: 12px; }
.tools-group-head p { margin: 0; }
.tools-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.tools-cats small { opacity: .7; }
.chip-consult { border-color: rgba(74, 222, 128, .5); }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.tool-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text); transition: transform .15s, border-color .15s, box-shadow .15s; }
.tool-card:hover { transform: translateY(-2px); border-color: var(--cyan); box-shadow: 0 10px 30px rgba(34, 211, 238, .12); color: var(--text); }
.tool-card[hidden], [data-tools-section][hidden] { display: none; }
.tool-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tool-text strong { font-size: .98rem; }
.tool-text > span { font-size: .82rem; color: var(--muted); line-height: 1.4; }
.tool-hot { white-space: nowrap; display: inline-block; font-style: normal; font-size: .6rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: .1rem .4rem; border-radius: 999px; color: #052e16; background: linear-gradient(90deg, #4ade80, #22d3ee); vertical-align: middle; }
.tool-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--grad-soft); border: 1px solid var(--line-2); color: var(--cyan); }
.tool-ico .ico { width: 22px; height: 22px; }
.tool-ico.big { width: 60px; height: 60px; border-radius: 16px; }
.tool-ico.big .ico { width: 30px; height: 30px; }
.tool-ico-design { color: var(--pink); }
.tool-ico-pdf { color: var(--red); }
.tool-ico-text { color: var(--amber); }
.tool-ico-image { color: var(--green); }
.tool-ico-dev { color: var(--violet); }
.tools-empty { margin-top: 24px; }

/* ---------- Consulenza ---------- */
.consult-cta { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; margin-top: 34px; padding: 26px 28px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(74, 222, 128, .12), rgba(99, 102, 241, .2)); border: 1px solid rgba(74, 222, 128, .4); }
.consult-cta h2 { display: block; margin: .2rem 0 .4rem; }
.consult-cta p { margin: 0; color: #dbe3ff; }
.consult-cta .eyebrow { margin-bottom: 0; }
.consult-cta-ico { width: 54px; height: 54px; color: #4ade80; }
.consult-points { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.consult-points li { display: flex; gap: .6rem; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.consult-points .ico { color: #4ade80; width: 22px; height: 22px; }
.consult-points span { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); }
.consult-points strong { color: var(--text); }
.consult-topics { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.consult-topics legend { font-size: .88rem; font-weight: 600; color: #cdd5f7; margin-bottom: 8px; }
.form .consult-topic { flex-direction: row; align-items: center; gap: .6rem; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(5, 9, 26, .4); cursor: pointer; font-weight: 500; }
.consult-topic:has(input:checked) { border-color: var(--cyan); background: rgba(34, 211, 238, .1); }
.consult-topic input { accent-color: var(--cyan); width: 18px; height: 18px; flex: none; }
[data-consult-device][hidden] { display: none; }

/* ---------- Pagina strumento ---------- */
.tool-page { padding-bottom: 10px; }
.tool-head { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.tool-head h1 { margin: 0 0 .2rem; }
.tool-head p { margin: 0; }
.tool-badges { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.tool-badges li { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border-radius: 999px; font-size: .8rem; background: rgba(74, 222, 128, .08); border: 1px solid rgba(74, 222, 128, .3); color: #d1fae5; }
.tool-badges .ico { color: #4ade80; width: 15px; height: 15px; }
.tool-app { min-height: 220px; }
.tool-why { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-top: 20px; padding: 22px; border-radius: var(--radius); background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.tool-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool-compare .col { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; font-size: .85rem; }
.tool-compare .col span { display: flex; gap: .4rem; align-items: center; }
.tool-compare .ico { width: 16px; height: 16px; }
.tool-compare .bad { background: rgba(248, 113, 113, .07); border: 1px solid rgba(248, 113, 113, .3); color: #fecaca; }
.tool-compare .bad .ico { color: var(--red); }
.tool-compare .good { background: rgba(74, 222, 128, .08); border: 1px solid rgba(74, 222, 128, .35); color: #d1fae5; }
.tool-compare .good .ico { color: #4ade80; }

/* ---------- Componenti degli strumenti (assets/js/tools) ---------- */
.ait { display: flex; flex-direction: column; gap: 14px; }
.ait label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 600; color: #cdd5f7; }
.ait label.inline { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
.ait label.inline input[type=checkbox], .ait label.inline input[type=radio] { width: 17px; height: 17px; accent-color: var(--cyan); }
.ait textarea, .ait .mono { font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace; font-size: .86rem; }
.ait textarea { min-height: 220px; tab-size: 2; }
.ait input[type=range] { accent-color: var(--cyan); width: 100%; }
.ait input[type=color] { width: 52px; height: 40px; padding: 2px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; }
.ait-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ait-row > label { flex: 1 1 160px; }
.ait-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ait-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ait-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.ait-seg button { padding: .5rem .9rem; background: none; border: 0; color: var(--muted); font: 600 .85rem var(--font); cursor: pointer; }
.ait-seg button.on { background: var(--grad); color: #fff; }
.ait-msg { padding: .65rem .9rem; border-radius: 10px; font-size: .88rem; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); white-space: pre-wrap; }
.ait-msg.ok { border-color: rgba(74, 222, 128, .5); background: rgba(74, 222, 128, .08); color: #d1fae5; }
.ait-msg.err { border-color: rgba(248, 113, 113, .5); background: rgba(248, 113, 113, .08); color: #fecaca; }
.ait-msg.info { border-color: rgba(34, 211, 238, .4); background: rgba(34, 211, 238, .06); }
.ait-msg:empty { display: none; }
.ait-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 150px; padding: 22px; border-radius: 14px; border: 2px dashed var(--line-2); background: rgba(5, 9, 26, .4); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.ait-drop:hover, .ait-drop.over { border-color: var(--cyan); background: rgba(34, 211, 238, .07); }
.ait-drop .ico { width: 34px; height: 34px; color: var(--cyan); }
.ait-drop strong { font-size: 1rem; }
.ait-drop small { color: var(--muted); }
.ait-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ait-files { display: flex; flex-direction: column; gap: 8px; }
.ait-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); font-size: .88rem; }
.ait-file .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ait-file .size { color: var(--muted); font-size: .8rem; }
.ait-file img, .ait-file canvas { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: #fff; }
.ait-icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); color: var(--text); cursor: pointer; font: 600 .9rem var(--font); }
.ait-icon-btn:hover { border-color: var(--cyan); }
.ait-icon-btn:disabled { opacity: .35; pointer-events: none; }
.ait-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.ait-stat { padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.ait-stat b { display: block; font-size: 1.5rem; font-family: var(--font-display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ait-stat span { font-size: .8rem; color: var(--muted); }
.ait-out { padding: 12px 14px; border-radius: 10px; background: rgba(5, 9, 26, .6); border: 1px solid var(--line-2); font-family: ui-monospace, Consolas, monospace; font-size: .88rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.ait-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.ait-table th, .ait-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.ait-table th { color: var(--muted); font-weight: 600; }
.ait-scroll { overflow: auto; max-height: 460px; border-radius: 10px; }
.ait-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ait-page { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); align-items: center; }
.ait-page canvas, .ait-page img { max-width: 100%; height: auto; border-radius: 4px; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); transition: transform .2s; }
.ait-page.off { opacity: .35; }
.ait-page.off canvas { filter: grayscale(1); }
.ait-page .num { font-size: .78rem; color: var(--muted); }
.ait-page .acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.ait-page .acts .ait-icon-btn { width: 30px; height: 30px; }
.ait-page.sel { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(34, 211, 238, .3); }
.ait-preview { display: grid; place-items: center; padding: 14px; border-radius: 12px; background: repeating-conic-gradient(#1a2247 0 25%, #121a3a 0 50%) 0 0 / 20px 20px; border: 1px solid var(--line); min-height: 160px; }
.ait-preview img, .ait-preview canvas, .ait-preview svg { max-width: 100%; max-height: 520px; height: auto; }
.ait-swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ait-swatch { display: flex; flex-direction: column; justify-content: flex-end; min-height: 150px; padding: 10px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .15); cursor: pointer; font: 700 .85rem ui-monospace, Consolas, monospace; text-align: left; }
.ait-swatch small { font-weight: 500; opacity: .8; }
.ait-swatch .lock { align-self: flex-end; margin-bottom: auto; background: rgba(0, 0, 0, .25); border: 0; color: inherit; border-radius: 8px; padding: .25rem .45rem; cursor: pointer; font-size: .8rem; }
.ait-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.ait-choice { padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); cursor: pointer; color: var(--text); font: inherit; text-align: center; }
.ait-choice.on { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(34, 211, 238, .3); }
.ait-choice canvas, .ait-choice img, .ait-choice svg { width: 100%; height: auto; border-radius: 8px; display: block; }
.ait-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.ait-name { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); font-weight: 700; font-size: 1rem; }
.ait-hl mark { background: rgba(250, 204, 21, .35); color: inherit; border-radius: 3px; padding: 0 1px; }
.ait-hl mark:nth-of-type(even) { background: rgba(34, 211, 238, .35); }
.ait-diff { font-family: ui-monospace, Consolas, monospace; font-size: .84rem; border-radius: 10px; overflow: auto; max-height: 560px; border: 1px solid var(--line-2); }
.ait-diff div { display: grid; grid-template-columns: 44px 44px 18px 1fr; white-space: pre-wrap; overflow-wrap: anywhere; }
.ait-diff span { padding: 1px 6px; }
.ait-diff .n { color: #6b74a0; text-align: right; user-select: none; }
.ait-diff .add { background: rgba(74, 222, 128, .14); }
.ait-diff .del { background: rgba(248, 113, 113, .14); }
.ait-diff ins { background: rgba(74, 222, 128, .4); text-decoration: none; }
.ait-diff del { background: rgba(248, 113, 113, .4); }
.ait-md { padding: 16px 20px; border-radius: 10px; background: #fff; color: #1f2937; min-height: 220px; overflow: auto; max-height: 640px; }
.ait-md a { color: #2563eb; }
.ait-md pre { background: #f3f4f6; padding: 10px; border-radius: 6px; overflow: auto; }
.ait-md code { background: #f3f4f6; padding: 0 4px; border-radius: 4px; }
.ait-md table { border-collapse: collapse; }
.ait-md th, .ait-md td { border: 1px solid #d1d5db; padding: 4px 8px; }
.ait-md blockquote { border-left: 4px solid #c7d2fe; margin: 0; padding-left: 12px; color: #4b5563; }
.ait-md img { max-width: 100%; }
.ait-meter { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.ait-meter i { display: block; height: 100%; border-radius: 999px; transition: width .2s, background .2s; }
.ait-editor-wrap { overflow: auto; max-height: 75vh; border-radius: 12px; background: #2a3158; padding: 12px; border: 1px solid var(--line); }
.ait-editor-page { position: relative; margin: 0 auto 14px; box-shadow: 0 4px 18px rgba(0, 0, 0, .4); background: #fff; touch-action: none; }
.ait-editor-page canvas { display: block; width: 100%; height: auto; }
.ait-ann { position: absolute; cursor: move; user-select: none; box-sizing: border-box; }
.ait-ann.sel { outline: 2px dashed #06b6d4; outline-offset: 2px; }
.ait-ann.text { white-space: pre; line-height: 1.15; font-family: Helvetica, Arial, sans-serif; }
.ait-ann img { width: 100%; height: 100%; display: block; pointer-events: none; }
.ait-ann .rs { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 50%; background: #06b6d4; border: 2px solid #fff; cursor: nwse-resize; }
.ait-ann .rm { position: absolute; right: -10px; top: -10px; width: 20px; height: 20px; border-radius: 50%; background: #ef4444; color: #fff; border: 0; font: 700 12px/20px var(--font); cursor: pointer; padding: 0; }
.ait-sign { width: 100%; height: 180px; background: #fff; border-radius: 10px; touch-action: none; cursor: crosshair; }
.ait-toolbar { position: sticky; top: calc(var(--header-h) + 6px); z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line-2); }
.ait-toolbar .ait-seg button { padding: .45rem .7rem; }
.ait-progress { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.ait-progress i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }
.ait-mockups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ait-mockups figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ait-mockups canvas { width: 100%; height: auto; border-radius: 12px; }
.ait-mockups figcaption { display: flex; justify-content: space-between; align-items: center; font-size: .88rem; }
.ait-help { font-size: .82rem; color: var(--muted); }
.ait-help code { color: #c4d4ff; }

@media (max-width: 900px) {
  .nolimits { grid-template-columns: 1fr 1fr; }
  .tool-why { grid-template-columns: 1fr; }
  .consult-cta { grid-template-columns: 1fr; text-align: left; }
  .ait-cols, .ait-cols-3 { grid-template-columns: 1fr; }
  .ait-swatches { grid-template-columns: repeat(5, 1fr); }
  .ait-swatch { min-height: 110px; font-size: .7rem; padding: 6px; }
}
@media (max-width: 560px) {
  .nolimits, .consult-points, .consult-topics { grid-template-columns: 1fr; }
  .tool-compare { grid-template-columns: 1fr; }
  .tool-head { align-items: flex-start; }
  .tool-ico.big { width: 48px; height: 48px; }
  .ait-swatches { grid-template-columns: 1fr; }
  .ait-swatch { min-height: 60px; flex-direction: row; align-items: center; justify-content: space-between; }
  .ait-swatch .lock { margin: 0; }
  .ait-diff div { grid-template-columns: 30px 30px 14px 1fr; }
}
.ait-toolbar select { width: auto; min-width: 90px; padding-top: .45rem; padding-bottom: .45rem; }
.ait-ann .rm, .ait-ann .rs { display: none; }
.ait-ann.sel .rm, .ait-ann.sel .rs { display: block; }
