/**
 * @author Gilles Capelluto - MOLDEREZ-CONSULT
 * @purpose-fr Contrat de présentation jour/nuit global du site, piloté par l’attribut data-theme sur <html>.
 * @purpose-en Global day/night presentation contract for the site, driven by the data-theme attribute on <html>.
 * @audit-scope asset
 * @inputs-fr Attribut data-theme posé par site-theme.js ; classes du bouton .ufm-site-theme-toggle.
 * @inputs-en data-theme attribute set by site-theme.js; .ufm-site-theme-toggle button classes.
 * @effects-fr Définit les variables de la palette nuit et les surcharges de composants ; les cartes publiques d’animaux gardent la palette FUB choisie par le propriétaire.
 * @effects-en Defines the night palette variables and component overrides; public pet cards keep the FUB palette selected by the owner.
 */
:root{
  color-scheme:light;
  --ufm-night-bg:#100d19;
  --ufm-night-surface:#1a1527;
  --ufm-night-surface-2:#241c35;
  --ufm-night-line:#433851;
  --ufm-night-text:#f7f3fb;
  --ufm-night-muted:#c3b9cc;
}

.ufm-site-theme-toggle{
  box-sizing:border-box;position:fixed;z-index:13025;left:18px;
  bottom:calc(88px + env(safe-area-inset-bottom));min-width:48px;height:48px;
  padding:0 15px;display:inline-flex;align-items:center;justify-content:center;gap:9px;
  border:1px solid #d9d0df;border-radius:999px;color:#251a3d;background:#fffdfbf2;
  box-shadow:0 10px 30px #1713271f;-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);
  font:750 .74rem/1 Inter,system-ui,sans-serif;cursor:pointer;touch-action:manipulation;
}
.ufm-site-theme-toggle [data-theme-icon]{font-size:1.12rem;line-height:1}
.ufm-site-theme-toggle:focus-visible{outline:3px solid #ff8066;outline-offset:3px}
.ufm-site-theme-toggle:hover{border-color:#604590;transform:translateY(-1px)}

:root[data-theme="dark"]{
  color-scheme:dark;
  --ink:var(--ufm-night-text);--deep:#f0e8f7;--paper:var(--ufm-night-bg);--white:var(--ufm-night-surface);
  --muted:var(--ufm-night-muted);--line:var(--ufm-night-line);
  --ufm-ink:var(--ufm-night-text);--ufm-icon-color:#ece5f3;--ufm-cream:var(--ufm-night-bg);
  --ufm-primary-soft:#302642;--ufm-secondary-soft:#3b2f50;
  --ufm-surface-ink:var(--ufm-night-text);--ufm-surface-deep:#e9dff3;
  --ufm-surface-paper:var(--ufm-night-surface);--ufm-surface-soft:#2f263e;
  --ufm-surface-line:var(--ufm-night-line);--ufm-surface-muted:var(--ufm-night-muted);
  --ufm-surface-bg:linear-gradient(145deg,#100d19,#171221 58%,#20182f);
  --warm:#1a1527;--lilac:#241c35;--petrol-soft:#193039;
}

:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]){
  color:var(--ufm-night-text)!important;
  background:radial-gradient(circle at 12% 4%,#332447 0,transparent 28rem),linear-gradient(145deg,#100d19,#171221 58%,#20182f)!important;
}
/* brand-signature.css deliberately owns the shared paw canvas with a highly
   specific selector. Override that exact canvas in night mode while keeping
   the same sparse animal trail. */
html:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]):not(.chat-surface):not(.chat-page){
  background-color:#100d19!important;
  background-image:var(--ufm-site-paw-trail),linear-gradient(145deg,#100d19,#171221 58%,#20182f)!important;
}
:root[data-theme="dark"] body.public-card-body{background:#100d19!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(p,small,dd,.lead,.muted){color:var(--ufm-night-muted)}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(input,select,textarea){
  border-color:var(--ufm-night-line)!important;color:var(--ufm-night-text)!important;background:#151020!important;
}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(input,select,textarea)::placeholder{color:#a79daf}

:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(
  .topbar,.nav-row,.ufm-auth-public-header,.ufm-contact-head,.admin-head,.site-header,
  .ufm-global-controls,.mobile-app-nav,.ufm-public-bottom-nav
){border-color:var(--ufm-night-line)!important;color:var(--ufm-night-text)!important;background:#171221ed!important}

:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(
  .hero,.principle,.chat-principle,.help-view,.view,.legal-page main,
  .auth-page-ufoundme,.auth-shell,.dashboard,.studio-page,.pairing-page,
  .ufm-contact-page main,.ufm-guide-page main,.ufm-wall-page main,
  .ufm-blog-page main,.ufm-ulule main,.eshop-page main,.shop-review-page main,
  .section,.section-tint,.legal-section,.resource-library main,.partner-portal .portal-main,
  .cbx .cbx-main
){color:var(--ufm-night-text)!important;background:linear-gradient(145deg,#100d19,#171221 58%,#20182f)!important}

:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(
  .hero-price,.principle-steps li,.chat-benefits article,.help-questions,.help-answer,
  .product-card,.product-option,.summary,.pet-card,.owner-pet-card,.account-card,
  .studio-shell,.studio-editor,.studio-actions,.welcome,.auth-card,.registration-card,
  .login-shell,.login-panel,.mfa-help-dialog,.mfa-help-bar,.mfa-help-safety,
  .legal-page article,.legal-page aside>nav,.contact-form-wrap,.contact-intro aside,
  .pairing-explainer,.pair-device,.pairing-pets,.pairing-pet,.pairing-dialog,
  .blog-card,.blog-article,.blog-related,.guide-card,.wall-card,.wall-story,
  .pricing-card,.use-card,.process-card,.profile-card,.resource-card,.cta-section,
  .panel,.stats article,.overview-grid a,.admin-nav,.wall-admin-empty,
  .wall-admin-history--empty,.wall-admin-cards>article,.wall-reward-list>article,
  .ufm-bo-cart,.ufm-bo-cart article,.mobile-menu-sheet,.ufm-language-menu>div,
  .ufm-owner-menu>div,.ufm-cookie-dialog-shell,.gdpr-alert,.ufm-cookie-banner,
  .demo-film,.action-method-tabs,.meo-tracker-promo,.ufm-purchase-assurance article
  ,.resource-library .library-header,.resource-library .library-contents,
  .resource-library .library-document,.resource-library .library-notice,
  .resource-library .library-question,.resource-library .library-media figure,
  .partner-portal .portal-header,.partner-portal .portal-entry-card,
  .partner-portal .portal-kit,.partner-portal .portal-notice,
  .partner-portal .portal-group,.partner-portal .portal-resource,
  .partner-portal .portal-unavailable,.partner-portal .portal-footer,
  .cbx .cbx-topbar,.cbx .cbx-story,.cbx .cbx-stage,.cbx .cbx-card,
  .cbx .cbx-principles>div,.cbx .cbx-notice,.cbx .cbx-page-footer
){border-color:var(--ufm-night-line)!important;color:var(--ufm-night-text)!important;background:var(--ufm-night-surface)!important}

:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(
  .mobile-sheet-routes a,.mobile-sheet-routes button,.mobile-sheet-account a,
  .mobile-sheet-languages a,.mobile-sheet-tools a,.mobile-sheet-tools button,
  .auth-language,.ufm-auth-language,.ufm-auth-account a,.ufm-auth-cart,.ufm-auth-menu,
  .secondary,.outline,.auth-secondary,.ufm-bo-cart .close,.ufm-bo-cart article button,
  .help-list button,.legal-page aside>nav a,.tabs,.studio-steps
){border-color:var(--ufm-night-line)!important;color:var(--ufm-night-text)!important;background:var(--ufm-night-surface-2)!important}

:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(.styled-qr,.demo-qr-card,.real-product-device,.real-product-qr){color:#171327;background:#fff!important}
:root[data-theme="dark"] .login-body{background:radial-gradient(ellipse at 5% 0%,#332447,transparent 50%),radial-gradient(ellipse at 100% 70%,#20182f,transparent 55%),#100d19!important}
:root[data-theme="dark"] .login-body :is(.login-hint,.login-session,.mfa-help-content p){color:var(--ufm-night-muted)!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(.logo,.login-brand,.admin-brand,.ufm-footer-brand)>img,
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(.ufm-auth-logo,.ufm-contact-head>a:first-child)>img{filter:brightness(0) invert(1)}
:root[data-theme="dark"] .ufm-site-theme-toggle{border-color:#5b4d6c;color:var(--ufm-night-text);background:#241c35ed}

@media(max-width:599px){
  .ufm-site-theme-toggle{left:12px;bottom:calc(78px + env(safe-area-inset-bottom));width:48px;max-width:48px;padding:0}
  .ufm-site-theme-toggle [data-theme-label]{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  html:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]):not(.chat-surface):not(.chat-page){
    background-image:var(--ufm-site-paw-trail-mobile),linear-gradient(145deg,#100d19,#171221 58%,#20182f)!important;
  }
}
@media(prefers-reduced-motion:reduce){.ufm-site-theme-toggle{transition:none!important}}
@media(forced-colors:active){.ufm-site-theme-toggle{border:2px solid ButtonText}}

/* Navigation menu, every page and language: one round menu button and one typographic scale in the panel.
   Labels 15px/600, section title 11px/700 caps, language chips 13px/700; icons 20px; same font everywhere. */
html body :is(.ufm-auth-menu,[data-mobile-menu]):not(.mobile-sheet-routes *){
  width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;aspect-ratio:1/1!important;
  padding:0!important;border-radius:50%!important;justify-content:center!important;align-items:center!important;flex:0 0 44px!important;
}
html body .mobile-menu-sheet,html body .mobile-menu-sheet :is(a,button,p,span,strong,small){font-family:inherit!important;letter-spacing:normal!important}
html body .mobile-menu-sheet :is(.mobile-sheet-account,.mobile-sheet-routes,.mobile-sheet-tools>div)>:is(a,button){
  font-size:15px!important;font-weight:600!important;line-height:1.25!important;text-transform:none!important;
  min-height:48px!important;display:flex!important;align-items:center!important;gap:10px!important;
}
html body .mobile-menu-sheet :is(.mobile-sheet-account,.mobile-sheet-routes,.mobile-sheet-tools>div)>:is(a,button) :is(span,strong){font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important}
html body .mobile-menu-sheet .mobile-sheet-account>:is(a,button){justify-content:center!important}
html body .mobile-menu-sheet :is(.mobile-sheet-routes,.mobile-sheet-tools>div)>:is(a,button) :is(img,svg):not(.menu-aa){width:20px!important;height:20px!important;flex:0 0 20px!important}
html body .mobile-menu-sheet .menu-aa{width:22px!important;height:22px!important;font-size:10px!important;font-weight:700!important;flex:0 0 22px!important}
html body .mobile-menu-sheet .mobile-sheet-tools-title{font-size:11px!important;font-weight:700!important;letter-spacing:.08em!important;text-transform:uppercase!important}
html body .mobile-menu-sheet .mobile-sheet-languages>a{font-size:13px!important;font-weight:700!important;width:44px!important;height:44px!important;border-radius:50%!important;display:inline-grid!important;place-items:center!important}

/* Night-theme audit of 2026-10-26: components missing from the surface list kept a light
   background under light text. Task pages (data-ufm-chrome="none": scan page, chat, call)
   keep their own light palette and are excluded above. */
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(
  .guide-hero,.guide-facts article,.guide-price,.press-copy-grid article,.press-assets article,.press-long,
  .institutional-story,.institutional-company,.institutional-company aside,.institutional-contact,
  .badge-model,.badge-models table,.badge-logistics-card,.contact-audience-options label,
  .legal-translation-note,.legal-pdf-download,.blog-prose aside,.blog-sources,.blog-share,
  .home-credibility-item,.ufm-assurance-item,.product-copy,.product-details
){border-color:var(--ufm-night-line,#433851)!important;color:var(--ufm-night-text,#f7f3fb)!important;background:var(--ufm-night-surface,#1a1527)!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(
  .guide-hero,.guide-facts article,.guide-price,.press-copy-grid article,.institutional-contact,.badge-model,
  .badge-models table,.badge-logistics-card,.contact-audience-options label,.legal-translation-note,.legal-pdf-download,
  .blog-share,.home-credibility-item,.ufm-assurance-item,.product-copy,.product-details
) :is(h1,h2,h3,h4,strong,b,summary,td,th,dt,a,span){color:var(--ufm-night-text,#f7f3fb)!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(#guide-definition-title,#guide-works-title,#blog-share-title,.institutional-section-number,.legal-page article a.contact,.variant-permalink,.product-launch-price strong){color:var(--ufm-night-text,#f7f3fb)!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) .institutional-section-number{background:#2f263e!important}
/* Header logo, links, breadcrumb, bottom navigation and footer mark readable on the night background. */
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(.auth-logo,.topbar .brand,.topbar>a:first-child)>img{filter:brightness(0) invert(1)}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(aside strong a,.contact-intro aside a,.privacy-note a,nav[aria-label] ol>li>a){color:#c9b6f2!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) nav[aria-label] ol>li>span{color:var(--ufm-night-muted,#c3b9cc)!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(.ufm-public-bottom-nav,.ufm-mobile-utility-dock) :is(a,button):not([aria-current="page"]):not(.is-active){color:#a79daf!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) .ufm-footer-ai-mark{color:#fff!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(.blog-card-copy footer span,.blog-card-copy time){color:var(--ufm-night-muted,#c3b9cc)!important}

/* Shared accessibility fixes from the same audit (all pages). */
/* Small orange labels: #ff694d reaches only 2.6:1 on the light paper; a deeper orange keeps the brand tone at 5:1. */
:root:not([data-theme="dark"]) :is(.institutional-eyebrow,.institutional-section-number,.blog-eyebrow,.guide-eyebrow){color:#c2410c!important}
/* Footer links: 44 px touch targets at every width, not only on phones. */
.ufm-footer-grid>nav a{min-height:44px;display:flex;align-items:center}
:is(.ufm-footer-trust,.ufm-footer-bottom) a{min-height:44px;display:inline-flex;align-items:center}
/* The mobile dock already offers Readability and Back to top: the edge tab would sit under it. */
html.ufm-mobile-utility-active .ufm-utility-toggle{display:none!important}
/* "Design de la carte" label: wrap instead of an ellipsis on narrow and medium screens. */
.layout-floating-menu.layout-illustration-cta>span>small{white-space:normal!important;overflow:visible!important;text-overflow:clip!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) :is(.guide-section,.guide-section article,.guide-section tr,.guide-section table){border-color:var(--ufm-night-line,#433851)!important;background:var(--ufm-night-surface,#1a1527)!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) .guide-section :is(h2,h3,h4,td,th,strong,dt){color:var(--ufm-night-text,#f7f3fb)!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) .guide-section :is(p,li,dd,small){color:var(--ufm-night-muted,#c3b9cc)!important}
/* Site footer: same deep night violet on every page (it stayed lavender on some). */
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) footer.ufm-footer{border-top:1px solid var(--ufm-night-line,#433851)!important;color:var(--ufm-night-text,#f7f3fb)!important;background:#171221!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) footer.ufm-footer :is(a,strong,h2,h3,b){color:var(--ufm-night-text,#f7f3fb)!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) footer.ufm-footer :is(p,small,li,span){color:var(--ufm-night-muted,#c3b9cc)!important}
/* Legal centre: its peach backdrop layer belongs to the day theme. */
:root[data-theme="dark"] body.legal-page main::before{display:none!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) .wall-empty{border-color:var(--ufm-night-line,#433851)!important;color:var(--ufm-night-muted,#c3b9cc)!important;background:var(--ufm-night-surface-2,#241c35)!important;box-shadow:none!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) .wall-empty :is(strong,h2,h3,p){color:var(--ufm-night-text,#f7f3fb)!important}

/* Touch targets of at least 44 px (audit of 2026-10-26, D5). */
.pet-preview .mockup-language>summary,.pet-preview .mockup-language nav button{min-width:44px;min-height:44px}
.pet-preview footer button{min-width:44px;min-height:44px}
details.demo-card-languages>summary{min-height:44px;display:flex;align-items:center}
aside.gdpr-alert>a{min-height:44px;display:inline-flex;align-items:center}
:is(.blog-breadcrumb,nav[aria-label]>ol>li)>a,nav[aria-label] ol>li>a{min-height:44px;display:inline-flex;align-items:center}
.blog-card-copy h2 a{display:inline-block;padding-block:8px}
:is(.contact-intro aside a,aside strong a){min-height:44px;display:inline-flex;align-items:center}
/* Inline note references keep their place in the text but get a 44 px hit area. */
sup[id^="ref-"]>a{position:relative}
sup[id^="ref-"]>a::after{content:"";position:absolute;inset:50% auto auto 50%;width:44px;height:44px;transform:translate(-50%,-50%)}

/* Night-theme matrix of 2026-10-26: elements that keep their own light or accent background get dark text,
   and the legal contact chip takes the night surface. */
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) .guide-price>a[href]{color:#171327!important}
:root[data-theme="dark"] body.legal-page:not([data-ufm-chrome="none"]) article a.contact[href]{color:var(--ufm-night-text,#f7f3fb)!important;background:#2a2140!important;border-color:#5a4a78!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) .blog-share>button[type]{color:var(--ufm-night-text,#f7f3fb)!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) .ufm-required-submit:is(:disabled,[aria-disabled="true"]){color:#2b465b!important}
:root[data-theme="dark"] body:not(.public-card-body):not([data-ufm-chrome="none"]) a.skip-link[href]{color:#251a3d!important;background:#fff!important}
