/* ─── Branding SmartLegal — solution éditrice (commun à tous les tenants) ── */
:root {
    --sl-red: #e7393b;
    --sl-orange: #f18420;
    --sl-yellow: #f7b737;
    --sl-dark: #0d0e12;
    /* Accent de la page de connexion. Défauts = SmartLegal (orange). Un tenant
       en marque blanche les repasse à sa couleur (cf. Layout/auth.tpl.php). */
    --sl-brand-grad: linear-gradient(135deg, hsl(0, 84%, 50%) 0%, hsl(25, 95%, 53%) 40%, hsl(45, 93%, 47%) 100%);
    --sl-btn-grad: linear-gradient(135deg, var(--sl-red), var(--sl-orange), var(--sl-yellow));
    --sl-btn-grad-2: linear-gradient(135deg, var(--sl-red), var(--sl-orange));
    --sl-accent: var(--sl-orange);
    --sl-accent-strong: var(--sl-red);
    --sl-accent-shadow: rgba(231, 57, 59, .25);
    --sl-accent-focus-shadow: rgba(241, 132, 32, .15);
    /* Badges d'icônes du panneau de marque. Défaut = blanc translucide ;
       un tenant avec couleur secondaire (doré Lexipro) les repasse à sa teinte. */
    --sl-panel-icon: #fff;
    --sl-panel-icon-bg: rgba(255, 255, 255, .2);
    --sl-panel-icon-border: rgba(255, 255, 255, .2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    min-height: 100vh;
}

/* ─── Navigation ──────────────────────────────────────────────────────── */
.sl-nav-wrapper { background: linear-gradient(180deg, hsl(220, 20%, 98%) 0%, hsl(0, 0%, 100%) 100%); position: relative; }
.sl-nav { display: flex; align-items: center; justify-content: space-between; padding: 1.5rem 1rem; max-width: 1280px; margin: 0 auto; position: relative; z-index: 20; }
@media (min-width: 640px)  { .sl-nav { padding: 1.5rem; } }
@media (min-width: 1024px) { .sl-nav { padding: 1.5rem 2rem; } }

.sl-nav-logo img { height: 40px; }

.sl-nav-links { display: none; gap: 2rem; }
@media (min-width: 1024px) { .sl-nav-links { display: flex; } }
.sl-nav-links a { color: #6b7280; font-size: .875rem; transition: color .3s; text-decoration: none; }
.sl-nav-links a:hover { color: var(--sl-dark); font-weight: 500; }

/* Le bouton d'accès n'apparaît dans la barre que lorsque le menu mobile
   disparaît — sinon les deux coexistent et le bouton recouvre le logo.
   Il reste accessible en dessous : le menu déroulant le contient déjà.

   Sélecteur composé, et non simple : `.btn-hero-nav` déclare plus bas
   `display: inline-flex`. À spécificité égale la dernière règle gagnait,
   si bien que `.sl-nav-cta { display: none }` n'a jamais rien masqué —
   c'est ce qui produisait le recouvrement jusque sur mobile
   (recette #12793275629). */
.sl-nav .sl-nav-cta { display: none; }
@media (min-width: 1024px) { .sl-nav .sl-nav-cta { display: inline-flex; } }

.sl-nav-hamburger {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border: none; background: transparent; border-radius: .5rem;
    cursor: pointer; color: var(--sl-dark);
    transition: background .2s;
}
.sl-nav-hamburger:hover { background: rgba(0, 0, 0, .05); }
@media (min-width: 1024px) { .sl-nav-hamburger { display: none; } }

.sl-mobile-menu {
    display: none; position: absolute; left: 0; right: 0; top: 72px;
    z-index: 50; background: rgba(255, 255, 255, .97); backdrop-filter: blur(12px);
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 8px 30px -4px rgba(0, 0, 0, .1);
    padding: 1rem;
}
.sl-mobile-menu.open { display: block; }
@media (min-width: 1024px) { .sl-mobile-menu { display: none !important; } }
.sl-mobile-menu a {
    display: block; padding: .75rem 1rem; border-radius: .5rem;
    color: var(--sl-dark); font-weight: 500; font-size: .875rem;
    transition: background .2s; text-decoration: none;
}
.sl-mobile-menu a:hover { background: #f3f4f6; }

.btn-hero-nav {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .625rem 1.5rem; font-size: .875rem; font-weight: 600;
    border-radius: .75rem; border: none;
    background: var(--sl-btn-grad);
    color: #fff; cursor: pointer; text-decoration: none;
    transition: all .3s;
    box-shadow: 0 8px 30px -4px var(--sl-accent-shadow);
}
.btn-hero-nav:hover { transform: scale(1.02); color: #fff; }

/* ─── Auth pages (login + register) ───────────────────────────────────── */
.page-body { display: flex; min-height: calc(100vh - 73px); }

.auth-form-panel {
    width: 40%;
    display: flex; flex-direction: column; justify-content: center;
    padding: 3rem 3.5rem;
    background: #fff;
    position: relative; z-index: 2;
    box-shadow: 8px 0 30px rgba(0, 0, 0, .08);
}
.auth-heading    { text-align: center; }
.auth-heading h1 { font-size: 1.5rem; font-weight: 700; color: var(--sl-dark); margin-bottom: .5rem; }
.auth-heading p  { color: #6b7280; font-size: .875rem; }

.form-label  { font-size: .875rem; font-weight: 500; color: #374151; }
.form-control {
    height: 48px; background: #f9fafb;
    border: 1px solid #e5e7eb; border-radius: .5rem;
    font-size: .875rem;
}
.form-control:focus {
    border-color: var(--sl-accent);
    box-shadow: 0 0 0 3px var(--sl-accent-focus-shadow);
}

.btn-primary-sl {
    background: var(--sl-btn-grad-2);
    border: none; height: 48px;
    font-size: 1rem; font-weight: 600; border-radius: .5rem;
    color: #fff; transition: opacity .2s;
}
.btn-primary-sl:hover { opacity: .9; color: #fff; }

.link-primary-sl { color: var(--sl-accent); text-decoration: none; font-weight: 600; }
.link-primary-sl:hover { color: var(--sl-accent-strong); }

.password-toggle {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: #9ca3af; cursor: pointer; padding: 0;
}
.password-toggle:hover { color: #374151; }

/* ─── Brand panel (right side, marketing) ─────────────────────────────── */
.auth-brand-panel {
    flex: 1;
    background: var(--sl-brand-grad);
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.auth-brand-panel::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, .12) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, .12) 1px, transparent 1px);
    background-size: 60px 60px;
}
.brand-content { position: relative; z-index: 1; max-width: 480px; padding: 3rem; }
.brand-content h2 { font-size: 2rem; font-weight: 700; color: #fff; line-height: 1.3; margin-bottom: 1rem; }
.brand-content > p { color: rgba(255, 255, 255, .8); font-size: 1.125rem; margin-bottom: 3rem; }

.advantage-item { display: flex; align-items: flex-start; gap: 1.25rem; margin-bottom: 2rem; }
.advantage-icon {
    flex-shrink: 0; width: 56px; height: 56px;
    border-radius: 1rem;
    background: var(--sl-panel-icon-bg);
    backdrop-filter: blur(4px);
    border: 1px solid var(--sl-panel-icon-border);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: var(--sl-panel-icon);
}
.advantage-item h3 { color: #fff; font-size: 1.125rem; font-weight: 700; margin-bottom: .25rem; }
.advantage-item p  { color: rgba(255, 255, 255, .75); font-size: .875rem; line-height: 1.6; margin: 0; }

@media (max-width: 991.98px) {
    .auth-brand-panel { display: none; }
    .auth-form-panel  { width: 100%; padding: 2rem 1.5rem; }
}

/* ─── BAN autocomplete (api-adresse.data.gouv.fr) ────────────────────────
 * Dropdown sous l'input adresse pour les pages auth (register, invite…).
 * Le .ban-wrap est inséré dynamiquement par auth.js si le parent direct
 * n'est pas déjà en position relative. */
.ban-wrap        { position: relative; }
.ban-suggestions {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, .08);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1050;
}
/* La liste flotte quand un conteneur la rognerait — une `.card` du module
   de formalités, une modale. Elle est alors posée sur le corps du document
   et suit le champ (cf. ban-autocomplete.js). */
.ban-suggestions.ban-flottant {
    position: fixed; right: auto;
    z-index: 1060;
}

.ban-item {
    display: flex; flex-direction: column; gap: 2px;
    padding: .55rem .75rem;
    cursor: pointer;
    font-size: .8125rem;
    border-bottom: 1px solid #f1f3f6;
}
.ban-item:last-child            { border-bottom: none; }
.ban-item:hover,
.ban-item.active                { background: #f6f7fa; }
.ban-label                      { color: #111; }
.ban-context                    { color: #6b7280; font-size: .6875rem; }

/* ── Page de connexion : entrée de l'espace client ──────────────────
   Le renvoi vers /mon-espace était un lien de 0,85 rem sous la ligne
   « Pas encore de compte ? ». Face à un formulaire complet il ne pesait
   rien, et les particuliers tentaient de se connecter au-dessus
   (recette #12793275629). Il devient un bloc identifiable, sans pour
   autant concurrencer le formulaire : fond neutre, pas de couleur
   d'accentuation — c'est un aiguillage, pas un appel à l'action. */
.sl-acces-client {
    margin-top: 2rem;
    padding: 1.15rem 1.25rem;
    border: 1px solid rgba(13, 14, 18, .1);
    border-radius: .6rem;
    background: #f8f9fb;
    text-align: center;
}
.sl-acces-client-titre {
    margin: 0 0 .3rem;
    font-size: .95rem;
    font-weight: 600;
    color: var(--sl-dark);
}
.sl-acces-client-texte {
    margin: 0 0 .85rem;
    font-size: .825rem;
    line-height: 1.45;
    color: #6b7280;
}
.sl-acces-client-lien {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.1rem;
    border: 1px solid var(--sl-dark);
    border-radius: .45rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--sl-dark);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.sl-acces-client-lien:hover,
.sl-acces-client-lien:focus-visible {
    background: var(--sl-dark);
    color: #fff;
}
