/*
 * Nodema : couche d'identité (alignée sur le site et la vidéo).
 * Chargée après saas.css et nodema-backoffice.css / nodema-portal.css.
 * Pour revenir en arrière : retirer le <link> de cette feuille dans les fichiers HTML.
 */

:root {
  --yellow: #13f5bb;
  --yellow-hover: #0fd9a5;
  --nd-sable: #067a5d;
  --nd-yellow-deep: #067a5d;
  --nd-ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Logo Nodema ---------- */
.nodema-mark { display: block; width: auto; height: 100%; color: var(--yellow); flex: none; }
.brand-word { font-family: var(--font-heading, "Nunito", system-ui, sans-serif); font-weight: 900; letter-spacing: -.01em; color: var(--ink); line-height: 1; white-space: nowrap; }

body.backoffice .brand-mark:not(.has-logo)::after,
body.backoffice .brand-mark:not(.has-logo)::before { content: none !important; }

body.backoffice .brand-logo-only, body.backoffice .sidebar .brand-logo-only { display: flex !important; flex-direction: row !important; align-items: center; gap: 12px; min-height: 64px; }
body.backoffice .brand-logo-only .brand-mark:not(.has-logo) { width: auto !important; height: 28px !important; display: inline-flex; align-items: center; background: none !important; box-shadow: none !important; padding: 0 !important; font-size: 0 !important; }
body.backoffice .brand-logo-only .brand-word { font-size: 25px; }
body.backoffice .brand-logo-only .brand-mark.has-logo ~ .brand-word { display: none; }
body.backoffice .login-card .brand-logo-only { justify-content: flex-start; min-height: 0; margin-bottom: 28px; }
body.backoffice .login-card .brand-logo-only .brand-mark:not(.has-logo) { height: 34px !important; }
body.backoffice .login-card .brand-logo-only .brand-word { font-size: 30px; }

#saas-credit-logo, #portal-footer-logo { display: inline-flex; align-items: center; justify-content: center; background: none !important; width: auto !important; min-width: 0 !important; height: 16px !important; padding: 0 !important; font-size: 0 !important; }
#saas-credit-logo .nodema-mark, #portal-footer-logo .nodema-mark { height: 16px; }

/* ---------- Typographie : Nunito 900 pour les titres, comme le site ---------- */
body.backoffice :is(.card-head h3, .card h3, .section-title, .modal h3, .drawer h3, .portal-card h3),
body:not(.backoffice) :is(.card-head h3, .card h3) {
  font-family: var(--font-heading, "Nunito", system-ui, sans-serif);
  font-weight: 900;
  letter-spacing: -.015em;
}
body.backoffice .page-head h1,
body.backoffice .page-title h1,
body.backoffice .content > .page h1 { letter-spacing: -.03em; }
body.backoffice :is(.eyebrow, .page-eyebrow, .overline),
body:not(.backoffice) :is(.eyebrow, .page-eyebrow, .overline) { color: var(--nd-sable); letter-spacing: .12em; font-weight: 900; }
body.backoffice[data-dashboard-theme="dark"] :is(.eyebrow, .page-eyebrow, .overline) { color: var(--yellow); }

/* ---------- Formes ---------- */
body.backoffice :is(.card, .metric) { border-radius: 20px; }
body.backoffice .metric { transition: transform .2s var(--nd-ease), box-shadow .2s var(--nd-ease); }
body.backoffice .metric:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(2, 11, 66, .08); }
body.backoffice :is(.btn, .button) { border-radius: 12px; font-weight: 800; transition: background-color .16s var(--nd-ease), transform .16s var(--nd-ease), box-shadow .16s; }
body.backoffice :is(.btn, .button):not(:disabled):hover { transform: translateY(-1px); }
body.backoffice .btn-primary { background: var(--yellow); color: #020b42; }
body.backoffice .btn-primary:hover { background: var(--yellow-hover); }

/* Barres de progression à l'encre, comme dans la vidéo */
body.backoffice :is(.progress, .progress-bar, .bar) > :is(span, i, div):first-child { background: var(--ink); }

/* ---------- Écran de connexion ---------- */
body.backoffice .login-shell { display: grid; place-items: stretch; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; padding: 0; background: var(--canvas); }
body.backoffice .login-shell .login-card { align-self: center; justify-self: center; width: min(420px, calc(100% - 40px)); margin: 40px 20px; box-shadow: none; background: transparent; border: 0; padding: 0; }
body.backoffice .login-card h1 { font-family: var(--font-heading, "Nunito", sans-serif); font-weight: 900; font-size: 40px; line-height: 1.05; letter-spacing: -.03em; }
.login-visual { margin: 20px; border-radius: 28px; min-height: calc(100vh - 40px); box-sizing: border-box; width: auto; max-width: none; align-self: stretch; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 48px 56px; background: #020b42; color: #f3f5fa; }
.login-visual .lv-brand { display: flex; align-items: center; gap: 12px; height: 32px; }
.login-visual .lv-brand .brand-word { color: #f3f5fa; font-size: 26px; }
.login-visual h2 { margin: 0; font-family: var(--font-heading, "Nunito", sans-serif); font-weight: 900; font-size: clamp(34px, 3.4vw, 52px); line-height: 1.04; letter-spacing: -.03em; max-width: 12ch; }
.login-visual h2 span { color: var(--yellow); }
.lv-stack { position: relative; height: 250px; max-width: 460px; }
.lv-card { position: absolute; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; background: #fff; color: #020b42; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); font-weight: 800; font-size: 15px; white-space: nowrap; }
.lv-card small { display: block; font-weight: 600; font-size: 13px; color: #6b7194; margin-top: 2px; }
.lv-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.lv-ico svg { width: 22px; height: 22px; }
.lv-pill { margin-left: 8px; padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 900; }
.lv-pill.is-pending { background: #f2e4c6; color: #7d5200; }
.lv-pill.is-done { background: #dbe6d9; color: #36623f; }
.lv-card.c1 { top: 0; left: 0; animation: nd-float 6s var(--nd-ease) infinite; }
.lv-card.c2 { top: 92px; left: 70px; animation: nd-float 6s var(--nd-ease) -2s infinite; }
.lv-card.c3 { top: 184px; left: 20px; animation: nd-float 6s var(--nd-ease) -4s infinite; }
.lv-card.c2 .lv-pill { position: relative; }
.lv-card.c2 .lv-pill.is-done { position: absolute; right: 18px; animation: nd-swap 5s steps(1) infinite; }
.lv-card.c2 .lv-pill.is-pending { animation: nd-swap 5s steps(1) -2.5s infinite; }
.lv-foot { font-size: 14px; color: rgba(243, 245, 250, .6); font-weight: 600; }
@keyframes nd-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes nd-swap { 0% { opacity: 1; } 50% { opacity: 0; } }
@media (max-width: 900px) {
  body.backoffice .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
}

/* ---------- Animations d'interface ---------- */
@keyframes nd-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes nd-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
body.backoffice .page.active > *,
body:not(.backoffice) .portal-main > * { animation: nd-rise .42s var(--nd-ease) both; }
body.backoffice .page.active > *:nth-child(2) { animation-delay: .04s; }
body.backoffice .page.active > *:nth-child(3) { animation-delay: .08s; }
body.backoffice .page.active > *:nth-child(4) { animation-delay: .12s; }
body.backoffice .page.active > *:nth-child(5) { animation-delay: .16s; }
body.backoffice .page.active > *:nth-child(n+6) { animation-delay: .2s; }
body:not(.backoffice) .portal-main > *:nth-child(2) { animation-delay: .05s; }
body:not(.backoffice) .portal-main > *:nth-child(3) { animation-delay: .1s; }
body:not(.backoffice) .portal-main > *:nth-child(n+4) { animation-delay: .15s; }
body.backoffice :is(.modal, .drawer):not(.hidden) { animation: nd-pop .24s var(--nd-ease) both; }
body.backoffice .nav-item { transition: background-color .16s var(--nd-ease), color .16s; }
body.backoffice .nav-item .nav-icon { transition: transform .2s var(--nd-ease); }
body.backoffice .nav-item:hover .nav-icon { transform: translateX(2px); }
:is(.badge, .status, .pill, .tag) { transition: background-color .3s var(--nd-ease), color .3s var(--nd-ease); }

@media (prefers-reduced-motion: reduce) {
  body.backoffice .page.active > *, body:not(.backoffice) .portal-main > *, body.backoffice :is(.modal, .drawer, .toast), .lv-card { animation: none !important; }
  body.backoffice .metric:hover, body.backoffice :is(.btn, .button):hover { transform: none; }
}

/* ---------- Identité 2026 : symbole menthe, mot « nodema » marine, Montserrat Alternates + Nunito ---------- */
:root { --nd-mint: #13f5bb; --nd-navy: #020b42; --nd-snow: #fafcff; }
.nodema-mark .nd-sym { fill: var(--nd-mint); }
.nodema-mark .nd-word { fill: var(--nd-ink, var(--ink, #020b42)); }
body[data-dashboard-theme="dark"] .nodema-mark .nd-word, .login-visual .nodema-mark .nd-word { fill: var(--nd-snow); }
.nodema-lockup { display: block; height: 100%; width: auto; overflow: visible; }
body.backoffice .brand-logo-only .brand-mark:not(.has-logo) .nodema-lockup { height: 100%; }
body.backoffice .app-footer .nd-foot-brand .nodema-lockup { height: 15px !important; }
#portal-footer-logo .nodema-lockup, .portal-powered .nodema-lockup { height: 13px !important; }
.login-visual .lv-brand .nodema-lockup { height: 30px; }
body.backoffice .btn, .btn { font-family: var(--font-heading, "Montserrat Alternates", system-ui, sans-serif); font-weight: 600; letter-spacing: -.005em; }
body[data-dashboard-theme="dark"] { --nd-sable: #13f5bb; --nd-yellow-deep: #13f5bb; }
