/**
 * b2c.css — Espace client (charte smartlegal.fr).
 *
 * Isolé de `app.css` (staff) et de `smartlegal.css` (landing) pour :
 *   1. Ne pas alourdir les bundles staff avec du CSS consumer inutile.
 *   2. Pouvoir évoluer indépendamment (test A/B branding, palette
 *      spécifique widget) sans risquer de régresser l'admin.
 *
 * Palette et typo héritées de smartlegal.css :
 *   --sl-primary  (rouge du tenant, override côté layout)
 *   --sl-dark     #0d0e12
 *   --sl-light-bg #f8f9fa
 *   Inter comme font principale
 */

/* ─── Structure de page ─────────────────────────────────────────── */
.b2c-body {
    background: var(--sl-light-bg, #f8f9fa);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--sl-dark, #0d0e12);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
.b2c-main { flex: 1; padding: 2rem 0 3rem; }
.b2c-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ─── Header ────────────────────────────────────────────────────── */
.b2c-header {
    background: #fff;
    border-bottom: 1px solid rgba(13, 14, 18, .08);
    padding: .75rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 10;
}
.b2c-header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.b2c-logo {
    display: inline-flex;
    /* `center` (pas `baseline`) pour que le texte « Espace client »
       s'aligne verticalement au milieu du logo image plutôt que sur
       la baseline (qui donnait un décalage visuel vers le bas). */
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    color: var(--sl-dark);
}
.b2c-logo img { height: 32px; width: auto; }
.b2c-logo-text {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--sl-dark);
}
.b2c-logo-suffix {
    font-size: .85rem;
    color: rgba(13, 14, 18, .55);
    font-weight: 400;
}
.b2c-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.b2c-user-name {
    font-size: .9rem;
    color: rgba(13, 14, 18, .75);
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.b2c-user-name i { font-size: 1.15rem; color: var(--sl-primary); }
.b2c-logout-form { margin: 0; }

/* Sélecteur de société — visible seulement quand une adresse en porte
   plusieurs (cf. recette #13277808498). Même grammaire que le reste de
   l'entête : discret, aligné, sans bouton quand JS répond. */
.b2c-societe-form {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.b2c-societe-label {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .85rem;
    color: rgba(13, 14, 18, .55);
}
.b2c-societe-label i { font-size: 1.05rem; color: var(--sl-primary); }
.b2c-societe-select {
    border: 1px solid rgba(13, 14, 18, .12);
    border-radius: 6px;
    padding: .35rem .6rem;
    font-size: .85rem;
    color: rgba(13, 14, 18, .8);
    background: #fff;
    max-width: 16rem;
}
.b2c-societe-select:focus-visible { outline: 2px solid var(--sl-primary); outline-offset: 1px; }
@media (max-width: 640px) {
    .b2c-societe-legende { display: none; }
    .b2c-societe-select  { max-width: 9rem; }
}
.b2c-btn-ghost {
    background: transparent;
    border: 1px solid rgba(13, 14, 18, .12);
    color: rgba(13, 14, 18, .75);
    padding: .4rem .8rem;
    border-radius: 6px;
    font-size: .85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    transition: border-color .15s, color .15s;
}
.b2c-btn-ghost:hover {
    border-color: var(--sl-primary);
    color: var(--sl-primary);
}

/* ─── Footer ────────────────────────────────────────────────────── */
.b2c-footer {
    background: #fff;
    border-top: 1px solid rgba(13, 14, 18, .08);
    padding: 1rem 1.25rem;
    font-size: .85rem;
    color: rgba(13, 14, 18, .55);
}
.b2c-footer-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.b2c-footer a { color: inherit; text-decoration: underline; }
.b2c-footer a:hover { color: var(--sl-primary); }
.b2c-footer-sep { color: rgba(13, 14, 18, .25); }

/* ─── Cards + formulaires ─────────────────────────────────────── */
.b2c-card {
    background: #fff;
    border: 1px solid rgba(13, 14, 18, .08);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(13, 14, 18, .04);
}
.b2c-card + .b2c-card { margin-top: 1rem; }
.b2c-card-title {
    margin: 0 0 .35rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--sl-dark);
}
.b2c-card-lead {
    margin: 0 0 1.5rem;
    color: rgba(13, 14, 18, .65);
    font-size: .95rem;
}
.b2c-field { margin-bottom: 1rem; }
.b2c-field label {
    display: block;
    font-size: .85rem;
    font-weight: 500;
    color: rgba(13, 14, 18, .75);
    margin-bottom: .35rem;
}
.b2c-input {
    width: 100%;
    padding: .65rem .85rem;
    font-size: 1rem;
    background: #fff;
    color: var(--sl-dark);
    border: 1px solid rgba(13, 14, 18, .18);
    border-radius: 8px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.b2c-input:focus {
    outline: none;
    border-color: var(--sl-primary);
    box-shadow: 0 0 0 3px rgba(231, 57, 59, .12);
}
.b2c-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .7rem 1.2rem;
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(135deg, var(--sl-primary), #f18420);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    width: 100%;
    transition: opacity .15s, transform .1s;
}
.b2c-btn-primary:hover { opacity: .95; color: #fff; }
.b2c-btn-primary:active { transform: translateY(1px); }

/* ─── Alerts (flash success/error) ────────────────────────────── */
.b2c-alert {
    padding: .85rem 1rem;
    border-radius: 8px;
    font-size: .9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: .5rem;
}
.b2c-alert i { margin-top: 2px; flex-shrink: 0; }
.b2c-alert-error {
    background: rgba(231, 57, 59, .08);
    color: #a01a1c;
    border: 1px solid rgba(231, 57, 59, .18);
}
.b2c-alert-success {
    background: rgba(52, 168, 83, .08);
    color: #14701a;
    border: 1px solid rgba(52, 168, 83, .18);
}

/* ─── Toggle password/lien ─────────────────────────────────────── */
.b2c-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.5rem;
    padding: .3rem;
    background: rgba(13, 14, 18, .04);
    border-radius: 10px;
}
.b2c-tab {
    flex: 1;
    text-align: center;
    padding: .5rem .8rem;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: rgba(13, 14, 18, .55);
    font-size: .88rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.b2c-tab:hover { color: var(--sl-dark); }
.b2c-tab.is-active {
    background: #fff;
    color: var(--sl-dark);
    box-shadow: 0 1px 2px rgba(13, 14, 18, .06);
}

/* ─── Dashboard welcome ────────────────────────────────────────── */
.b2c-welcome-hero {
    margin-bottom: 2rem;
}
.b2c-welcome-hero h1 {
    font-size: 1.85rem;
    font-weight: 700;
    margin: 0 0 .35rem;
    color: var(--sl-dark);
}
.b2c-welcome-hero p {
    margin: 0;
    color: rgba(13, 14, 18, .65);
}
.b2c-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.b2c-module-card {
    background: #fff;
    border: 1px solid rgba(13, 14, 18, .08);
    border-radius: 10px;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    transition: border-color .12s, transform .12s, box-shadow .12s;
}
.b2c-module-card:hover:not(.is-disabled) {
    border-color: var(--sl-primary);
    box-shadow: 0 2px 8px rgba(13, 14, 18, .06);
    transform: translateY(-1px);
    color: inherit;
}
.b2c-module-card.is-disabled { opacity: .55; cursor: default; }
.b2c-module-icon {
    font-size: 1.5rem;
    color: var(--sl-primary);
}
.b2c-module-card h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.b2c-module-badge {
    display: inline-block;
    background: rgba(13, 14, 18, .08);
    color: rgba(13, 14, 18, .55);
    padding: .1rem .5rem;
    font-size: .68rem;
    font-weight: 500;
    border-radius: 999px;
}
.b2c-module-card p {
    margin: 0;
    font-size: .85rem;
    color: rgba(13, 14, 18, .55);
}

/* ─── Page /mon-espace/nouvelle-annonce (widget host) ────────────── */
.b2c-annonce-header {
    margin-bottom: 1.5rem;
}
.b2c-annonce-header h1 {
    font-size: 1.65rem;
    font-weight: 700;
    margin: .75rem 0 .35rem;
    color: var(--sl-dark);
}
.b2c-annonce-header .b2c-lead {
    margin: 0;
    color: rgba(13, 14, 18, .65);
    font-size: .95rem;
}
.b2c-back-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .88rem;
    color: rgba(13, 14, 18, .55);
    text-decoration: none;
    transition: color .12s;
}
.b2c-back-link:hover { color: var(--sl-primary); }

/* Cadre du widget — le widget lui-même est un web component avec
   son propre shadow DOM ; on ne peut pas surcharger son style,
   on lui pose juste un conteneur cohérent avec le reste de l'espace
   client. */
.b2c-widget-shell {
    background: #fff;
    border: 1px solid rgba(13, 14, 18, .08);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(13, 14, 18, .04);
    min-height: 400px;
}

/* Variante « primary » sur la carte Publier une annonce — met en
   avant l'action principale attendue depuis l'espace client. */
.b2c-module-card-primary {
    border-color: var(--sl-primary);
    background: linear-gradient(135deg, #fff 0%, rgba(231, 57, 59, .04) 100%);
}
.b2c-module-card-primary .b2c-module-icon {
    color: var(--sl-primary);
}

/* ─── Page head partagée (dossiers, coordonnées…) ─────────────── */
.b2c-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.b2c-page-head h1 {
    font-size: 1.65rem;
    font-weight: 700;
    margin: .5rem 0 .35rem;
    color: var(--sl-dark);
}
.b2c-page-head .b2c-lead {
    margin: 0;
    color: rgba(13, 14, 18, .65);
    font-size: .95rem;
}
.b2c-btn-inline {
    background: var(--sl-primary);
    border-color: var(--sl-primary);
    color: #fff;
    text-decoration: none;
    padding: .55rem 1rem;
    border-radius: 8px;
    font-size: .9rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.b2c-btn-inline:hover { opacity: .95; color: #fff; }

/* Empty state générique */
.b2c-empty-state {
    background: #fff;
    border: 1px dashed rgba(13, 14, 18, .18);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    color: rgba(13, 14, 18, .6);
}
.b2c-empty-state i {
    font-size: 2.5rem;
    color: rgba(13, 14, 18, .3);
    display: block;
    margin-bottom: .75rem;
}
.b2c-empty-state h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--sl-dark);
    margin: 0 0 .5rem;
}
.b2c-empty-state p { margin: 0 0 1.25rem; }

/* ─── Tableau dossiers ─────────────────────────────────────────── */
/* `overflow: visible` (pas `hidden`) pour que le menu Actions puisse
   déborder du cadre — sinon le popup est clip par la card. Les coins
   arrondis reposent sur le radius de la card + celui des cellules
   thead/tbody bordantes (voir plus bas). */
.b2c-card-flush { padding: 0; overflow: visible; }
.b2c-dossiers-table {
    width: 100%;
    border-collapse: collapse;
}
.b2c-dossiers-table thead th:first-child { border-top-left-radius: 12px; }
.b2c-dossiers-table thead th:last-child  { border-top-right-radius: 12px; }
.b2c-dossiers-table tbody tr:last-child td:first-child { border-bottom-left-radius: 12px; }
.b2c-dossiers-table tbody tr:last-child td:last-child  { border-bottom-right-radius: 12px; }
.b2c-dossiers-table th {
    text-align: left;
    padding: .75rem 1rem;
    font-size: .78rem;
    font-weight: 600;
    color: rgba(13, 14, 18, .55);
    text-transform: uppercase;
    letter-spacing: .04em;
    background: rgba(13, 14, 18, .03);
    border-bottom: 1px solid rgba(13, 14, 18, .08);
}
.b2c-dossiers-table td {
    padding: .85rem 1rem;
    border-bottom: 1px solid rgba(13, 14, 18, .06);
    vertical-align: top;
    font-size: .9rem;
}
.b2c-dossiers-table tr:last-child td { border-bottom: none; }
.b2c-dossiers-table .text-right { text-align: right; }
.b2c-dossier-ref { font-weight: 600; color: var(--sl-dark); }
.b2c-dossier-desig,
.b2c-dossier-journal { font-size: .82rem; color: rgba(13, 14, 18, .55); margin-top: .15rem; }
.b2c-dossier-type { color: var(--sl-dark); }
.b2c-dossier-actions {
    display: inline-flex;
    flex-direction: column;
    gap: .3rem;
    align-items: flex-end;
}
.b2c-doc-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .65rem;
    background: rgba(231, 57, 59, .08);
    color: var(--sl-primary);
    border-radius: 6px;
    text-decoration: none;
    font-size: .82rem;
    font-weight: 500;
    transition: background .12s;
}
.b2c-doc-link:hover {
    background: rgba(231, 57, 59, .15);
    color: var(--sl-primary);
}

/* ─── Menu dropdown Actions (colonne dossiers) ─────────────────
   Basé sur <details>/<summary> pour éviter tout JS. Le panel
   s'affiche au clic via le state open natif du <details>. */
.b2c-menu {
    display: inline-block;
    position: relative;
    text-align: left;
}
.b2c-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .85rem;
    background: #fff;
    border: 1px solid rgba(13, 14, 18, .18);
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 500;
    color: var(--sl-dark);
    cursor: pointer;
    list-style: none;      /* retire la puce triangle native */
    user-select: none;
}
.b2c-menu-trigger::-webkit-details-marker { display: none; }
.b2c-menu-trigger:hover { border-color: var(--sl-primary); color: var(--sl-primary); }
.b2c-menu[open] > .b2c-menu-trigger .bi-chevron-down {
    transform: rotate(180deg);
    transition: transform .12s;
}
.b2c-menu-panel {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid rgba(13, 14, 18, .12);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(13, 14, 18, .1);
    padding: .35rem;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.b2c-menu-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    color: var(--sl-dark);
    text-decoration: none;
    font-size: .88rem;
    border-radius: 6px;
    white-space: nowrap;
    transition: background .1s;
}
.b2c-menu-item:hover { background: rgba(13, 14, 18, .04); color: var(--sl-dark); }
.b2c-menu-item i { width: 16px; color: rgba(13, 14, 18, .55); }
.b2c-menu-item-primary {
    background: rgba(231, 57, 59, .08);
    color: var(--sl-primary);
    font-weight: 500;
}
.b2c-menu-item-primary i { color: var(--sl-primary); }
.b2c-menu-item-primary:hover { background: rgba(231, 57, 59, .15); color: var(--sl-primary); }

/* Badges statut */
.b2c-badge {
    display: inline-block;
    padding: .2rem .55rem;
    font-size: .75rem;
    font-weight: 500;
    border-radius: 999px;
}
.b2c-badge.is-ok      { background: rgba(52, 168, 83, .12); color: hsl(142, 60%, 25%); }
.b2c-badge.is-warn    { background: rgba(247, 183, 55, .18); color: hsl(38, 80%, 30%); }
.b2c-badge.is-neutral { background: rgba(13, 14, 18, .08);  color: rgba(13, 14, 18, .55); }

/* ─── Formulaire coordonnées ──────────────────────────────────── */
.b2c-form-section {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sl-dark);
    margin: 0 0 .5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(13, 14, 18, .06);
}
.b2c-form-section:first-of-type {
    padding-top: 0;
    border-top: none;
    margin-top: 0;
}
.b2c-form-hint {
    margin: 0 0 1rem;
    font-size: .85rem;
    color: rgba(13, 14, 18, .55);
}
.b2c-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .9rem 1rem;
    margin-bottom: .5rem;
}
.b2c-field-wide { grid-column: 1 / -1; }
.b2c-radio-row {
    display: flex;
    gap: .5rem;
}
.b2c-radio-inline {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem .85rem;
    border: 1px solid rgba(13, 14, 18, .18);
    border-radius: 8px;
    cursor: pointer;
    font-size: .9rem;
}
.b2c-hint-inline {
    color: rgba(13, 14, 18, .4);
    font-weight: 400;
    font-size: .8rem;
}
.b2c-input-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.b2c-textarea {
    resize: vertical;
    min-height: 140px;
    font-family: inherit;
    line-height: 1.5;
}
.b2c-form-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(13, 14, 18, .06);
    margin-top: 1rem;
}
.b2c-form-footer .b2c-btn-primary { width: auto; padding: .7rem 1.5rem; }

/* Mobile : cartes du dashboard + form coordonnées en pile */
@media (max-width: 640px) {
    .b2c-form-grid { grid-template-columns: 1fr; }
    .b2c-dossiers-table { font-size: .82rem; }
    .b2c-dossiers-table th,
    .b2c-dossiers-table td { padding: .6rem .5rem; }
}
