/* ============================================================
   remind-r.eu -- Espace Entreprise -- Page de connexion
   Layout 2 colonnes : showcase navy (gauche) + formulaire (droite).
   Ombres portees, jamais de bordures de couleur. Dark mode + responsive.
   Depend de : variables.css, reset.css, components.css (charges avant).
   ============================================================ */

/* --- Grille plein ecran --- */
.ent-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
}

/* ============================================================
   Colonne gauche -- Showcase de marque
   ============================================================ */
.ent-showcase {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  color: #fff;
  background:
    radial-gradient(120% 120% at 0% 0%, var(--navy-500) 0%, var(--navy-700) 55%, var(--navy-800) 100%);
  isolation: isolate;
}
/* Halo ambre subtil, decoratif (jamais une bordure) */
.ent-showcase::after {
  content: '';
  position: absolute;
  width: 460px;
  height: 460px;
  right: -140px;
  bottom: -160px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle, rgba(245, 166, 35, 0.22) 0%, rgba(245, 166, 35, 0) 70%);
  z-index: -1;
}

.ent-showcase-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
/* Le contenu de la marque showcase est le lockup co-brand (cf. .ent-cobrand-showcase). */

.ent-showcase-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  margin-top: 1.25rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.10);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ent-showcase-badge svg { width: 13px; height: 13px; }

.ent-showcase-body { max-width: 30rem; }
.ent-showcase-body h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

.ent-features { display: flex; flex-direction: column; gap: 1.1rem; }
.ent-feature { display: flex; gap: 0.875rem; align-items: flex-start; }
.ent-feature-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.10);
  box-shadow: var(--shadow-sm);
}
.ent-feature-icon svg { width: 19px; height: 19px; color: var(--amber-300); }
.ent-feature-text h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.ent-feature-text p {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.45;
}

.ent-showcase-footer {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.01em;
}

/* --- Bandeau securite & conformite --- */
.ent-trust { margin-top: 2.25rem; }
.ent-trust-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.625rem;
}
.ent-trust-label svg { width: 14px; height: 14px; color: var(--amber-300); }
.ent-trust-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ent-trust-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.10);
  box-shadow: var(--shadow-sm);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
}

/* --- Honeypot anti-spam : invisible, hors flux, ignore des humains --- */
.ent-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* ============================================================
   Colonne droite -- Panneau formulaire
   ============================================================ */
.ent-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  position: relative;
}

.ent-card {
  width: 100%;
  max-width: 432px;
  background: var(--surface);
  padding: 2.25rem 2.4rem;
  border-radius: var(--radius-lg);
}

/* En-tete mobile (logo) -- masque sur desktop */
.ent-mobile-brand {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}
/* Le contenu du logo mobile est le lockup co-brand (cf. .ent-cobrand-mobile). */

.ent-head { margin-bottom: 1.75rem; }
.ent-head .ent-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-500);
  margin-bottom: 0.5rem;
}
.ent-head h1 {
  font-family: var(--font-heading);
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 0.375rem;
}
.ent-head p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* --- Message d'erreur --- */
.ent-alert {
  display: none;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--danger-light);
  color: var(--danger-dark);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-xs);
}
.ent-alert.is-visible { display: flex; }
.ent-alert svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* --- Formulaire --- */
.ent-form .form-group { margin-bottom: 1rem; }

.ent-input-wrap { position: relative; display: flex; align-items: center; }
.ent-input-wrap .ent-input-icon {
  position: absolute;
  left: 0.75rem;
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  pointer-events: none;
}
.ent-input-wrap .form-input { padding-left: 2.35rem; }
.ent-input-wrap .form-input.has-toggle { padding-right: 2.6rem; }

.ent-toggle {
  position: absolute;
  right: 0.5rem;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.ent-toggle:hover { color: var(--text-secondary); background: var(--n50); }
.ent-toggle:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.ent-toggle svg { width: 17px; height: 17px; }

.ent-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.25rem 0 1.25rem;
  font-size: 0.8125rem;
}
.ent-forgot {
  color: var(--navy-400);
  font-weight: 500;
  transition: color var(--transition-fast);
}
.ent-forgot:hover { color: var(--navy-500); }

.ent-submit { width: 100%; }
.ent-submit svg { width: 17px; height: 17px; }

/* --- Separateur --- */
.ent-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-tertiary);
  font-size: 0.8125rem;
}
.ent-divider::before,
.ent-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* --- SSO --- */
.ent-sso-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.ent-sso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}
.ent-sso:hover { background: var(--n50); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.ent-sso:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.ent-sso svg { width: 16px; height: 16px; }

/* --- Biometrie --- */
.ent-biometric {
  width: 100%;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: none; /* affiche via JS si WebAuthn dispo */
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
  margin-bottom: 1.5rem;
}
.ent-biometric.is-available { display: flex; }
.ent-biometric:hover { border-color: var(--navy-400); color: var(--navy-500); background: var(--navy-50); }
.ent-biometric svg { width: 18px; height: 18px; }

/* --- Pied de carte --- */
.ent-card-footer {
  text-align: center;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}
.ent-card-footer a { color: var(--navy-400); font-weight: 500; }
.ent-card-footer a:hover { color: var(--navy-500); }

/* --- Pied de panneau (langue + legal) --- */
.ent-panel-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
}
.ent-lang { display: flex; gap: 0.25rem; }
.ent-lang-btn {
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-tertiary);
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.ent-lang-btn.active { background: var(--navy-500); color: #fff; border-color: var(--navy-500); }
.ent-lang-btn:hover:not(.active) { background: var(--n50); color: var(--text-primary); }

.ent-legal { display: flex; gap: 1rem; font-size: 0.75rem; }
.ent-legal a { color: var(--text-tertiary); transition: color var(--transition-fast); }
.ent-legal a:hover { color: var(--text-primary); }

/* --- Bouton loading (spinner) --- */
.btn.is-loading { position: relative; color: transparent; pointer-events: none; }
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: var(--radius-full);
  animation: ent-spin 0.6s linear infinite;
}
.btn-accent.is-loading::after { border-top-color: var(--navy-800); }
@keyframes ent-spin { to { transform: rotate(360deg); } }

/* --- Animation d'entree --- */
@keyframes ent-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.ent-card { animation: ent-rise 0.4s ease both; }

/* ============================================================
   Co-branding remind-r x idewe -- lockup partage (cobrand_lockup)
   Le helper rend .cobrand / .brand-mark / .brand-word / .idewe-*.
   Ici on adapte ses couleurs aux deux contextes :
   - showcase navy (texte clair),
   - panneau mobile (texte navy).
   Ombres/halo uniquement, jamais de bordure de couleur.
   ============================================================ */

/* --- Lockup dans le showcase navy (gauche) --- */
.ent-cobrand-showcase .cobrand { gap: 0.7rem; }
.ent-cobrand-showcase .cobrand-rmr { gap: 0.5rem; }
.ent-cobrand-showcase .brand-mark-rmr { color: #fff; }
.ent-cobrand-showcase .brand-word-rmr { color: #fff; font-size: 1.2rem; }
.ent-cobrand-showcase .brand-word-rmr .accent { color: var(--amber-300); }
.ent-cobrand-showcase .cobrand-sep { height: 1.7rem; background: rgba(255, 255, 255, 0.24); }
.ent-cobrand-showcase .idewe-cyan { fill: #5BC4EC; }
.ent-cobrand-showcase .idewe-navy { fill: #CFE8F4; }
.ent-cobrand-showcase .brand-word-idewe { color: #EAF5FB; font-size: 1.15rem; }
.ent-cobrand-showcase .cobrand-eyebrow { color: rgba(255, 255, 255, 0.6); }

/* --- Lockup dans le panneau mobile (texte navy sur fond clair) ---
   La visibilite (none/flex) reste pilotee par .ent-mobile-brand + responsive. */
.ent-cobrand-mobile .cobrand { gap: 0.6rem; justify-content: center; }
.ent-cobrand-mobile .brand-mark-rmr { color: var(--navy-500); }
.ent-cobrand-mobile .brand-word-rmr { color: var(--navy-500); font-size: 1.1rem; }
.ent-cobrand-mobile .brand-word-rmr .accent { color: var(--amber-400); }
.ent-cobrand-mobile .cobrand-sep { height: 1.4rem; }
.ent-cobrand-mobile .brand-word-idewe { font-size: 1.05rem; }

/* ============================================================
   Marketing sensoriel -- profondeur tactile specifique au login.
   (Les micro-interactions de base des .btn/.form-input viennent de
   components.css ; on enrichit ici le showcase + le CTA + les pills.)
   ============================================================ */

/* Carte formulaire : matiere plus presente, elevation au repos */
.ent-card { box-shadow: var(--shadow-xl, var(--shadow-lg)); border-radius: var(--radius-lg); }
.ent-panel { background: var(--bg); }

/* Cartes "feature" du showcase : reagissent au survol (toucher visuel) */
.ent-feature {
  border-radius: var(--radius-md);
  padding: 0.35rem 0.4rem;
  margin: -0.35rem -0.4rem;
  transition: transform var(--dur-2, 0.2s) var(--ease-out-soft, ease),
              background var(--dur-2, 0.2s) ease;
}
.ent-feature:hover {
  transform: translateY(var(--lift-1, -1px));
  background: rgba(255, 255, 255, 0.05);
}
.ent-feature-icon {
  transition: transform var(--dur-2, 0.2s) var(--ease-spring, ease),
              box-shadow var(--dur-2, 0.2s) ease;
}
.ent-feature:hover .ent-feature-icon {
  transform: translateY(var(--lift-1, -1px)) scale(1.03);
  box-shadow: var(--shadow-md), var(--glow-idewe);
}

/* Badge "espace entreprise" : reflet anime au survol (sheen) */
.ent-showcase-badge {
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-2, 0.2s) var(--ease-out-soft, ease);
}
.ent-showcase-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--sheen);
  transform: translateX(-120%);
  transition: transform var(--dur-4, 0.5s) var(--ease-out-soft, ease);
  pointer-events: none;
}
.ent-showcase:hover .ent-showcase-badge::before { transform: translateX(120%); }

/* Bandeau trust : pills tactiles (profondeur + leger lift, jamais de bordure) */
.ent-trust-badge {
  transition: transform var(--dur-2, 0.2s) var(--ease-spring, ease),
              box-shadow var(--dur-2, 0.2s) ease,
              background var(--dur-2, 0.2s) ease;
  cursor: default;
}
.ent-trust-badge:hover {
  transform: translateY(var(--lift-1, -1px));
  background: rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-md);
}

/* CTA principal : halo ambre + sceau de profondeur (hierarchie immediate) */
.ent-submit {
  position: relative;
  box-shadow: var(--shadow-md);
  transition: transform var(--dur-2, 0.2s) var(--ease-out-soft, ease),
              box-shadow var(--dur-2, 0.2s) var(--ease-out-soft, ease);
}
.ent-submit:hover {
  transform: translateY(var(--lift-2, -3px));
  box-shadow: var(--shadow-lg), var(--glow-amber);
}
.ent-submit:active { transform: translateY(var(--press-1, 1px)); box-shadow: var(--shadow-press); }
.ent-submit:focus-visible { outline: none; box-shadow: var(--shadow-md), var(--glow-amber); }
/* Glisse de fleche : la fleche avance au survol (micro-feedback de direction) */
.ent-submit svg { transition: transform var(--dur-2, 0.2s) var(--ease-out-soft, ease); }
.ent-submit:hover svg { transform: translateX(2px); }

/* SSO / biometrie : enfoncement net au clic (retour tactile) */
.ent-sso:active { transform: translateY(var(--press-1, 1px)); box-shadow: var(--shadow-press); }
.ent-biometric { transition: color var(--transition-fast), border-color var(--transition-fast),
                              background var(--transition-fast), transform var(--dur-2, 0.2s) var(--ease-out-soft, ease); }
.ent-biometric:hover { transform: translateY(var(--lift-1, -1px)); }
.ent-biometric:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* Liens (mot de passe oublie / lien magique / legal) : soulignement revele */
.ent-forgot, .ent-card-footer a, .ent-lang-btn, .ent-legal a {
  transition: color var(--transition-fast), background var(--transition-fast),
              transform var(--dur-1, 0.12s) var(--ease-out-soft, ease);
}
.ent-lang-btn:active { transform: translateY(var(--press-1, 1px)); }

/* ============================================================
   Dark mode
   ============================================================ */
[data-theme="dark"] .ent-showcase {
  background:
    radial-gradient(120% 120% at 0% 0%, var(--navy-600) 0%, var(--navy-800) 60%, var(--navy-900) 100%);
}
[data-theme="dark"] .ent-sso { background: var(--surface); }
/* Lockup mobile en dark : la marque remind-r s'eclaircit pour rester lisible */
[data-theme="dark"] .ent-cobrand-mobile .brand-mark-rmr,
[data-theme="dark"] .ent-cobrand-mobile .brand-word-rmr { color: var(--navy-200, #cdd7ea); }
[data-theme="dark"] .ent-cobrand-mobile .brand-word-rmr .accent { color: var(--amber-300); }
/* La carte garde une elevation perceptible sur fond sombre */
[data-theme="dark"] .ent-card { box-shadow: var(--shadow-2xl, var(--shadow-xl)); }

/* ============================================================
   Responsive -- breakpoints canoniques remind-r
   480 / 768 / 1024 / 1280 / 1440 / 1920
   Strategie : fluide (clamp/minmax/%) entre les paliers ; bascule
   1 colonne sous 1024 (showcase masque, marque mobile co-brandee).
   ============================================================ */

/* >= 1920 : grands ecrans -- on respire, on densifie la matiere visuelle */
@media (min-width: 1920px) {
  .ent-showcase { padding: 4.5rem; }
  .ent-showcase-body { max-width: 34rem; }
  .ent-showcase-body h2 { font-size: clamp(2rem, 1.4vw + 1.4rem, 2.6rem); }
  .ent-card { max-width: 440px; }
  .ent-panel { padding: 3rem 2rem; }
}

/* 1440 - 1919 : desktop large */
@media (min-width: 1440px) and (max-width: 1919.98px) {
  .ent-showcase { padding: 3.75rem; }
  .ent-showcase-body { max-width: 32rem; }
  .ent-card { max-width: 420px; }
}

/* 1280 - 1439 : desktop standard (proportions de reference) */
@media (min-width: 1280px) and (max-width: 1439.98px) {
  .ent-showcase { padding: 3.25rem; }
}

/* 1024 - 1279 : petit desktop / grande tablette paysage -- on resserre la colonne */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .ent-auth { grid-template-columns: 1fr 1fr; }
  .ent-showcase { padding: 2.5rem; }
  .ent-showcase-body h2 { font-size: 1.75rem; margin-bottom: 1.5rem; }
  .ent-features { gap: 0.9rem; }
  .ent-feature-icon { width: 36px; height: 36px; }
  .ent-trust { margin-top: 1.75rem; }
  .ent-panel { padding: 2.25rem 1.25rem; }
}

/* < 1024 : bascule une colonne -- le showcase laisse place au formulaire */
@media (max-width: 1023.98px) {
  .ent-auth { grid-template-columns: 1fr; }
  .ent-showcase { display: none; }
  .ent-mobile-brand { display: flex; }
  .ent-panel { min-height: 100vh; }
}

/* 768 - 1023 : tablette -- carte centree confortable */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .ent-panel { padding: 3rem 2rem; }
  .ent-card { max-width: 440px; }
  .ent-head h1 { font-size: 1.75rem; }
}

/* 480 - 767 : grand mobile / petite tablette portrait */
@media (min-width: 480px) and (max-width: 767.98px) {
  .ent-panel { padding: 2.25rem 1.5rem; }
  .ent-card { max-width: 100%; }
}

/* < 480 : mobile -- empilement, cibles tactiles genereuses */
@media (max-width: 479.98px) {
  .ent-panel { padding: 1.75rem 1.15rem; }
  .ent-card { max-width: 100%; }
  .ent-mobile-brand { margin-bottom: 1.4rem; }
  .ent-head { margin-bottom: 1.4rem; }
  .ent-head h1 { font-size: 1.45rem; }
  .ent-head p { font-size: 0.875rem; }
  .ent-sso-grid { grid-template-columns: 1fr; }
  .ent-options { flex-wrap: wrap; gap: 0.5rem; }
  .ent-panel-footer { gap: 0.85rem; margin-top: 1.5rem; }
  .ent-legal { flex-wrap: wrap; justify-content: center; gap: 0.5rem 1rem; }
  /* Cibles tactiles >= 44px (lignes directrices mobiles) */
  .ent-sso { height: 46px; }
  .ent-toggle { width: 34px; height: 34px; }
}

/* Tres petits ecrans : on garde l'accolade du wordmark mobile lisible */
@media (max-width: 360px) {
  .ent-cobrand-mobile .brand-word-rmr,
  .ent-cobrand-mobile .brand-word-idewe { font-size: 0.95rem; }
}

/* Accessibilite : respect du prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .ent-card { animation: none; }
  .btn.is-loading::after { animation: none; }
  .ent-sso:hover { transform: none; }
  .ent-feature:hover,
  .ent-trust-badge:hover,
  .ent-showcase-badge:hover { transform: none; }
  .ent-submit::after { display: none; }
}
