/* =========================================================
   NextGescom — Nouvel ecran de connexion
   A charger APRES styles.css :
   <link rel="stylesheet" href="login.css?v=20261010">
   ========================================================= */

#login-screen {
  --ng-orange: #F5922E;
  --ng-orange-dk: #E07A12;
  --ng-navy: #0c4a6e;
  --ng-navy-dk: #082f49;
  --ng-ink: #0f172a;
  --ng-muted: #64748b;
  --ng-line: #e2e8f0;

  position: fixed; inset: 0; z-index: 5000;
  overflow-y: auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  background:
    radial-gradient(1200px 700px at 100% 0%, #fff4e6 0%, rgba(255,244,230,0) 60%),
    radial-gradient(900px 600px at 80% 100%, #fff8ef 0%, rgba(255,248,239,0) 60%),
    #ffffff;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ng-ink);
}

/* ---------- Colonne formulaire ---------- */
.ng-left {
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px 24px; min-height: 100vh; box-sizing: border-box;
}
.ng-form-wrap { width: 100%; max-width: 410px; margin: 0 auto; }

.ng-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; text-decoration: none; }
.ng-logo-mark {
  width: 42px; height: 42px; border-radius: 11px;
  background: linear-gradient(135deg, var(--ng-orange) 0%, var(--ng-orange-dk) 100%);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 20px;
  box-shadow: 0 8px 18px rgba(245,146,46,.35);
}
.ng-logo-txt { font-size: 26px; font-weight: 800; letter-spacing: -0.8px; line-height: 1; }
.ng-logo-txt .brand-next { color: var(--ng-orange); }
.ng-logo-txt .brand-gescom { color: var(--ng-navy); }
.ng-logo-txt small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .6px; color: var(--ng-muted); margin-top: 4px; text-transform: uppercase; }

#login-screen .login-sub {
  display: inline-block; text-align: left; margin: 0 0 12px;
  font-size: 12px; font-weight: 600; color: var(--ng-orange-dk);
  background: #fff1e2; border-radius: 999px; padding: 4px 11px;
}
.ng-title { font-size: 36px; font-weight: 800; letter-spacing: -1px; margin: 0 0 10px; line-height: 1.1; color: var(--ng-ink); }
.ng-title em { font-style: normal; color: var(--ng-orange); }
.ng-desc { color: var(--ng-muted); font-size: 15px; line-height: 1.6; margin: 0 0 30px; }

/* Etape 1 : choix societe */
.ng-step-label { font-size: 13px; font-weight: 600; color: var(--ng-muted); margin: 0 0 12px; }
#societe-list .btn {
  display: flex !important; align-items: center !important; justify-content: flex-start !important;
  width: 100% !important; margin: 0 0 10px !important; padding: 16px 18px !important;
  background: #fff !important; color: var(--ng-ink) !important;
  border: 1px solid var(--ng-line) !important; border-radius: 12px !important;
  font-size: 14.5px !important; font-weight: 700 !important; text-align: left !important;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
#societe-list .btn::after { content: "\203A"; margin-left: auto; font-size: 22px; line-height: 1; color: #cbd5e1; transition: color .15s, transform .15s; }
#societe-list .btn:hover {
  border-color: var(--ng-orange) !important;
  box-shadow: 0 8px 22px rgba(245,146,46,.16); transform: translateY(-1px);
}
#societe-list .btn:hover::after { color: var(--ng-orange); transform: translateX(3px); }

/* Etape 2 : barre societe choisie */
#login-societe-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 22px; padding: 11px 14px;
  background: #f8fafc; border: 1px solid var(--ng-line); border-radius: 12px;
}
#login-societe-nom { font-weight: 700; font-size: 13.5px; color: var(--ng-navy); }
#login-societe-nom::before { content: "\1F3E2  "; }
#btn-changer-societe { font-size: 12.5px; font-weight: 600; color: var(--ng-orange-dk); text-decoration: none; }
#btn-changer-societe:hover { text-decoration: underline; }

/* Champs avec label sur la bordure */
.ng-field { position: relative; margin-bottom: 22px; }
.ng-field label {
  position: absolute; top: -9px; left: 14px; z-index: 1;
  background: #fff; padding: 0 6px;
  font-size: 12px; font-weight: 500; color: var(--ng-muted);
}
.ng-field label i { color: #e11d48; font-style: normal; }
.ng-field .ng-ico {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: #94a3b8; pointer-events: none;
}
.ng-field input {
  width: 100%; box-sizing: border-box; height: 56px;
  padding: 0 48px 0 46px;
  border: 1px solid var(--ng-line); border-radius: 12px;
  background: #fff; color: var(--ng-ink);
  font-size: 15px; font-family: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.ng-field input:focus { border-color: var(--ng-orange); box-shadow: 0 0 0 4px rgba(245,146,46,.15); }
.ng-field:focus-within label, .ng-field:focus-within .ng-ico { color: var(--ng-orange-dk); }
.ng-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; background: transparent; border-radius: 8px;
  display: grid; place-items: center; color: #94a3b8; cursor: pointer;
}
.ng-eye:hover { color: var(--ng-navy); background: #f1f5f9; }
.ng-eye svg { width: 19px; height: 19px; }

#login-remember-row {
  display: flex; align-items: center; gap: 9px;
  margin: -4px 0 22px; font-size: 14px; color: #334155; cursor: pointer; user-select: none;
}
#login-remember { width: 18px; height: 18px; margin: 0; accent-color: var(--ng-orange); cursor: pointer; }

#login-screen .login-error {
  color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 10px; padding: 10px 12px; margin: 0 0 16px; font-size: 13px;
}
#login-screen .login-error:empty { display: none; }

.ng-submit {
  width: 100%; height: 56px; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, var(--ng-orange) 0%, var(--ng-orange-dk) 100%);
  color: #fff; font-size: 16px; font-weight: 700; font-family: inherit; letter-spacing: .2px;
  box-shadow: 0 10px 24px rgba(245,146,46,.35);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.ng-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(245,146,46,.42); filter: brightness(1.03); }
.ng-submit:active { transform: translateY(0); }

#login-screen .login-footer {
  text-align: left; margin-top: 56px;
  font-size: 11.5px; font-weight: 500; letter-spacing: .8px; text-transform: uppercase; color: #94a3b8;
}

/* ---------- Colonne visuelle ---------- */
.ng-right { position: relative; min-height: 100vh; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 40px; box-sizing: border-box; }
.ng-scene { position: relative; width: 100%; max-width: 640px; aspect-ratio: 1 / 1; }

.ng-blob {
  position: absolute; left: 14%; top: 14%; width: 72%; height: 72%;
  border-radius: 36px; transform: rotate(-4deg);
  background: linear-gradient(150deg, var(--ng-orange) 0%, #f9b15f 55%, #ffd29b 100%);
  box-shadow: 0 40px 80px rgba(245,146,46,.28);
}
.ng-blob::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(circle at 25% 20%, rgba(255,255,255,.35), transparent 45%);
}

.ng-card {
  position: absolute; background: #fff; border-radius: 18px;
  box-shadow: 0 20px 45px rgba(15,23,42,.13), 0 2px 6px rgba(15,23,42,.05);
  padding: 16px 18px; box-sizing: border-box;
  animation: ng-float 6s ease-in-out infinite;
}
.ng-card h4 { margin: 0; font-size: 14px; font-weight: 700; color: var(--ng-ink); }
.ng-card .ng-cap { font-size: 11px; color: var(--ng-muted); margin-top: 2px; }

/* Tableau de bord principal */
.ng-dash { left: 22%; top: 22%; width: 66%; padding: 0; overflow: hidden; animation-delay: -1s; }
.ng-dash-top { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid #f1f5f9; }
.ng-dash-top .ng-chip { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-size: 14px; }
.ng-dash-top .ng-dash-name { font-size: 13px; font-weight: 800; margin-right: auto; letter-spacing: -.3px; }
.ng-dash-top .ng-dash-name .a { color: var(--ng-orange); } .ng-dash-top .ng-dash-name .b { color: var(--ng-navy); }
.ng-dash-body { padding: 14px; display: grid; gap: 12px; }
.ng-kpi { border-radius: 14px; padding: 14px; background: linear-gradient(135deg, #fff7ed, #ffedd5); }
.ng-kpi-val { font-size: 24px; font-weight: 800; color: var(--ng-ink); letter-spacing: -.5px; margin-top: 6px; }
.ng-kpi-val small { font-size: 13px; color: var(--ng-muted); font-weight: 600; }
.ng-kpi-trend { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; color: #15803d; background: #dcfce7; padding: 2px 7px; border-radius: 999px; }
.ng-kpi svg { display: block; width: 100%; height: 44px; margin-top: 8px; }
.ng-bars { border-radius: 14px; padding: 14px; background: var(--ng-navy); color: #fff; }
.ng-bars h4 { color: #fff; } .ng-bars .ng-cap { color: #93c5fd; }
.ng-bars-row { display: flex; align-items: flex-end; gap: 6px; height: 64px; margin-top: 10px; }
.ng-bars-row span { flex: 1; border-radius: 4px 4px 2px 2px; background: rgba(255,255,255,.28); }
.ng-bars-row span.hi { background: var(--ng-orange); }

/* Notification paiement */
.ng-notif { right: 0; top: 7%; width: 54%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; animation-delay: -3s; }
.ng-notif .ng-bell { flex: none; width: 38px; height: 38px; border-radius: 11px; background: #fff1e2; color: var(--ng-orange-dk); display: grid; place-items: center; position: relative; }
.ng-notif .ng-bell b { position: absolute; top: -4px; right: -4px; width: 16px; height: 16px; border-radius: 50%; background: #e11d48; color: #fff; font-size: 10px; display: grid; place-items: center; border: 2px solid #fff; }
.ng-notif p { margin: 0; font-size: 12.5px; line-height: 1.4; color: #334155; }
.ng-notif p strong { color: var(--ng-ink); }

/* Facture validee */
.ng-invoice { left: 0; top: 60%; width: 42%; animation-delay: -2s; }
.ng-invoice .ng-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ng-ok { width: 26px; height: 26px; border-radius: 50%; background: #dcfce7; color: #16a34a; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.ng-invoice .ng-lines { margin: 12px 0; display: grid; gap: 6px; }
.ng-invoice .ng-lines span { height: 7px; border-radius: 4px; background: #f1f5f9; }
.ng-invoice .ng-lines span:nth-child(2) { width: 80%; } .ng-invoice .ng-lines span:nth-child(3) { width: 60%; }
.ng-invoice .ng-tot { font-weight: 800; font-size: 16px; color: var(--ng-navy); }
.ng-pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.ng-pill.ok { background: #dcfce7; color: #15803d; }

/* Alerte stock */
.ng-stock { right: 4%; bottom: 6%; width: 44%; animation-delay: -4s; }
.ng-stock .ng-meter { height: 8px; border-radius: 99px; background: #f1f5f9; margin-top: 12px; overflow: hidden; }
.ng-stock .ng-meter span { display: block; height: 100%; width: 92%; border-radius: inherit; background: linear-gradient(90deg, #22c55e, #16a34a); }
.ng-stock .ng-row { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11.5px; color: var(--ng-muted); }
.ng-stock .ng-row b { color: var(--ng-ink); }

.ng-fab {
  position: absolute; top: 28px; right: 28px; width: 54px; height: 54px; border-radius: 16px;
  background: linear-gradient(135deg, var(--ng-orange), var(--ng-orange-dk)); color: #fff;
  display: grid; place-items: center; box-shadow: 0 12px 26px rgba(245,146,46,.4);
}

.ng-modules { position: absolute; left: 0; right: 0; bottom: 26px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 0 20px; }
.ng-modules span { font-size: 12px; font-weight: 600; color: var(--ng-navy); background: rgba(255,255,255,.85); border: 1px solid #fde4c8; padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(4px); }

@keyframes ng-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .ng-card { animation: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .ng-title { font-size: 32px; }
  .ng-card h4 { font-size: 13px; }
}
@media (max-width: 960px) {
  #login-screen { grid-template-columns: 1fr; }
  .ng-right { display: none; }
  .ng-left { padding: 40px 16px; }
}
@media (max-width: 420px) {
  .ng-title { font-size: 28px; }
  .ng-desc { font-size: 14px; margin-bottom: 24px; }
}
