/* core.css — socle applicatif chargé sur toutes les pages (après style.css).
   Contient uniquement ce que le socle JS (main.js) et le layout attendent :
   utilitaire .dn, panneau noscript, toast des messages serveur. Le design
   system du site vit dans style.css / app.css (frontend/ = source de vérité). */

.dn { display: none !important; }

/* Panneau <noscript> (core/head.html) */
.ns {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1.5rem;
  background: #F6F4EF;
  color: #0C1B2B;
  font-family: Montserrat, system-ui, sans-serif;
  text-align: center;
}
.ns h1 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.01em; }
.ns p { max-width: 36rem; font-size: 0.95rem; line-height: 1.6; color: rgba(26, 26, 24, 0.7); }

/* Toast des messages serveur : #app-notif (core/global.html), piloté par
   FRONTEND.notif() / addNotifSystem() dans main.js. */
.nt {
  --nt-accent: #596d80;
  --nt-tint: #edf1f5;
  --nt-duration: 4000ms;
  position: fixed;
  top: max(1.25rem, env(safe-area-inset-top));
  right: max(1.25rem, env(safe-area-inset-right));
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  box-sizing: border-box;
  width: min(26rem, calc(100vw - 2.5rem));
  padding: 1.2rem 0.75rem 1.3rem 1.2rem;
  overflow: hidden;
  border: 1px solid rgba(179, 162, 136, 0.3);
  border-radius: 1rem;
  background: linear-gradient(125deg, #fff, #faf9f6);
  box-shadow: 0 16px 48px -16px rgba(12, 27, 43, 0.24), 0 2px 8px rgba(12, 27, 43, 0.04);
  font-family: Montserrat, system-ui, sans-serif;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(1rem, -0.4rem, 0);
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1), visibility 220ms;
  pointer-events: none;
}
.nt.active { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
.nt[data-tone="green"] { --nt-accent: #2e6b4e; --nt-tint: #eaf3ed; }
.nt[data-tone="red"] { --nt-accent: #a13e3e; --nt-tint: #f9eded; }
.nt[data-tone="yellow"],
.nt[data-tone="orange"] { --nt-accent: #8a5a14; --nt-tint: #f8f0df; }
.nt[data-tone="purple"] { --nt-accent: #725886; --nt-tint: #f1edf6; }
.nt-icon {
  display: grid;
  place-items: center;
  flex: 0 0 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  color: var(--nt-accent);
  background: var(--nt-tint);
}
.nt-icon svg { width: 1.65rem; height: 1.65rem; }
.nt-icon svg > * { stroke-dasharray: 1; stroke-dashoffset: 0; }
.nt.active .nt-ring { animation: nt-draw 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.nt.active .nt-symbol { animation: nt-draw 0.65s 0.2s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.nt-success, .nt-error, .nt-warning { display: none; }
.nt[data-tone="green"] .nt-success,
.nt[data-tone="red"] .nt-error,
.nt[data-tone="yellow"] .nt-warning,
.nt[data-tone="orange"] .nt-warning { display: block; }
.nt[data-tone="green"] .nt-info,
.nt[data-tone="red"] .nt-info,
.nt[data-tone="yellow"] .nt-info,
.nt[data-tone="orange"] .nt-info { display: none; }
.nt-body { flex: 1; min-width: 0; padding-top: 0.1rem; }
.nt-title {
  margin: 0 0 0.3rem;
  color: #0c1b2b;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.015em;
}
.nt .nc {
  font-size: 0.84rem;
  line-height: 1.5;
  color: #53606b;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.nt-close {
  display: grid;
  place-items: center;
  flex: 0 0 2.75rem;
  height: 2.75rem;
  margin: -0.4rem -0.25rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #64707b;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.nt-close svg { width: 1.1rem; height: 1.1rem; }
.nt-close:hover { background: #eeece6; color: #0c1b2b; }
.nt-close:focus-visible { outline: 2px solid var(--nt-accent); outline-offset: -3px; }
.nt .np {
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--nt-accent);
  transform: scaleX(0);
  transform-origin: left;
}
.nt.active .np { animation: nt-countdown var(--nt-duration) linear both; }
@keyframes nt-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes nt-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 640px) {
  .nt {
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    gap: 0.7rem;
    padding: calc(0.9rem + env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) 1rem max(1rem, env(safe-area-inset-left));
    border-width: 0 0 1px;
    border-radius: 0 0 0.85rem 0.85rem;
    transform: translate3d(0, -100%, 0);
  }
  .nt-icon { flex-basis: 2.4rem; height: 2.4rem; }
  .nt-icon svg { width: 1.5rem; height: 1.5rem; }
  .nt .nc { font-size: 0.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .nt, .nt-close { transition: none; }
  .nt { transform: none; }
  .nt.active .nt-ring, .nt.active .nt-symbol, .nt.active .np { animation: none; }
  .nt .np { transform: scaleX(1); }
}

/* Message d'erreur des formulaires publics (contact) */
.is-error { color: #8A2424; }
