/* MPA public visual contract – authoritative final stylesheet.
   The background is drawn exactly once by the outer page, never by its sections.
   Keep the interactive Demo on its original dark product palette. */
:root,html[data-public-theme="dark"]{
  --mpa-chrome:#07182a;
  --mpa-canvas:#07182d;
  --mpa-fg:#f7f9fc;
  --mpa-secondary:#c5d3e4;
  --mpa-card:rgba(12,27,48,.93);
  --mpa-card-border:rgba(105,159,206,.30);
}
html[data-public-theme="light"]{
  --mpa-chrome:#e5f0fa;
  --mpa-canvas:#e7f1fb;
  --mpa-fg:#111827;
  --mpa-secondary:#405166;
  --mpa-card:rgba(250,252,255,.96);
  --mpa-card-border:rgba(64,96,128,.23);
  --public-gold:#111827;
  --public-gold-soft:rgba(17,24,39,.07);
}
html[data-public-theme] body :is(
  .mpa-site,.mpa-features,.mpa-pricing,.mpa-support-public,
  .wishlist-page,.mpa-auth-page,.automation-page,.formation-page,
  .mpa-legal,.mpa-cookie,.mpa-terms,.mpa-data-deletion,.mpa-news-public,
  .accountant-gate-shell,.accountant-portal-shell
){
  background:var(--public-page-background)!important;
  background-size:auto,auto,100% 100%,auto!important;
  background-repeat:no-repeat,no-repeat,no-repeat,no-repeat!important;
  background-position:center top!important;
  background-attachment:scroll!important;
}
/* Keep section semantics and spacing. Eliminate section-sized canvas paintings. */
html[data-public-theme] body :is(.mpa-site,.mpa-features,.mpa-pricing,.mpa-support-public) > main,
html[data-public-theme] body :is(.mpa-site,.mpa-features,.mpa-pricing,.mpa-support-public) > main > section,
html[data-public-theme] body .mpa-site > main .mpa-home-approved,
html[data-public-theme] body .mpa-support-public .support-faq-section,
html[data-public-theme] body .automation-page > main > section,
html[data-public-theme] body .automation-page .automation-section.band,
html[data-public-theme] body .mpa-site .mpa-product-proof-section,
html[data-public-theme] body .mpa-site .mpa-security-section,
html[data-public-theme] body .mpa-site .mpa-apple-showcase-section {
  background:transparent!important;
  border-top-color:transparent!important;
  border-bottom-color:transparent!important;
}
html[data-public-theme="light"] body .mpa-site .mpa-home-approved:is(.light-reboot-bento,.light-reboot-plans){
  background:transparent!important;
}
/* Header and footer use the same EXACT solid per-theme paint, on every route. */
html[data-public-theme] body [data-mpa-public-header] .mpa-unified-header,
html[data-public-theme] body .mpa-unified-footer,
html[data-public-theme] body .automation-page > .automation-footer{
  background:var(--mpa-chrome)!important;
  background-image:none!important;
  border-color:var(--public-header-border)!important;
  color:var(--mpa-fg)!important;
}
.mpa-unified-footer{padding:42px max(18px,calc((100% - 1180px)/2)) 25px;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;}
.mpa-unified-footer-inner{display:grid;grid-template-columns:minmax(170px,1.5fr) repeat(4,minmax(125px,1fr));gap:clamp(20px,3vw,44px)}
.mpa-unified-footer-brand{display:flex;gap:10px;align-items:center;text-decoration:none;font-size:16px;font-weight:900;letter-spacing:-.03em;color:var(--mpa-fg)!important}
.mpa-unified-footer-brand img{height:35px;width:35px;object-fit:contain}
.mpa-unified-footer-brand span span{color:var(--public-accent)}
.mpa-unified-footer p{max-width:235px;color:var(--mpa-secondary)!important;font-size:12px;line-height:1.6}
.mpa-unified-footer-column{display:grid;align-content:start;gap:10px}
.mpa-unified-footer-column strong{color:var(--mpa-fg)!important;font-size:12px}
.mpa-unified-footer-column a{width:fit-content;text-decoration:none;color:var(--mpa-secondary)!important;font-size:12px;line-height:1.5}
.mpa-unified-footer-column a:hover{color:var(--public-accent)!important}
.mpa-unified-footer-newsletter{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:28px;padding:14px 0;border-top:1px solid var(--public-border);color:var(--mpa-secondary);font-size:12px}
.mpa-unified-footer-newsletter a{color:var(--public-accent)!important;font-weight:800;text-decoration:none}
.mpa-unified-footer-newsletter a:hover{text-decoration:underline}
.mpa-unified-footer-bottom{margin-top:30px;padding-top:17px;border-top:1px solid var(--public-border);display:flex;gap:12px;justify-content:space-between;flex-wrap:wrap;color:var(--mpa-secondary)!important;font-size:11px}
.mpa-unified-footer a:focus-visible{outline:2px solid var(--public-accent);outline-offset:4px}
@media(max-width:740px){.mpa-unified-footer-inner{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:420px){.mpa-unified-footer-inner{grid-template-columns:1fr}}
/* Light: all copy is black or slate, including text inside light cards.
   Corporate blue remains the only color of primary CTA surfaces. */
html[data-public-theme="light"] body :is(.mpa-site,.mpa-features,.mpa-pricing,.mpa-support-public,.wishlist-page,.mpa-auth-page,.automation-page,.mpa-legal,.mpa-cookie,.mpa-terms,.mpa-data-deletion,.mpa-news-public) :is(h1,h2,h3,h4,h5,legend,strong){
 color:#111827!important;
}
html[data-public-theme="light"] body :is(.mpa-site,.mpa-features,.mpa-pricing,.mpa-support-public,.wishlist-page,.mpa-auth-page,.automation-page,.mpa-legal,.mpa-cookie,.mpa-terms,.mpa-data-deletion,.mpa-news-public) :is(p,label,small,blockquote,summary){
 color:var(--mpa-secondary)!important;
}
html[data-public-theme="light"] body :is(.mpa-site,.mpa-features,.mpa-pricing,.mpa-support-public) :is(
 .pricing-plan-card,.features-flow-card,.features-flow-step,.features-catalog-section article,
 .pricing-faq,.pricing-trust-card,.mpa-apple-panel,.mpa-apple-context-card,
 .mpa-product-proof-window,.support-category-card,.support-contact-grid>div,
 .support-faq-section details,.light-reboot-bento-card,.light-reboot-plan-card
){
 background:var(--mpa-card)!important;
 color:var(--mpa-fg)!important;
 border-color:var(--mpa-card-border)!important;
}
html[data-public-theme="light"] body .mpa-pricing :is(.pricing-founder-box,.pricing-founder-chip,.pricing-plan-badge,.pricing-hero-kicker),
html[data-public-theme="light"] body .mpa-site :is(.mpa-apple-security-strip,.mpa-apple-showcase-intro>span,.mpa-apple-panel-head>small,.mpa-finance-arriving,.light-reboot-kicker),
html[data-public-theme="light"] body .wishlist-page :is(.wishlist-card-label,.wishlist-kicker),
html[data-public-theme="light"] body .mpa-site .mpa-newsletter-capture>div>div{
 color:#111827!important;
 -webkit-text-fill-color:#111827!important;
}
html[data-public-theme="light"] body .mpa-pricing .pricing-hero-kicker span,
html[data-public-theme="light"] body .wishlist-page .wishlist-hero-intro h1 span{
 background:none!important;color:#111827!important;-webkit-text-fill-color:#111827!important;
}
/* Primary blue buttons: always white text (both modes, including nested icons/text). */
html[data-public-theme] body :is(.mpa-site,.mpa-features,.mpa-pricing,.mpa-support-public,.wishlist-page,.mpa-auth-page,.demo-page,.automation-page,.accountant-gate-shell,.accountant-portal-shell)
 :is(a,button,[role="button"]):is(.mpa-unified-trial,.mpa-unified-callout,.btn-primary,.primary,.demo-action.primary,.automation-button.primary,.auth-submit,.wishlist-submit),
html[data-public-theme] body :is(.mpa-site,.mpa-features,.mpa-pricing,.mpa-support-public,.wishlist-page,.mpa-auth-page,.demo-page,.automation-page)
 :is(a,button)[style*="linear-gradient"]{
 color:#fff!important;
 -webkit-text-fill-color:#fff!important;
}
html[data-public-theme] body .mpa-unified-trial,
html[data-public-theme] body .mpa-unified-popover .mpa-unified-callout{color:#fff!important;-webkit-text-fill-color:#fff!important;}
html[data-public-theme] body :is(.mpa-site,.mpa-features,.mpa-pricing,.mpa-support-public,.demo-page) :is(button,a).primary :is(span,strong,small,svg){
 color:#fff!important;
}
/* More breathing space on the pricing page instead of squeezed cards. */
.mpa-pricing .pricing-plans{gap:clamp(22px,3vw,38px)!important}
.mpa-pricing :is(.pricing-trust-grid,.pricing-founder-content){gap:clamp(16px,2.4vw,28px)!important}
html[data-public-theme="light"] body .mpa-pricing :is(.pricing-plan-card,.pricing-trust-card){
 box-shadow:0 18px 45px rgba(23,63,105,.11)!important;
}
/* Dark: readable labels and values inside bordered, gold-accented cards. */
html[data-public-theme="dark"] body :is(.demo-page,.automation-page,.mpa-features,.mpa-pricing,.mpa-support-public)
 :is(.demo-guide,.demo-preview-note,.demo-sidebar-note,.demo-card,.demo-field,.demo-row,.demo-badge.amber,.growth-panel,.features-flow-step,.pricing-founder-box,.pricing-hero-kicker){
 color:#f6f9fe!important;
}
html[data-public-theme="dark"] body :is(.demo-page,.automation-page,.mpa-features,.mpa-pricing,.mpa-support-public)
 :is(.demo-guide,.demo-preview-note,.demo-sidebar-note,.demo-card,.demo-field,.demo-row,.demo-badge.amber,.growth-panel,.features-flow-step,.pricing-founder-box,.pricing-hero-kicker)
 :is(p,span,small,label,strong,b){
 color:#ecf3fd!important;-webkit-text-fill-color:currentColor!important;
}
html[data-public-theme="dark"] body :is(.demo-page,.automation-page,.mpa-support-public,.formation-page) :is(input,select,textarea,.formation-search input){
 color:#f7fbff!important;-webkit-text-fill-color:#f7fbff!important;
 background:#10233a!important;border-color:rgba(125,184,236,.40)!important;
}
html[data-public-theme="dark"] body :is(.demo-page,.automation-page,.mpa-support-public,.formation-page) :is(input,textarea)::placeholder{
 color:#c1d1e4!important;-webkit-text-fill-color:#c1d1e4!important;opacity:1;
}
/* Demo is a separate, wave-free workspace surface, but it MUST follow the
   same public light/dark choice as every other route. Do not lock both modes dark. */
html[data-public-theme="dark"] body .demo-page{
  --bg:#06111e;--panel:#0a1b2d;--panel2:#0d243b;
  --border:rgba(118,161,198,.26);
  background:#06111e!important;background-image:none!important;
  color:#f8fafc!important;
}
html[data-public-theme="light"] body .demo-page{
  --bg:#e7eaee;--panel:#f1f3f6;--panel2:#ffffff;
  --border:rgba(51,65,85,.20);--accent:#0277b5;--gold:#9a6811;
  --demo-light-bg:#e7eaee;--demo-light-panel:#f1f3f6;
  --demo-light-panel-strong:#dde2e7;--demo-light-input:#ffffff;
  --demo-light-text:#111827;--demo-light-muted:#405469;
  --demo-light-border:rgba(51,65,85,.20);
  background:var(--demo-light-bg)!important;background-image:none!important;
  color:var(--demo-light-text)!important;
}
html[data-public-theme="dark"] body .demo-page :is(.demo-main,.demo-content,.demo-accountant-section),
html[data-public-theme="light"] body .demo-page :is(.demo-layout,.demo-main,.demo-content,.demo-accountant-section){
  background:transparent!important;
}
html[data-public-theme="light"] body .demo-page :is(.demo-sidebar,.demo-public-bar,.demo-topbar,.demo-mobile-nav){
  background:#dde5ed!important;color:var(--demo-light-text)!important;
  border-color:var(--demo-light-border)!important;
}
html[data-public-theme="light"] body .demo-page :is(.demo-card,.demo-kpi,.demo-field,.demo-guide,.demo-conversion,.demo-sidebar-note,.demo-progress){
  background:var(--demo-light-panel)!important;color:var(--demo-light-text)!important;
  border-color:var(--demo-light-border)!important;
  box-shadow:0 10px 26px rgba(30,41,59,.045)!important;
}
html[data-public-theme="light"] body .demo-page .demo-guide{
  background:linear-gradient(90deg,rgba(2,119,181,.09),rgba(255,255,255,.52))!important;
}
html[data-public-theme="light"] body .demo-page :is(h1,h2,h3,h4,strong,.demo-row>b,.demo-field strong,.demo-card-title strong){
  color:#111827!important;-webkit-text-fill-color:#111827!important;
}
html[data-public-theme="light"] body .demo-page :is(p,label,small,.demo-guide span,.demo-heading p,.demo-card-title span,.demo-row small,.demo-field span,.demo-kpi>span,.demo-kpi>small,.demo-topbar p,.demo-sidebar>p,.demo-sidebar-note span){
  color:#405469!important;-webkit-text-fill-color:#405469!important;
}
html[data-public-theme="light"] body .demo-page :is(input,select,textarea,.demo-field.editable input,.demo-title-edit input,.demo-edit-row input,.demo-expense-form input,.demo-extra-form input,.demo-extra-form select){
  background:#fff!important;color:#111827!important;
  -webkit-text-fill-color:#111827!important;border-color:rgba(51,65,85,.23)!important;
}
html[data-public-theme="light"] body .demo-page :is(input,textarea)::placeholder{
  color:#526579!important;-webkit-text-fill-color:#526579!important;opacity:1;
}
html[data-public-theme="light"] body .demo-page :is(.demo-back,.demo-mode,.demo-reset,.demo-action.secondary,.demo-mobile-nav :is(button,a)){
  background:#f1f3f6!important;color:#263b50!important;
  -webkit-text-fill-color:#263b50!important;border-color:var(--demo-light-border)!important;
}
html[data-public-theme="light"] body .demo-page .demo-sidebar nav :is(button,a){
  color:#405469!important;
}
html[data-public-theme="light"] body .demo-page .demo-sidebar nav :is(button,a).active,
html[data-public-theme="light"] body .demo-page .demo-mobile-nav :is(button,a).active{
  color:#075985!important;background:#dcecf8!important;border-color:rgba(2,119,181,.35)!important;
}
html[data-public-theme="light"] body .demo-page :is(.demo-topbar small,.demo-inline-link){
  color:#075985!important;-webkit-text-fill-color:#075985!important;
}
html[data-public-theme="light"] body .demo-page .demo-progress i{background:#c7d0d9!important}
html[data-public-theme="light"] body .demo-page .demo-progress b{
  background:linear-gradient(90deg,#0284c7,#2563eb)!important;
}
html[data-public-theme="light"] body .demo-page .demo-badge.blue{
  background:rgba(2,119,181,.09)!important;color:#075985!important;border-color:rgba(2,119,181,.25)!important;
}
html[data-public-theme="light"] body .demo-page .demo-badge.green{
  background:rgba(22,101,52,.08)!important;color:#166534!important;border-color:rgba(22,101,52,.22)!important;
}
html[data-public-theme="light"] body .demo-page .demo-badge.amber{
  background:rgba(154,104,17,.09)!important;color:#795209!important;border-color:rgba(154,104,17,.23)!important;
}
html[data-public-theme="light"] body .demo-page .demo-badge.purple{
  background:rgba(109,40,217,.07)!important;color:#6d28d9!important;border-color:rgba(109,40,217,.22)!important;
}
html[data-public-theme="light"] body .demo-page .demo-action.primary,
html[data-public-theme="light"] body .demo-page .demo-action.primary :is(span,strong,small,svg){
  color:#fff!important;-webkit-text-fill-color:#fff!important;
}
html[data-public-theme="light"] body .demo-page .demo-kpi.green>strong{color:#166534!important;-webkit-text-fill-color:#166534!important}
html[data-public-theme="light"] body .demo-page .demo-kpi.amber>strong{color:#795209!important;-webkit-text-fill-color:#795209!important}
html[data-public-theme="light"] body .demo-page .demo-kpi.blue>strong{color:#075985!important;-webkit-text-fill-color:#075985!important}
html[data-public-theme="light"] body .demo-page .demo-kpi.purple>strong{color:#6d28d9!important;-webkit-text-fill-color:#6d28d9!important}
/* A single background canvas on Funzionalità: never paint an opaque stripe on
   the catalog band, regardless of inline styles or old preview rules. */
html[data-public-theme] body .mpa-features,
html[data-public-theme] body .mpa-features > main{
  background-color:transparent!important;
}
html[data-public-theme] body .mpa-features main > section.features-catalog-section,
html[data-public-theme] body .mpa-features main > section.features-catalog-section::before,
html[data-public-theme] body .mpa-features main > section.features-catalog-section::after{
  background:transparent!important;background-image:none!important;
  box-shadow:none!important;
}
html[data-public-theme] body .mpa-features main > section.features-catalog-section{
  border-top-color:transparent!important;border-bottom-color:transparent!important;
}
/* The shared header includes the theme switch also on Formazione; keep it
   visible for desktop, compact windows and mobile. */
html[data-public-theme] body [data-mpa-public-header] .mpa-unified-theme{
  display:flex!important;visibility:visible!important;opacity:1!important;
  pointer-events:auto!important;flex-shrink:0;
}
