/* ==========================================================================
   Pagine Microsoft 365 (pillar, backup, migrazione email)
   Caricato solo da inc/ai-m365.php. Layout di base ripreso dal template originale
   di /microsoft365/; colori, tipografia e componenti dal design system (ai-ds.css,
   regole body.ai-ds, più specifiche). Nessun colore nuovo.
   ========================================================================== */

/* Base (come gli altri template servizio) */
/* Reset a specificità zero (:where), come il «* { }» del template originale: non deve battere le classi dei componenti. */
:where(body.ai-m365) *, :where(body.ai-m365) *::before, :where(body.ai-m365) *::after { box-sizing: border-box; margin: 0; padding: 0; }
body.ai-m365 { margin: 0; background: #f1f5f9; color: #1e293b; font-size: 16px; line-height: 1.7; }
:where(body.ai-m365) > * { background: transparent; }
:where(body.ai-m365) a { color: inherit; }
:where(body.ai-m365) img, :where(body.ai-m365) svg { max-width: 100%; }

.ai-m365-salta {
  position: absolute; left: 12px; top: -60px; z-index: 2147483647;
  background: #1e293b; color: #fff !important; padding: 10px 16px; border-radius: 8px; text-decoration: none;
}
.ai-m365-salta:focus { top: 12px; }

/* Navigazione (markup identico alle altre pagine) */
.mn { display: flex; align-items: center; justify-content: space-between; padding: 20px 48px; border-bottom: 1px solid #d1d9e0; background: rgba(241,245,249,0.97); position: sticky; top: 0; z-index: 1000; gap: 16px; }
.mn-logo { flex-shrink: 0; }
.mn-links { display: flex; gap: 24px; flex: 1; justify-content: center; }
.mn-links a { font-size: 15px; color: #475569; text-decoration: none; white-space: nowrap; }
.mn-cta { background: #BE1521; color: #fff !important; padding: 11px 22px; border-radius: 7px; font-size: 14px; font-weight: 500; text-decoration: none; display: inline-block; white-space: nowrap; flex-shrink: 0; }
.mn-ham { display: none; background: none; border: 2px solid #94a3b8; color: #1e293b; padding: 8px 13px; border-radius: 6px; cursor: pointer; font-size: 22px; flex-shrink: 0; line-height: 1; }
@media (max-width: 900px) {
  .mn { padding: 16px 20px; }
  .mn-ham { display: block !important; }
  .mn-links, .mn-cta { display: none !important; }
}

/* Hero */
.hero-wrap { position: relative; overflow: hidden; }
.hero-wrap > * { position: relative; z-index: 1; }
.hero { padding: 72px 48px 56px; max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; padding: 40px 20px 36px; gap: 32px; } }
.hero-breadcrumb { font-size: 13px; color: #475569; margin-bottom: 12px; }
.hero-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; padding: 5px 14px; border-radius: 20px; margin-bottom: 20px; }
.hero h1 { font-size: 44px; font-weight: 800; line-height: 1.1; margin-bottom: 18px; }
.hero-sub { font-size: 17px; color: #475569; margin-bottom: 28px; max-width: 520px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-ctas .btn-primary, .hero-ctas .btn-secondary { text-align: center; line-height: 1.35; }
.btn-primary { background: #BE1521; color: #fff !important; padding: 14px 28px; border-radius: 8px; font-size: 15px; font-weight: 500; text-decoration: none; display: inline-block; }
.btn-secondary { background: #fff; color: #1e293b !important; padding: 13px 24px; border-radius: 8px; font-size: 15px; font-weight: 500; text-decoration: none; border: 1px solid #d1d9e0; display: inline-block; }
.hero-visual { background: #fff; border: 1px solid #d1d9e0; border-radius: 20px; padding: 32px; }

/* Pannello hero: elenco di controllo */
.ai-m365-pannello__titolo { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #1e293b; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.ai-m365-pannello__titolo .ai-icon { color: #BE1521; }
.ai-m365-check { list-style: none; display: grid; gap: 0; }
.ai-m365-check li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid #e8edf3; font-size: 0.9375rem; color: #1e293b; line-height: 1.5; }
.ai-m365-check li:last-child { border-bottom: 0; }
.ai-m365-check .ai-icon { width: 20px; height: 20px; color: #BE1521; margin-top: 1px; flex-shrink: 0; }
.ai-m365-pannello__nota { margin-top: 14px; font-size: 0.8125rem; color: #475569; }

/* Sezioni */
.sec { padding: 64px 48px; max-width: 1100px; margin: 0 auto; }
@media (max-width: 768px) { .sec { padding: 40px 20px; } }
.sec-tag { display: inline-block; font-size: 13px; font-weight: 500; padding: 5px 14px; border-radius: 20px; margin-bottom: 14px; }
.sec-title { font-size: 34px; font-weight: 800; line-height: 1.2; margin-bottom: 12px; }
.sec-sub { font-size: 16px; color: #475569; max-width: 640px; margin-bottom: 40px; }
.ai-m365-testo { font-size: 1.0625rem; color: #475569; max-width: 46em; }
.ai-m365-testo + .ai-m365-testo { margin-top: 14px; }
.ai-m365-testo a, .service-card p a, .faq-answer a, .benefit-item p a, .ai-m365-nota a, .ai-m365-tabella a { color: #BE1521; font-weight: 600; text-underline-offset: 3px; }

/* Griglie e card */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .services-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .services-grid { grid-template-columns: 1fr; } }
.service-card { background: #fff; border: 1px solid #d1d9e0; border-radius: 16px; padding: 28px; }
.service-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.service-icon .ai-icon { width: 24px; height: 24px; }
.service-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.service-card p { font-size: 14px; color: #475569; line-height: 1.6; }
.service-card ul { margin-top: 4px; padding-left: 18px; font-size: 0.9375rem; color: #475569; display: grid; gap: 4px; }

.steps-wrap { background: #fff; border: 1px solid #d1d9e0; border-radius: 20px; padding: 48px; }
@media (max-width: 600px) { .steps-wrap { padding: 28px 20px; } }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; list-style: none; }
.steps.ai-m365-steps-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) { .steps, .steps.ai-m365-steps-5 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .steps, .steps.ai-m365-steps-5 { grid-template-columns: 1fr; } }
.step { text-align: center; position: relative; }
.step-num { width: 48px; height: 48px; background: #BE1521; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; margin: 0 auto 14px; }
.step h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.step p { font-size: 13px; color: #475569; line-height: 1.5; }

.benefits-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .benefits-grid { grid-template-columns: 1fr; } }
.benefit-item { background: #fff; border: 1px solid #d1d9e0; border-radius: 12px; padding: 22px; display: flex; gap: 16px; align-items: flex-start; }
.benefit-check { width: 32px; height: 32px; background: rgba(190,21,33,0.07); color: #BE1521; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.benefit-check .ai-icon { width: 18px; height: 18px; margin: 0 !important; }
.benefit-item h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.benefit-item p { font-size: 14px; color: #475569; line-height: 1.55; }

/* Per chi lavoriamo */
.ai-m365-perchi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1000px) { .ai-m365-perchi { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .ai-m365-perchi { grid-template-columns: 1fr; } }
.ai-m365-perchi > div { background: #fff; border: 1px solid #d1d9e0; border-radius: 18px; padding: 24px; box-shadow: 0 1px 2px rgba(15,23,42,0.06), 0 1px 3px rgba(15,23,42,0.04); }
.ai-m365-perchi .ai-icon { width: 26px; height: 26px; color: #BE1521; margin-bottom: 10px; }
.ai-m365-perchi h3 { font-size: 1.0625rem; font-weight: 700; margin-bottom: 6px; }
.ai-m365-perchi p { font-size: 0.9375rem; color: #475569; line-height: 1.6; }

/* Tabella di confronto */
.ai-m365-tabella-wrap { background: #fff; border: 1px solid #d1d9e0; border-radius: 18px; overflow-x: auto; box-shadow: 0 1px 2px rgba(15,23,42,0.06), 0 1px 3px rgba(15,23,42,0.04); }
.ai-m365-tabella { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 0.9375rem; }
.ai-m365-tabella caption { text-align: left; padding: 18px 22px 0; font-size: 0.8125rem; color: #475569; caption-side: bottom; padding-bottom: 18px; }
.ai-m365-tabella th, .ai-m365-tabella td { text-align: left; padding: 14px 22px; border-bottom: 1px solid #e8edf3; vertical-align: top; line-height: 1.55; }
.ai-m365-tabella thead th { background: #1e293b; color: #fff; font-weight: 700; font-size: 0.875rem; }
.ai-m365-tabella thead th:last-child { background: #BE1521; }
.ai-m365-tabella tbody th { font-weight: 600; color: #1e293b; width: 30%; }
.ai-m365-tabella tbody td { color: #475569; }
.ai-m365-tabella tbody td:last-child { color: #1e293b; }

/* Nota / avviso */
.ai-m365-nota { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid rgba(190,21,33,0.2); border-left: 4px solid #BE1521; border-radius: 12px; padding: 18px 22px; margin-top: 28px; color: #1e293b; font-size: 0.9375rem; line-height: 1.6; max-width: 880px; }
.ai-m365-nota > .ai-icon { width: 22px; height: 22px; color: #BE1521; flex-shrink: 0; margin: 1px 0 0 !important; }
.ai-m365-nota strong { font-weight: 700; }

/* Elenco a due colonne (preparazione, cosa aspettarsi) */
.ai-m365-due { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 800px) { .ai-m365-due { grid-template-columns: 1fr; } }
.ai-m365-riquadro { background: #fff; border: 1px solid #d1d9e0; border-radius: 18px; padding: 26px; }
.ai-m365-riquadro h3 { font-size: 1.1875rem; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.ai-m365-riquadro h3 .ai-icon { color: #BE1521; margin: 0 !important; }
.ai-m365-riquadro p { font-size: 0.9375rem; color: #475569; line-height: 1.6; }
.ai-m365-riquadro p + p { margin-top: 10px; }
.ai-m365-riquadro .ai-m365-check li { font-size: 0.9375rem; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 12px; max-width: 880px; }
.faq-item { background: #fff; border: 1px solid #d1d9e0; border-radius: 12px; overflow: hidden; }
.ai-m365-faq-h { font-size: inherit; font-weight: inherit; margin: 0; }
.ai-m365-faq-domanda {
  width: 100%; background: none; border: 0; text-align: left; font: inherit; color: #1e293b;
  padding: 20px 24px; font-size: 15px; font-weight: 600; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.ai-m365-faq-domanda:hover { color: #BE1521; }
/* Stesse misure che ai-ds.css applica a .faq-question negli altri template. */
body.ai-ds .ai-m365-faq-domanda { padding: 20px 24px; font-size: var(--ai-fs-md, 15px); min-height: 56px; }
.ai-m365-faq-domanda:focus-visible { outline: 2px solid #BE1521; outline-offset: -2px; }
@media (max-width: 900px) { body.ai-ds .ai-m365-faq-domanda { padding: 18px; font-size: var(--ai-fs-sm, 15px); } }
.faq-arrow { flex-shrink: 0; transition: transform .2s; display: inline-grid; place-items: center; }
.faq-answer { padding: 0 24px 20px; font-size: 15px; color: #475569; line-height: 1.7; }
.faq-answer p + p { margin-top: 10px; }
.js-ai-m365 .faq-answer { display: none; }
.js-ai-m365 .faq-item.open .faq-answer { display: block; }
.faq-item.open .faq-arrow { transform: rotate(180deg); }

/* Richiesta (modulo MarketingOS) */
.ai-m365-richiesta { background: linear-gradient(135deg, #1e293b, #0f172a); color: #fff; position: relative; overflow: hidden; }
.ai-m365-richiesta::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(520px 260px at 90% 0%, rgba(190,21,33,0.28), transparent 70%),
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px;
}
.ai-m365-richiesta__in { position: relative; max-width: 1200px; margin: 0 auto; padding: clamp(56px, 7vw, 96px) clamp(16px, 4vw, 40px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: start; }
@media (max-width: 900px) { .ai-m365-richiesta__in { grid-template-columns: minmax(0, 1fr); } }
body.ai-ds .ai-m365-richiesta .sec-title { color: #fff; }
body.ai-ds .ai-m365-richiesta .sec-sub { color: #cbd5e1; margin-bottom: 24px; }
body.ai-ds .ai-m365-richiesta .sec-tag { background: rgba(255,255,255,0.08); color: #fff; }
.ai-m365-passi { list-style: none; counter-reset: passo; display: grid; gap: 12px; margin-bottom: 24px; }
.ai-m365-passi li { counter-increment: passo; position: relative; padding-left: 44px; color: #cbd5e1; font-size: 0.9375rem; line-height: 1.55; min-height: 30px; }
.ai-m365-passi li::before { content: counter(passo); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(190,21,33,0.9); color: #fff; font-weight: 700; font-size: 0.875rem; }
.ai-m365-richiesta__tel { color: #cbd5e1; font-size: 0.9375rem; }
.ai-m365-richiesta__tel a { color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; border-bottom: 2px solid #BE1521; }
.ai-m365-richiesta__tel a .ai-icon { margin-right: 4px; }
.ai-m365-richiesta__modulo { background: #fff; color: #1e293b; border-radius: 18px; padding: clamp(20px, 3vw, 32px); box-shadow: 0 20px 36px -24px rgba(0,0,0,0.6); }
.ai-m365-richiesta__kicker { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; color: #0f172a; margin-bottom: 4px; }
.ai-m365-richiesta__modulo .mos-cta-lead { background: none !important; border: 0 !important; padding: 0 !important; margin: 0 !important; }
.ai-m365-richiesta__modulo .mos-cta-form { gap: 14px !important; margin-top: 12px; }
.ai-m365-richiesta__modulo .mos-cta-form input:is([type="text"], [type="email"], [type="tel"]) { min-height: 46px; padding: 10px 12px !important; border-radius: 8px !important; font-size: 1rem; color: #1e293b; background: #fff; }
.ai-m365-richiesta__modulo .mos-cta-form label { color: #334155; }
.ai-m365-richiesta__modulo .mos-cta-form label[for$="-privacy"],
.ai-m365-richiesta__modulo .mos-cta-form label[for$="-marketing"] { font-size: 0.875rem !important; line-height: 1.5; color: #475569 !important; gap: 10px !important; }
.ai-m365-richiesta__modulo .mos-cta-form label a { color: #BE1521; }
.ai-m365-richiesta__modulo .mos-cta-form input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px !important; accent-color: #BE1521; }
.ai-m365-richiesta__modulo .mos-cta-form button[type="submit"] { min-height: 50px; padding: 0 28px !important; border-radius: 10px !important; font-size: 1rem; width: 100%; }
.ai-m365-richiesta__modulo .mos-cta-esito { color: #1e293b; }
.ai-m365-riserva { color: #475569; }
.ai-m365-riserva a { color: #BE1521; font-weight: 600; }

/* Collegamenti interni */
.ai-m365-correlati { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .ai-m365-correlati { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .ai-m365-correlati { grid-template-columns: 1fr; } }
.ai-m365-correlato { position: relative; display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid #d1d9e0; border-radius: 18px; padding: 22px 52px 22px 22px; text-decoration: none; color: #1e293b; transition: border-color .16s, transform .16s, box-shadow .16s; }
.ai-m365-correlato:hover { border-color: rgba(190,21,33,0.2); transform: translateY(-2px); box-shadow: 0 10px 20px -14px rgba(15,23,42,0.30); }
.ai-m365-correlato strong { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; }
.ai-m365-correlato span { font-size: 0.9375rem; color: #475569; line-height: 1.5; }
.ai-m365-correlato__vai { position: absolute; right: 20px; top: 22px; color: #BE1521 !important; }

/* Zone e footer */
.link-interni { background: #e8edf3; border-top: 1px solid #d1d9e0; padding: 32px 48px; }
@media (max-width: 768px) { .link-interni { padding: 24px 20px; } }
.link-interni-inner { max-width: 1100px; margin: 0 auto; }
.ai-m365-zone-h { font-size: 13px; font-weight: 700; color: #475569; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.08em; }
.link-interni-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.link-interni-grid a { font-size: 14px; color: #475569; text-decoration: none; background: #fff; border: 1px solid #d1d9e0; padding: 6px 14px; border-radius: 8px; }
.link-interni-grid a:hover { border-color: #BE1521; color: #BE1521; }
.ft { background: #fff; border-top: 1px solid #d1d9e0; padding: 40px 48px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.ft-copy { font-size: 13px; color: #64748b; }
.ft-social { display: flex; align-items: center; gap: 14px; }
.ft-social a { color: #94a3b8; display: flex; align-items: center; text-decoration: none; }
.ft-links { display: flex; gap: 20px; flex-wrap: wrap; }
.ft-links a { font-size: 13px; color: #64748b; text-decoration: none; }
@media (max-width: 600px) { .ft { padding: 24px 20px; flex-direction: column; align-items: flex-start; } }

/* Nasconde l'eventuale footer del tema WordPress, come gli altri template */
#colophon, .site-footer, footer.footer, #footer, .elementor-location-footer, .wp-footer { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .ai-m365-correlato, .faq-arrow { transition: none; }
}
