/* ═══════════════════════════════════════
   base.css — Design System EMPOWER v4.1
   ═══════════════════════════════════════ */

:root {
  /* ── Norton ISM Universal — tokens officiels ── */
  --color-primary:      #ad3131;   /* ISM brand primary */
  --color-cta:          #FF6D68;   /* ISM Coral — boutons primaires UNIQUEMENT */
  --color-nav:          #0050FF;   /* Norton Blue — navigation + focus */
  --color-bg:           #f6faff;   /* Fond global */
  --color-surface:      #FFFFFF;   /* Cards */
  --color-surface-alt:  #F5F5F7;   /* Sidebar, blocs secondaires */
  --color-text:         #121d25;
  --color-text-premium: #0E0D30;   /* Titres hero */
  --color-border:       #E8E8ED;
  --color-accent:       #4D9EFF;
  --color-error:        #FA0000;

  /* ── Aliases internes (rétro-compat) ── */
  --c-primary:   #0050FF;
  --c-primary-d: #0037b8;
  --c-cta:       #FF6D68;
  --c-cta-d:     #e85550;
  --c-accent:    #4D9EFF;
  --c-accent-soft: #A8C8FF;
  --c-success:   #00b27e;
  --c-warning:   #f59e0b;
  --c-danger:    #FA0000;
  --c-bg:        #f6faff;          /* fond global */
  --c-surface:   #ffffff;
  --c-surface-alt: #F5F5F7;
  --c-text:      #121d25;
  --c-title:     #0E0D30;
  --c-text-2:    #626264;
  --c-border:    #E8E8ED;
  --radius:      8px;
  --radius-btn:  6px;
  --radius-sm:   4px;
  --shadow:      0 2px 8px rgba(14,13,48,.08);
  --shadow-lg:   0 4px 20px rgba(14,13,48,.12);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-h:    56px;
  --nav-h:       68px;
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Splash ── */
.splash {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100dvh; gap: 6px;
}
.splash-norton {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px; color: var(--c-primary);
}
.splash-norton-mark { width: 52px; height: 52px; }
.splash-norton-mark svg { width: 100%; height: 100%; }
.splash-norton-word {
  font-size: 42px; font-weight: 900; letter-spacing: -1px;
  color: var(--c-primary); line-height: 1;
  font-family: var(--font);
}
.splash-tm { font-size: 13px; font-weight: 400; vertical-align: super; }
.splash-nom {
  font-size: 13px; font-weight: 800; letter-spacing: 0.12em;
  color: var(--c-title); text-transform: uppercase; text-align: center;
  max-width: 260px; line-height: 1.35;
}
.splash-sous  { font-size: 13px; color: var(--c-text-2); }
.splash-spinner {
  width: 26px; height: 26px; margin-top: 20px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Header ── */
.header-vue {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow);
}
.header-vue h1 {
  flex: 1; font-size: 18px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btn-retour {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: var(--c-bg);
  font-size: 18px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

/* ── Boutons ── */
.btn-primaire {
  background: var(--c-cta); color: #fff;
  border: none; border-radius: var(--radius-btn);
  padding: 12px 20px; font-size: 15px; font-weight: 600;
  cursor: pointer; width: 100%;
}
.btn-secondaire {
  background: var(--c-bg); color: var(--c-primary);
  border: 1.5px solid var(--c-primary);
  border-radius: var(--radius-btn);
  padding: 11px 20px; font-size: 15px; font-weight: 600;
  cursor: pointer; width: 100%;
}

/* ── Login — design login_norton_fy27 ── */
.login-page {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100dvh; padding: 32px 20px;
  background: linear-gradient(160deg, #0E0D30 0%, #16233f 55%, #0a1428 100%);
}
.login-carte {
  background: #fff; border-radius: 16px;
  padding: 32px 24px 24px; width: 100%; max-width: 360px;
  box-shadow: 0 8px 40px rgba(0,0,0,.40);
  display: flex; flex-direction: column; gap: 0;
}
/* Norton hero */
.login-norton-hero {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.login-norton-mark { width: 46px; height: 46px; flex-shrink: 0; color: #272727; }
.login-norton-mark .norton-mark { width: 100%; height: 100%; }
.login-norton-word {
  font-size: 38px; font-weight: 900; color: #272727;
  letter-spacing: -1px; line-height: 1;
  font-family: var(--font);
}
.login-tm { font-size: 11px; font-weight: 400; vertical-align: super; }
.login-titre {
  font-size: 11px; font-weight: 800; letter-spacing: 0.13em;
  color: var(--c-title); text-transform: uppercase;
  margin-bottom: 4px; line-height: 1.4;
}
.login-sous  { font-size: 12px; color: var(--c-text-2); margin-bottom: 20px; }
.login-form  { display: flex; flex-direction: column; gap: 12px; }
.login-champ {
  display: flex; align-items: center; gap: 10px;
  background: var(--c-bg); border: 1.5px solid transparent;
  border-radius: var(--radius); padding: 0 14px;
}
.login-champ:focus-within { border-color: var(--c-primary); box-shadow: 0 0 0 2px var(--c-accent-soft); background: #fff; }
.login-champ .champ-icone { font-size: 16px; color: var(--c-text-2); flex-shrink: 0; }
.login-champ input {
  flex: 1; border: none; outline: none; background: transparent;
  padding: 14px 0; font-size: 15px; color: var(--c-text); min-width: 0;
}
.btn-oeil {
  background: none; border: none; cursor: pointer; padding: 0 2px;
  color: var(--c-text-2); flex-shrink: 0; display: flex; align-items: center;
}
.btn-oeil svg { opacity: .45; transition: opacity .2s; }
.btn-oeil:hover svg { opacity: .9; }
.login-oubli { font-size: 12px; color: var(--c-primary); font-weight: 600; text-align: right; text-decoration: none; }
.login-erreur { color: var(--c-danger); font-size: 13px; text-align: center; }
.btn-login {
  background: var(--c-cta); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 14px; font-size: 15px; font-weight: 700;
  cursor: pointer; margin-top: 4px;
}
.btn-login:active { transform: scale(.98); }
.login-marvesting { height: 16px; width: auto; margin: 18px auto 0; display: block; opacity: .55; }
.login-aide { margin-top: 20px; text-align: center; color: #8a96ad; font-size: 12px; line-height: 1.8; }

/* ── Spinner centré ── */
.spinner-centre {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh; color: var(--c-text-2); gap: 12px;
}

/* ── Erreur ── */
.erreur, .erreur-page {
  padding: 24px; text-align: center; color: var(--c-danger);
}

/* ── Toast ── */
#toast-container {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999; width: 90%; max-width: 360px;
  pointer-events: none;
}
.toast {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; text-align: center;
  opacity: 0; transform: translateY(12px);
  transition: all .3s ease; pointer-events: auto;
}
.toast-visible { opacity: 1; transform: translateY(0); }
.toast-info    { background: #1e293b; color: #fff; }
.toast-succes  { background: var(--c-success); color: #fff; }
.toast-warning { background: var(--c-warning); color: #fff; }
.toast-erreur  { background: var(--c-danger);  color: #fff; }

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: flex-end; z-index: 200;
}
.modal {
  background: var(--c-surface); border-radius: 20px 20px 0 0;
  padding: 24px; width: 100%;
  max-height: 90dvh; overflow-y: auto;
  padding-bottom: calc(24px + var(--safe-bottom));
}
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.modal label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; margin-bottom: 12px; }
.modal select, .modal input, .modal textarea {
  border: 1.5px solid var(--c-border); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 15px; outline: none;
}
.modal-btns { display: flex; gap: 10px; margin-top: 16px; }
.modal-btns button { flex: 1; padding: 12px; border-radius: var(--radius); border: none; font-weight: 600; cursor: pointer; }
.modal-btns .btn-primaire { background: var(--c-primary); color: #fff; }

/* ── App brand bar — mobile top header (hidden on desktop) ── */
.app-brand-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 44px;
  background: #fff;
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px;
  box-shadow: 0 1px 6px rgba(14,13,48,.07);
}
.app-brand-logo {
  display: flex; align-items: center; gap: 5px;
  color: #272727; flex-shrink: 0;
}
.app-brand-logo .norton-mark { width: 22px; height: 22px; }
.brand-norton-txt {
  font-size: 17px; font-weight: 900; letter-spacing: -0.5px;
  color: #272727; line-height: 1;
}
.brand-tm { font-size: 8px; font-weight: 400; vertical-align: super; color: #272727; margin-left: 1px; }
.app-brand-sep { color: var(--c-border); font-size: 14px; margin: 0 4px; }
.app-brand-esi {
  font-size: 8.5px; font-weight: 800; letter-spacing: 0.1em;
  color: var(--c-text-2); text-transform: uppercase; line-height: 1;
  flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
@media (min-width: 900px) { .app-brand-bar { display: none; } }

/* Décale le contenu sous la brand bar sur mobile */
@media (max-width: 899px) {
  #app:has(.app-brand-bar) { padding-top: 44px; }
}

/* ── Navigation principale ──
   Mobile : bottom nav (design dashboard_norton_fy27)
   Desktop ≥900px : sidebar navy (design web_dashboard_norton_fy27) */
.nav-principale {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
  display: flex; justify-content: space-around; align-items: center;
  background: var(--c-surface); border-top: 1px solid var(--c-border);
  padding: 6px 4px calc(6px + var(--safe-bottom));
  box-shadow: 0 -2px 12px rgba(14,13,48,.06);
}
.nav-logo { display: none; }
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--c-text-2);
  font-size: 10px; font-weight: 600; padding: 6px 10px; border-radius: 99px;
  min-width: 56px;
}
.nav-icone { font-size: 19px; line-height: 1; }
.nav-item.actif { background: var(--c-cta); color: #fff; }
/* Réserve la hauteur de la bottom nav */
.avec-nav { padding-bottom: calc(76px + var(--safe-bottom)) !important; }

@media (min-width: 900px) {
  .nav-principale {
    top: 0; bottom: 0; right: auto; width: 240px;
    flex-direction: column; justify-content: flex-start; gap: 4px;
    background: var(--c-title); border-top: none;
    padding: 20px 12px; box-shadow: none;
  }
  .nav-logo {
    display: flex; align-items: center; gap: 10px;
    color: #fff; padding: 4px 12px 20px; width: 100%;
    border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 12px;
  }
  .nav-logo .norton-mark { width: 30px; height: 30px; flex-shrink: 0; }
  .nav-logo-textes { display: flex; flex-direction: column; gap: 3px; }
  .nav-logo-norton {
    font-size: 18px; font-weight: 900; letter-spacing: -0.5px;
    color: #fff; line-height: 1;
  }
  .nav-logo-norton sup { font-size: 9px; font-weight: 400; vertical-align: super; }
  .nav-logo-esi {
    font-size: 8px; font-weight: 700; letter-spacing: 0.1em;
    color: rgba(255,255,255,.6); text-transform: uppercase;
  }
  .nav-item {
    flex-direction: row; gap: 10px; width: 100%;
    padding: 11px 14px; border-radius: var(--radius-btn);
    color: #A8C8FF; font-size: 14px; justify-content: flex-start;
  }
  .nav-item:hover { background: rgba(255,255,255,.08); }
  .nav-item.actif { background: var(--c-cta); color: #fff; }
  #app:has(.nav-principale) { padding-left: 240px; }
  body:has(.nav-principale) .barre-actions-fixe,
  body:has(.nav-principale) .q-nav-fixe { left: 240px; }
  .avec-nav { padding-bottom: 24px !important; }
}

/* ── Badge compteur ── */
.badge-compteur { font-size: 12px; background: #f1f5f9; color: var(--c-text-2); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
