/* ═══════════════════════════════════════════════════════════════════════════
   SUIVI ACHAT MAISON — DESIGN SYSTEM
   Light-first, theme-driven accents that work in both light & dark modes.
   ───────────────────────────────────────────────────────────────────────────
   Architecture:
   • [data-mode]  → controls NEUTRALS (background, surfaces, text, borders)
   • [data-theme] → controls the ACCENT palette only (so any theme works in
                    any mode)
   ═══════════════════════════════════════════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Sora:wght@600;700;800&display=swap");

/* ───────────────────────────────────────────────────────────────
   1. ACCENT PALETTES  (theme = colour only)
   ─────────────────────────────────────────────────────────────── */
/* Signature — palette de marque, thème PAR DÉFAUT (indigo profond → teal). Distinctive des
   6 palettes génériques ci-dessous, elle porte l'identité de l'app. Cf. docs/features/identite-visuelle. */
:root,
[data-theme="brand"] {
    --accent: #4338ca;
    --accent-2: #0d9488;
    --accent-strong: #3730a3;
    --accent-contrast: #ffffff;
    --accent-gradient: linear-gradient(120deg, #4338ca, #0d9488);
    --accent-gradient-soft: linear-gradient(120deg, rgba(67, 56, 202, 0.14), rgba(13, 148, 136, 0.14));
    --accent-soft: rgba(67, 56, 202, 0.12);
    --accent-glow: rgba(79, 70, 229, 0.35);
    --mesh-a: #6366f1;
    --mesh-b: #2dd4bf;
    --mesh-c: #818cf8;
}

[data-theme="ocean"] {
    --accent: #2563eb;
    --accent-2: #06b6d4;
    --accent-strong: #1d4ed8;
    --accent-contrast: #ffffff;
    --accent-gradient: linear-gradient(120deg, #2563eb, #06b6d4);
    --accent-gradient-soft: linear-gradient(120deg, rgba(37, 99, 235, 0.14), rgba(6, 182, 212, 0.14));
    --accent-soft: rgba(37, 99, 235, 0.12);
    --accent-glow: rgba(37, 99, 235, 0.35);
    --mesh-a: #3b82f6;
    --mesh-b: #06b6d4;
    --mesh-c: #6366f1;
}

[data-theme="emerald"] {
    --accent: #059669;
    --accent-2: #14b8a6;
    --accent-strong: #047857;
    --accent-contrast: #ffffff;
    --accent-gradient: linear-gradient(120deg, #059669, #14b8a6);
    --accent-gradient-soft: linear-gradient(120deg, rgba(5, 150, 105, 0.14), rgba(20, 184, 166, 0.14));
    --accent-soft: rgba(5, 150, 105, 0.12);
    --accent-glow: rgba(16, 185, 129, 0.35);
    --mesh-a: #10b981;
    --mesh-b: #2dd4bf;
    --mesh-c: #34d399;
}

[data-theme="violet"] {
    --accent: #7c3aed;
    --accent-2: #d946ef;
    --accent-strong: #6d28d9;
    --accent-contrast: #ffffff;
    --accent-gradient: linear-gradient(120deg, #7c3aed, #d946ef);
    --accent-gradient-soft: linear-gradient(120deg, rgba(124, 58, 237, 0.14), rgba(217, 70, 239, 0.14));
    --accent-soft: rgba(124, 58, 237, 0.12);
    --accent-glow: rgba(139, 92, 246, 0.38);
    --mesh-a: #8b5cf6;
    --mesh-b: #d946ef;
    --mesh-c: #6366f1;
}

[data-theme="rose"] {
    --accent: #e11d48;
    --accent-2: #ec4899;
    --accent-strong: #be123c;
    --accent-contrast: #ffffff;
    --accent-gradient: linear-gradient(120deg, #e11d48, #ec4899);
    --accent-gradient-soft: linear-gradient(120deg, rgba(225, 29, 72, 0.14), rgba(236, 72, 153, 0.14));
    --accent-soft: rgba(225, 29, 72, 0.12);
    --accent-glow: rgba(244, 63, 94, 0.35);
    --mesh-a: #fb7185;
    --mesh-b: #f472b6;
    --mesh-c: #f43f5e;
}

[data-theme="amber"] {
    --accent: #d97706;
    --accent-2: #f97316;
    --accent-strong: #b45309;
    --accent-contrast: #ffffff;
    --accent-gradient: linear-gradient(120deg, #d97706, #f97316);
    --accent-gradient-soft: linear-gradient(120deg, rgba(217, 119, 6, 0.16), rgba(249, 115, 22, 0.16));
    --accent-soft: rgba(217, 119, 6, 0.14);
    --accent-glow: rgba(245, 158, 11, 0.4);
    --mesh-a: #f59e0b;
    --mesh-b: #fb923c;
    --mesh-c: #fbbf24;
}

[data-theme="indigo"] {
    --accent: #4f46e5;
    --accent-2: #818cf8;
    --accent-strong: #4338ca;
    --accent-contrast: #ffffff;
    --accent-gradient: linear-gradient(120deg, #4f46e5, #818cf8);
    --accent-gradient-soft: linear-gradient(120deg, rgba(79, 70, 229, 0.14), rgba(129, 140, 248, 0.14));
    --accent-soft: rgba(79, 70, 229, 0.12);
    --accent-glow: rgba(99, 102, 241, 0.38);
    --mesh-a: #6366f1;
    --mesh-b: #818cf8;
    --mesh-c: #a855f7;
}

/* ───────────────────────────────────────────────────────────────
   2. NEUTRALS — LIGHT MODE (default)
   ─────────────────────────────────────────────────────────────── */
:root,
[data-mode="light"] {
    --bg: #eef2f9;
    --bg-2: #f8fafc;
    --surface: rgba(255, 255, 255, 0.78);
    --surface-2: rgba(255, 255, 255, 0.55);
    --surface-solid: #ffffff;
    --surface-hover: rgba(255, 255, 255, 0.95);
    --border: rgba(15, 23, 42, 0.09);
    --border-strong: rgba(15, 23, 42, 0.16);
    --text: #1e293b;
    --text-muted: #64748b;
    --heading: #0f172a;
    --chip-bg: rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);
    --mesh-opacity: 0.5;
    --glass-blur: 16px;
    color-scheme: light;
}

/* ───────────────────────────────────────────────────────────────
   3. NEUTRALS — DARK MODE
   ─────────────────────────────────────────────────────────────── */
[data-mode="dark"] {
    --bg: #070b18;
    --bg-2: #0b1120;
    --surface: rgba(20, 28, 47, 0.72);
    --surface-2: rgba(30, 41, 59, 0.5);
    --surface-solid: #111827;
    --surface-hover: rgba(30, 41, 59, 0.85);
    --border: rgba(148, 163, 184, 0.16);
    --border-strong: rgba(148, 163, 184, 0.28);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --heading: #f8fafc;
    --chip-bg: rgba(148, 163, 184, 0.12);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.6);
    --mesh-opacity: 0.42;
    --glass-blur: 18px;
    color-scheme: dark;
}

/* ───────────────────────────────────────────────────────────────
   4. GLOBAL BASE
   ─────────────────────────────────────────────────────────────── */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color 0.5s ease, color 0.4s ease;
}

/* Animated mesh-gradient backdrop — the "wow" on arrival */
body::before {
    content: "";
    position: fixed;
    inset: -20%;
    z-index: -2;
    background:
        radial-gradient(38% 42% at 12% 8%, var(--mesh-a), transparent 60%),
        radial-gradient(34% 40% at 88% 12%, var(--mesh-b), transparent 58%),
        radial-gradient(46% 50% at 70% 95%, var(--mesh-c), transparent 60%),
        radial-gradient(40% 44% at 18% 92%, var(--mesh-a), transparent 60%);
    opacity: var(--mesh-opacity);
    filter: blur(70px) saturate(1.15);
    animation: meshDrift 26s ease-in-out infinite alternate;
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, transparent, var(--bg) 92%);
    pointer-events: none;
}

@keyframes meshDrift {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
    50%  { transform: translate3d(2%, -2%, 0) rotate(4deg) scale(1.08); }
    100% { transform: translate3d(-2%, 2%, 0) rotate(-3deg) scale(1.04); }
}

a,
.btn-link {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-strong);
}

h1, h2, h3, h4, h5 {
    color: var(--heading);
    font-family: "Sora", "Inter", sans-serif;
    letter-spacing: -0.01em;
}

h1:focus {
    outline: none;
}

p, small, .text-muted {
    color: var(--text-muted) !important;
}

::selection {
    background: var(--accent-soft);
    color: var(--heading);
}

/* Themed scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: content-box; }

/* ───────────────────────────────────────────────────────────────
   5. LAYOUT HELPERS
   ─────────────────────────────────────────────────────────────── */
.content {
    padding-top: 1.2rem;
}

.page-title {
    margin: 0;
    font-size: clamp(1.5rem, 2.6vw, 2.3rem);
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    letter-spacing: -0.02em;
}

/* Le clipping du dégradé sur le texte rend les emoji transparents (silhouette grise).
   On enveloppe les emoji de titre dans .page-title-ico pour leur rendre leur rendu couleur. */
.page-title-ico {
    -webkit-text-fill-color: initial;
    color: initial;
}

/* ── Identité de marque : lockup logo + wordmark (cf. docs/features/identite-visuelle) ── */
.brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.brand-logo {
    flex: none;
    border-radius: 12px;
    filter: drop-shadow(0 5px 12px var(--accent-glow));
    transition: transform 0.25s ease;
}

.brand-lockup:hover .brand-logo {
    transform: translateY(-1px) rotate(-3deg);
}

/* Wordmark deux tons : « Suivi » en couleur de titre + « Achat » en dégradé d'accent. Le
   -webkit-text-fill-color explicite neutralise tout clipping hérité d'un parent (ex. navbar-brand). */
.brand-wordmark {
    font-family: "Sora", "Inter", sans-serif;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--heading);
    -webkit-text-fill-color: var(--heading);
    white-space: nowrap;
}

.brand-wordmark > span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Variante « hero » : lockup centré et agrandi pour l'écran d'entrée (sélection de projet). */
.brand-lockup-hero {
    flex-direction: column;
    gap: 0.7rem;
    justify-content: center;
    margin-bottom: 0.25rem;
}

.brand-lockup-hero .brand-wordmark {
    font-size: 1.7rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.4rem;
}

.section-subtitle {
    margin: 0.4rem 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.actions-row {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ───────────────────────────────────────────────────────────────
   6. SURFACES / CARDS  — glassmorphism
   ─────────────────────────────────────────────────────────────── */
.surface-card,
.card,
.modal-content {
    border-radius: 1.15rem;
    border: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
    box-shadow: var(--shadow);
    position: relative;
}

/* subtle top highlight on glass cards */
.surface-card::before,
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 40%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.6;
}

[data-mode="dark"] .surface-card::before,
[data-mode="dark"] .card::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 40%);
}

.card-header {
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--heading);
    font-weight: 700;
    border-radius: 1.15rem 1.15rem 0 0;
}

/* ───────────────────────────────────────────────────────────────
   7. TABLES
   ─────────────────────────────────────────────────────────────── */
.table-shell {
    overflow: hidden;
    border-radius: 1.15rem;
}

.data-table {
    color: var(--text);
    margin: 0;
}

.data-table thead th {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    border-color: var(--border);
    font-weight: 700;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.data-table td {
    border-color: var(--border);
    vertical-align: middle;
    color: var(--text);
}

.interactive-row {
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.interactive-row:hover {
    background: var(--accent-soft);
}

/* ───────────────────────────────────────────────────────────────
   8. BADGES
   ─────────────────────────────────────────────────────────────── */
.badge {
    border-radius: 999px;
    padding: 0.4rem 0.65rem;
    font-weight: 600;
    font-size: 0.74rem;
}

.bg-secondary {
    background: var(--chip-bg) !important;
    color: var(--text-muted) !important;
}

/* ───────────────────────────────────────────────────────────────
   9. BUTTONS
   ─────────────────────────────────────────────────────────────── */
.btn {
    border-radius: 0.8rem;
    font-weight: 600;
    border-width: 1px;
    padding: 0.5rem 1.05rem;
    transition: transform 0.16s cubic-bezier(.34,1.56,.64,1), box-shadow 0.18s ease, filter 0.16s ease, background-color 0.16s ease;
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    color: var(--accent-contrast);
    border-color: transparent;
    background: var(--accent-gradient);
    box-shadow: 0 8px 22px var(--accent-glow);
}

.btn-primary:hover {
    box-shadow: 0 12px 30px var(--accent-glow);
}

.btn-success {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(120deg, #10b981, #059669);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(120deg, #f43f5e, #e11d48);
    box-shadow: 0 8px 20px rgba(244, 63, 94, 0.28);
}

.btn-secondary {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--surface-2);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: var(--surface-hover);
}

.btn-outline-secondary {
    border-color: var(--border-strong);
    color: var(--text);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--chip-bg);
    color: var(--heading);
}

.btn-outline-danger {
    border-color: rgba(244, 63, 94, 0.5);
    color: #e11d48;
    background: transparent;
}

[data-mode="dark"] .btn-outline-danger {
    color: #fca5a5;
}

.btn-outline-danger:hover {
    background: rgba(244, 63, 94, 0.12);
}

.btn-close {
    filter: none;
}

[data-mode="dark"] .btn-close {
    filter: invert(1);
}

/* ───────────────────────────────────────────────────────────────
   10. FORMS
   ─────────────────────────────────────────────────────────────── */
.form-control,
.form-select {
    border-radius: 0.8rem;
    border-color: var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
    padding: 0.55rem 0.85rem;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

[data-mode="dark"] .form-control,
[data-mode="dark"] .form-select {
    background: rgba(15, 23, 42, 0.55);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.22rem var(--accent-soft);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.form-check-input {
    background-color: var(--surface-2);
    border-color: var(--border-strong);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.form-label {
    color: var(--text);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

/* ───────────────────────────────────────────────────────────────
   11. ALERTS
   ─────────────────────────────────────────────────────────────── */
.alert {
    border-radius: 0.95rem;
    border-width: 1px;
    backdrop-filter: blur(8px);
}

.alert-danger {
    color: #991b1b;
    border-color: rgba(244, 63, 94, 0.3);
    background: rgba(254, 226, 226, 0.75);
}

.alert-success {
    color: #166534;
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(220, 252, 231, 0.75);
}

.alert-info {
    color: #0c4a6e;
    border-color: rgba(56, 189, 248, 0.3);
    background: rgba(224, 242, 254, 0.75);
}

[data-mode="dark"] .alert-danger {
    color: #fee2e2;
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(127, 29, 29, 0.32);
}

[data-mode="dark"] .alert-success {
    color: #dcfce7;
    border-color: rgba(74, 222, 128, 0.4);
    background: rgba(20, 83, 45, 0.34);
}

[data-mode="dark"] .alert-info {
    color: #cffafe;
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(12, 74, 110, 0.34);
}

/* ───────────────────────────────────────────────────────────────
   12. MODAL
   ─────────────────────────────────────────────────────────────── */
.modal-header,
.modal-footer {
    border-color: var(--border);
}

.modal-title {
    color: var(--heading);
    font-weight: 700;
}

.app-modal-backdrop {
    background: rgba(2, 6, 23, 0.55) !important;
    backdrop-filter: blur(8px);
}

.modal-content {
    box-shadow: var(--shadow-lg);
}

/* ───────────────────────────────────────────────────────────────
   13. LOADING
   ─────────────────────────────────────────────────────────────── */
.loading-shell {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 0.5rem;
    padding: 4rem 0;
}

.spinner-border {
    color: var(--accent);
}

/* ───────────────────────────────────────────────────────────────
   14. SCROLL REVEAL + TILT  (driven by site-effects.js)
   ─────────────────────────────────────────────────────────────── */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
    transition: opacity 0.55s cubic-bezier(.22,1,.36,1), transform 0.55s cubic-bezier(.22,1,.36,1);
    will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.data-tilt {
    transform: perspective(1000px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition: transform 0.18s ease;
}

@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll,
    .reveal-on-scroll.is-visible,
    .data-tilt,
    .btn,
    body::before {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
        animation: none !important;
    }
    .reveal-on-scroll { opacity: 1 !important; }
}

@media (max-width: 820px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .actions-row {
        justify-content: flex-start;
    }
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #10b981;
}

.invalid {
    outline: 1px solid #ef4444;
}

.validation-message {
    color: #e11d48;
}

[data-mode="dark"] .validation-message {
    color: #fca5a5;
}

/* ───────────────────────────────────────────────────────────────
   15. BLAZOR ERROR / LOADING
   ─────────────────────────────────────────────────────────────── */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: rgba(148, 163, 184, 0.25);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #2563eb;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 700;
    color: #334155;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ───────────────────────────────────────────────────────────────
   16. STAT CARDS
   ─────────────────────────────────────────────────────────────── */
.stat-card {
    border-radius: 1.15rem;
    border: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: blur(var(--glass-blur));
    padding: 1.25rem 1rem;
    text-align: center;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card-accent {
    border-color: var(--border);
    background: var(--accent-gradient-soft), var(--surface);
}

.stat-card-accent::after {
    opacity: 1;
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--heading);
    line-height: 1.15;
    font-family: "Sora", "Inter", sans-serif;
}

.stat-card-accent .stat-value {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* ───────────────────────────────────────────────────────────────
   17. SCORE BADGE
   ─────────────────────────────────────────────────────────────── */
.score-badge {
    display: inline-block;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.22rem 0.55rem;
    border-radius: 0.55rem;
}
.score-high { background: rgba(16, 185, 129, 0.16); color: #059669; }
.score-mid  { background: rgba(245, 158, 11, 0.16); color: #d97706; }
.score-low  { background: rgba(244, 63, 94, 0.16); color: #e11d48; }
[data-mode="dark"] .score-high { background: rgba(16, 185, 129, 0.25); color: #34d399; }
[data-mode="dark"] .score-mid  { background: rgba(251, 191, 36, 0.25); color: #fbbf24; }
[data-mode="dark"] .score-low  { background: rgba(248, 113, 113, 0.25); color: #f87171; }

.score-ia { border: 1px solid currentColor; opacity: 0.85; }
.score-ia-stale { text-decoration: line-through; opacity: 0.6; }

/* ── Fiche détail : faits-clés en en-tête ── */
.detail-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
}
.detail-chip-price {
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-weight: 700;
}

/* ── Fiche détail : regroupement « Analyse IA » ── */
.ia-group {
    border: 1px solid var(--accent);
    border-radius: 1.25rem;
    background: var(--accent-gradient-soft), var(--surface-2);
    padding: 1rem;
}
.ia-group-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin: 0.1rem 0.25rem 0.85rem;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--heading);
}
/* Les cartes IA imbriquées dans le groupe perdent leur bordure/teinte propre
   pour ne pas doubler l'accent du conteneur. */
.ia-group .ia-card {
    border-color: var(--border);
    background: var(--surface-solid);
}

/* ───────────────────────────────────────────────────────────────
   18. FILTER BAR
   ─────────────────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    align-items: center;
}

.filter-search {
    flex: 1 1 200px;
    min-width: 160px;
}

.filter-select {
    flex: 0 0 auto;
    width: auto;
    min-width: 140px;
}

/* ───────────────────────────────────────────────────────────────
   19. MAISON CARD GRID
   ─────────────────────────────────────────────────────────────── */
.maison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.1rem;
}

.maison-card {
    border-radius: 1.15rem;
    border: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: blur(var(--glass-blur));
    padding: 1.1rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(.34,1.4,.64,1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.maison-card::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.maison-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.maison-card:hover::after {
    transform: scaleX(1);
}

.maison-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.7rem;
    gap: 0.5rem;
}

.maison-card-title {
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--heading);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.maison-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.7rem;
}

.detail-chip {
    font-size: 0.78rem;
    padding: 0.22rem 0.55rem;
    border-radius: 0.55rem;
    background: var(--chip-bg);
    color: var(--text-muted);
    white-space: nowrap;
    font-weight: 500;
}

.maison-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-top: 1px solid var(--border);
    padding-top: 0.6rem;
}

.maison-prix {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--heading);
    font-family: "Sora", "Inter", sans-serif;
}

.maison-prixm2 {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ───────────────────────────────────────────────────────────────
   20. DPE CHIPS
   ─────────────────────────────────────────────────────────────── */
.dpe-chip {
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.5rem;
    text-transform: uppercase;
    color: #fff;
}
.dpe-a { background: #16a34a; }
.dpe-b { background: #65a30d; }
.dpe-c { background: #ca8a04; }
.dpe-d { background: #ea580c; }
.dpe-e { background: #f97316; }
.dpe-f { background: #dc2626; }
.dpe-g { background: #991b1b; }

/* ───────────────────────────────────────────────────────────────
   20b. « KERYTICS CONSEILLE » — verdict de synthèse
   ─────────────────────────────────────────────────────────────── */
.conseil-card {
    border-left: 4px solid var(--accent);
    background: var(--accent-gradient-soft);
}
.conseil-card.conseil-favorable { border-left-color: #16a34a; }
.conseil-card.conseil-vigilance { border-left-color: #d97706; }

.conseil-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.9rem;
}
.conseil-logo {
    font-size: 1.5rem;
    line-height: 1;
}
.conseil-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.conseil-titre {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--heading, var(--text));
    line-height: 1.2;
}
.conseil-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem 1.5rem;
}
.conseil-col-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.conseil-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.conseil-list li {
    position: relative;
    padding-left: 1.4rem;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    line-height: 1.35;
    color: var(--text);
}
.conseil-forces li::before { content: "▲"; color: #16a34a; }
.conseil-reserves li::before { content: "▼"; color: #d97706; }
.conseil-list li::before {
    position: absolute;
    left: 0;
    top: 0.05rem;
    font-size: 0.7rem;
}
[data-mode="dark"] .conseil-forces li::before { color: #4ade80; }
[data-mode="dark"] .conseil-reserves li::before { color: #fbbf24; }
.conseil-foot {
    margin-top: 0.9rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Pastille de verdict (tableau comparatif). */
.conseil-pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    background: var(--accent-soft);
    color: var(--accent);
}
.conseil-pill.conseil-favorable { background: rgba(16, 185, 129, 0.16); color: #059669; }
.conseil-pill.conseil-vigilance { background: rgba(217, 119, 6, 0.16); color: #d97706; }
[data-mode="dark"] .conseil-pill.conseil-favorable { background: rgba(16, 185, 129, 0.25); color: #34d399; }
[data-mode="dark"] .conseil-pill.conseil-vigilance { background: rgba(251, 191, 36, 0.22); color: #fbbf24; }

/* ───────────────────────────────────────────────────────────────
   21. STATUS BADGES
   ─────────────────────────────────────────────────────────────── */
.badge-avisiter   { background: rgba(37, 99, 235, 0.14);  color: #2563eb; }
.badge-visite     { background: rgba(99, 102, 241, 0.14); color: #4f46e5; }
.badge-favori     { background: rgba(217, 119, 6, 0.16);  color: #d97706; }
.badge-ecarte     { background: rgba(100, 116, 139, 0.16); color: #64748b; }
.badge-offre      { background: rgba(168, 85, 247, 0.14); color: #9333ea; }
.badge-compromis  { background: rgba(234, 88, 12, 0.16);  color: #ea580c; }
.badge-pret       { background: rgba(13, 148, 136, 0.16); color: #0d9488; }
.badge-acte       { background: rgba(22, 163, 74, 0.16);  color: #16a34a; }

[data-mode="dark"] .badge-avisiter   { background: rgba(56, 189, 248, 0.2);  color: #38bdf8; }
[data-mode="dark"] .badge-visite     { background: rgba(129, 140, 248, 0.2); color: #818cf8; }
[data-mode="dark"] .badge-favori     { background: rgba(251, 191, 36, 0.22); color: #fbbf24; }
[data-mode="dark"] .badge-ecarte     { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }
[data-mode="dark"] .badge-offre      { background: rgba(192, 132, 252, 0.2); color: #c084fc; }
[data-mode="dark"] .badge-compromis  { background: rgba(251, 146, 60, 0.22); color: #fb923c; }
[data-mode="dark"] .badge-pret       { background: rgba(45, 212, 191, 0.2);  color: #2dd4bf; }
[data-mode="dark"] .badge-acte       { background: rgba(74, 222, 128, 0.22); color: #4ade80; }

/* ───────────────────────────────────────────────────────────────
   22. IA CARD
   ─────────────────────────────────────────────────────────────── */
.ia-card {
    border-color: var(--accent);
    background: var(--accent-gradient-soft), var(--surface);
}

/* ───────────────────────────────────────────────────────────────
   23. PIPELINE / KANBAN
   ─────────────────────────────────────────────────────────────── */
.pipeline-board {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    padding-bottom: 0.6rem;
}

.pipeline-col {
    flex: 0 0 230px;
    min-height: 200px;
}

.pipeline-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.6rem;
    margin-bottom: 0.5rem;
    border-radius: 0.7rem;
    background: var(--chip-bg);
}

.pipeline-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
}

.pipeline-col-body {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.pipeline-card {
    border-radius: 0.85rem;
    border: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: blur(10px);
    padding: 0.7rem 0.8rem;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pipeline-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.pipeline-card-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--heading);
    margin-bottom: 0.2rem;
}

.pipeline-card-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.pipeline-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text);
}

.pipeline-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 1rem 0.5rem;
    opacity: 0.7;
}

/* ───────────────────────────────────────────────────────────────
   24. MAP
   ─────────────────────────────────────────────────────────────── */
.map-container {
    width: 100%;
    height: 60vh;
    min-height: 350px;
    border-radius: 1.15rem;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* ───────────────────────────────────────────────────────────────
   25. PHOTO GRID
   ─────────────────────────────────────────────────────────────── */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.55rem;
}

.photo-thumb {
    border-radius: 0.7rem;
    overflow: hidden;
    aspect-ratio: 4/3;
    border: 1px solid var(--border);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.photo-thumb:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow);
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ───────────────────────────────────────────────────────────────
   26. RESPONSIVE
   ─────────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .maison-grid { grid-template-columns: 1fr; }
    .pipeline-board { flex-direction: column; }
    .pipeline-col { flex: auto; }
    .stat-value { font-size: 1.35rem; }
    .filter-bar { flex-direction: column; }
    .filter-search,
    .filter-select { width: 100%; }
}

@media (max-width: 768px) {
    .maison-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* ───────────────────────────────────────────────────────────────
   27. TOASTS
   ─────────────────────────────────────────────────────────────── */
.toast-fading {
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* ───────────────────────────────────────────────────────────────
   28. SKELETON LOADING
   ─────────────────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--chip-bg) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.15rem;
    padding: 1.25rem;
    height: 160px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skeleton-line { height: 1rem; }
.skeleton-line-sm { height: 0.75rem; width: 60%; }
.skeleton-line-lg { height: 1.5rem; width: 75%; }

/* ───────────────────────────────────────────────────────────────
   28a. COMMAND PALETTE (Ctrl-K)
   ─────────────────────────────────────────────────────────────── */
.cmdk-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 12vh;
}
.cmdk-panel {
    width: min(560px, 92vw);
    background: var(--surface-solid, var(--surface));
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}
.cmdk-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 1.05rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--border);
}
.cmdk-list {
    max-height: 46vh;
    overflow-y: auto;
    padding: 0.4rem;
}
.cmdk-empty {
    padding: 1.25rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.cmdk-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0.6rem 0.7rem;
    border-radius: 9px;
    color: var(--text);
    cursor: pointer;
}
.cmdk-item.active { background: var(--accent-soft); }
.cmdk-item-ico { font-size: 1.1rem; width: 1.4rem; text-align: center; }
.cmdk-item-label { flex: 1; font-weight: 600; }
.cmdk-item-cat { font-size: 0.75rem; color: var(--text-muted); }
.cmdk-foot {
    display: flex;
    gap: 1rem;
    padding: 0.55rem 0.9rem;
    border-top: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--text-muted);
}
.cmdk-foot kbd {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0 0.35rem;
    margin-right: 0.15rem;
    font-family: var(--font-mono, monospace);
}

/* ───────────────────────────────────────────────────────────────
   28b. EMPTY STATE (design system V0)
   ─────────────────────────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
    padding: 3rem 1.5rem;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: 1.15rem;
}
.empty-state-ico {
    font-size: 2.75rem;
    line-height: 1;
    margin-bottom: 0.35rem;
    opacity: 0.9;
}
.empty-state-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--heading, var(--text));
}
.empty-state-message {
    margin: 0;
    max-width: 42ch;
    color: var(--text-muted);
    font-size: 0.92rem;
}
.empty-state-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.9rem;
}

/* ───────────────────────────────────────────────────────────────
   29. TIMELINE
   ─────────────────────────────────────────────────────────────── */
.process-timeline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 90px;
    position: relative;
}

.timeline-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 12px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border-strong);
    z-index: 0;
}

.timeline-step.done::after { background: var(--accent); }

.timeline-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    background: var(--surface);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.timeline-step.done .timeline-dot {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.timeline-step.current .timeline-dot {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.timeline-label {
    font-size: 0.68rem;
    text-align: center;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.timeline-date {
    font-size: 0.62rem;
    color: var(--accent);
    margin-top: 0.1rem;
    text-align: center;
}

/* ───────────────────────────────────────────────────────────────
   30. PHOTO GALLERY
   ─────────────────────────────────────────────────────────────── */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.photo-thumb {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    border: 2px solid var(--border);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.photo-thumb:hover { border-color: var(--accent); transform: scale(1.02); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.photo-thumb-delete {
    position: absolute;
    top: 4px; right: 4px;
    background: rgba(0,0,0,0.6);
    border: none;
    border-radius: 50%;
    width: 24px; height: 24px;
    color: white;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.photo-thumb:hover .photo-thumb-delete { opacity: 1; }

.photo-thumb-star {
    position: absolute;
    top: 4px; left: 4px;
    background: rgba(0,0,0,0.55);
    border: none;
    border-radius: 50%;
    width: 26px; height: 26px;
    color: #ffd75e;
    font-size: 0.95rem;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
    z-index: 2;
}
.photo-thumb:hover .photo-thumb-star,
.photo-thumb-star.active { opacity: 1; }
.photo-thumb.is-principale { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Conteneur téléporté sous <body> (cf. window.photoLightbox) : vide quand la lightbox est fermée. */
.lightbox-portal:empty { display: none; }
body.lightbox-open { overflow: hidden; }

/* Plein écran par-dessus toute la page, en colonne : la scène occupe l'espace restant et le
   footer (en flux) prend sa propre hauteur — il ne recouvre donc jamais l'image. */
.lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 12000;
    display: flex;
    flex-direction: column;
}

.lightbox-stage {
    flex: 1 1 auto;
    min-height: 0;          /* autorise l'image à rétrécir dans le flex (sinon débordement) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 12px 48px rgba(0,0,0,0.55);
}

.lightbox-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 44px; height: 44px;
    color: white; font-size: 1.4rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 2;
    transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(0,0,0,0.9); }

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 52px; height: 52px;
    color: white; font-size: 2rem; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s ease;
    padding: 0;
    user-select: none;
}
.lightbox-nav:hover { background: rgba(0,0,0,0.9); }
.lightbox-nav-prev { left: 1rem; }
.lightbox-nav-next { right: 1rem; }

.lightbox-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(0,0,0,0.55);
    border-top: 1px solid rgba(255,255,255,0.08);
}

.lightbox-counter {
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.lightbox-desc {
    color: rgba(255,255,255,0.88);
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ───────────────────────────────────────────────────────────────
   31. COMPARAISON
   ─────────────────────────────────────────────────────────────── */
.compare-table th, .compare-table td {
    vertical-align: middle;
    white-space: nowrap;
}

.compare-table td.best { background: var(--accent-soft); font-weight: 600; }

.compare-select-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
}

.maison-card.selected {
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.maison-card-check {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2;
    background: rgba(255,255,255,0.85);
    border-radius: 0.4rem;
    padding: 0.1rem 0.25rem;
    line-height: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Vignette (photo principale ou logo maison par défaut), débordant jusqu'aux bords de la carte. */
.maison-card-thumb {
    margin: -1.1rem -1.1rem 0.85rem;
    height: 150px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}
.maison-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.maison-card-thumb-placeholder { font-size: 3.2rem; opacity: 0.4; line-height: 1; }

/* ───────────────────────────────────────────────────────────────
   32. PIPELINE DRAG & DROP
   ─────────────────────────────────────────────────────────────── */
.pipeline-col-dragover {
    background: var(--accent-soft);
    border: 2px dashed var(--accent);
    border-radius: 0.75rem;
}

.pipeline-card {
    cursor: grab;
}

.pipeline-card-dragging {
    opacity: 0.45;
    cursor: grabbing;
}

/* ───────────────────────────────────────────────────────────────
   33. LOGIN
   ─────────────────────────────────────────────────────────────── */
.login-backdrop {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.login-card {
    width: 100%;
    max-width: 360px;
    padding: 2.5rem 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    box-shadow: 0 8px 32px rgba(0,0,0,.1);
}

.login-brand {
    margin-bottom: .4rem;
}

.login-subtitle {
    font-size: .9rem;
    text-align: center;
    margin-bottom: 1.75rem;
    color: var(--text-muted);
}

/* Carte élargie (gate CGU) + zone de défilement des CGU */
.login-card-wide { max-width: 640px; }

.terms-scroll {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: .75rem;
    padding: .5rem 1rem;
    background: var(--bg);
}
.terms-scroll .legal-nav,
.terms-scroll .page-title { display: none; }

/* ── Pages légales ─────────────────────────────────────────────── */
.legal-public { min-height: 100vh; background: var(--bg); }

.legal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.legal-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

.legal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}
.legal-nav a { color: var(--text-muted); text-decoration: none; font-weight: 500; }
.legal-nav a.active, .legal-nav a:hover { color: var(--accent); }

.legal-body h2 { font-size: 1.15rem; margin-top: 1.5rem; }
.legal-body p { color: var(--text); line-height: 1.6; }

.lp-footer-legal { display: flex; gap: 1rem; flex-wrap: wrap; }
.lp-footer-legal a { color: var(--text-muted); text-decoration: none; font-size: .85rem; }
.lp-footer-legal a:hover { color: var(--accent); }

/* ───────────────────────────────────────────────────────────────
   34. PROJETS (multi-tenant)
   ─────────────────────────────────────────────────────────────── */
.project-switcher {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .25rem .6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: .6rem;
}

.project-switcher-icon { font-size: 1rem; }

.project-select {
    border: none;
    background: transparent;
    color: var(--text);
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    outline: none;
    max-width: 180px;
}

.project-picker {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-picker-card {
    width: 100%;
    max-width: 460px;
    padding: 2.25rem 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    box-shadow: 0 8px 32px rgba(0,0,0,.1);
}

.project-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem 0;
    border-bottom: 1px solid var(--border);
}

.project-row:last-of-type { border-bottom: none; }

/* ───────────────────────────────────────────────────────────────
   35. IMPORT PHOTO PREVIEW GRID  (modale d'import IA)
   ─────────────────────────────────────────────────────────────── */
.import-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}

.import-photo-thumb {
    border-radius: 0.6rem;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--border);
    background: var(--chip-bg);
}

.import-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ───────────────────────────────────────────────────────────────
   36. MOBILE / TOUCH POLISH
   ─────────────────────────────────────────────────────────────── */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

/* iOS : empêche le zoom automatique au focus des champs (police < 16px). */
@media (max-width: 820px) {
    .form-control,
    .form-select,
    .data-table input,
    .compare-table input,
    textarea {
        font-size: 16px;
    }
}

/* Comparaison : 1re colonne (les libellés) figée pendant le défilement horizontal. */
.compare-table th:first-child,
.compare-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--surface-solid);
}

.compare-table thead th:first-child {
    z-index: 2;
}

/* Sur écran tactile, on neutralise les effets de survol qui « collent » après un tap. */
@media (hover: none) {
    .btn:hover,
    .maison-card:hover,
    .stat-card:hover,
    .pipeline-card:hover,
    .photo-thumb:hover,
    .theme-dot:hover,
    .mode-toggle:hover {
        transform: none;
        filter: none;
    }

    .maison-card:hover::after { transform: scaleX(0); }
    .stat-card:hover::after { opacity: 0; }
    .interactive-row:hover { background: transparent; }
}

@media (max-width: 576px) {
    .page-title { font-size: clamp(1.3rem, 6vw, 1.7rem); }
    .section-header { margin-bottom: 1rem; }
    .card-body { padding: 1rem; }
    .stat-card { padding: 1rem 0.75rem; }

    /* Comparaison : cellules compactes et lisibles sans débordement excessif. */
    .compare-table th,
    .compare-table td {
        white-space: normal;
        padding: 0.4rem 0.5rem;
        font-size: 0.85rem;
    }
    .compare-table th:first-child { width: 116px !important; }

    /* Petites modales (confirmation, édition) : feuille ancrée en bas, plus atteignable au pouce. */
    .modal-dialog:not(.modal-fullscreen-sm-down) {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        margin: 0;
        max-width: 100%;
    }
    .modal-dialog:not(.modal-fullscreen-sm-down) .modal-content {
        border-radius: 1.15rem 1.15rem 0 0;
        padding-bottom: env(safe-area-inset-bottom);
        max-height: 92vh;
        overflow-y: auto;
        animation: sheetUp 0.28s cubic-bezier(.22,1,.36,1) both;
    }
}

@keyframes sheetUp {
    0%   { transform: translateY(100%); }
    100% { transform: translateY(0); }
}

/* ───────────────────────────────────────────────────────────────
   37. CALENDRIER
   ─────────────────────────────────────────────────────────────── */
.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.35rem;
}

.cal-weekdays {
    margin-bottom: 0.35rem;
}

.cal-weekday {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.25rem 0;
}

.cal-cell {
    min-height: 84px;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    background: var(--surface-2);
    padding: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
}

.cal-cell-out {
    opacity: 0.4;
}

.cal-cell-today {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent) inset;
}

.cal-daynum {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: right;
    line-height: 1;
}

.cal-cell-today .cal-daynum {
    color: var(--accent);
}

.cal-event {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    border: none;
    border-radius: 0.4rem;
    padding: 0.12rem 0.3rem;
    font-size: 0.66rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    width: 100%;
    overflow: hidden;
}

.cal-event-emoji { flex: 0 0 auto; }

.cal-event-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-upcoming-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.4rem;
    border-radius: 0.6rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.cal-upcoming-row:last-child { border-bottom: none; }

.cal-upcoming-title {
    flex: 1 1 auto;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-upcoming-date {
    flex: 0 0 auto;
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ───────────────────────────────────────────────────────────────
   38. STAR RATING + ÉVALUATION PIÈCES (fiche visite)
   ─────────────────────────────────────────────────────────────── */
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.star {
    background: none;
    border: none;
    padding: 0 0.05rem;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    color: var(--border-strong);
    transition: transform 0.12s ease, color 0.12s ease;
}

.star:hover { transform: scale(1.15); }
.star-on { color: #f59e0b; }
.star-rating-ro .star { cursor: default; }
.star-rating-ro .star:hover { transform: none; }

.star-value {
    margin-left: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.piece-eval-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.piece-eval {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--surface-2);
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.piece-eval-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.piece-eval-name {
    font-weight: 600;
    color: var(--heading);
}

/* ───────────────────────────────────────────────────────────────
   39. POINTS D'INTÉRÊT & TEMPS DE TRAJET
   ─────────────────────────────────────────────────────────────── */
.poi-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
}

.poi-row:last-child { border-bottom: none; }

.poi-icon {
    font-size: 1.4rem;
    flex: 0 0 auto;
    width: 2rem;
    text-align: center;
}

.poi-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.poi-name { font-weight: 600; color: var(--heading); }
.poi-mode { margin-left: 0.3rem; }

.poi-address {
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trajet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.trajet-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--surface-2);
}

.trajet-icon { font-size: 1.5rem; flex: 0 0 auto; }
.trajet-info { display: flex; flex-direction: column; min-width: 0; }
.trajet-name { font-weight: 600; color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trajet-time { font-weight: 700; color: var(--accent); }
.trajet-dist { font-weight: 500; color: var(--text-muted); font-size: 0.8rem; }
.trajet-err { font-size: 0.8rem; color: var(--text-muted); }

/* Marqueur de carte coloré par statut (divIcon Leaflet). */
.map-pin span {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    margin: 2px;
}

@media (max-width: 576px) {
    .cal-cell { min-height: 62px; border-radius: 0.5rem; padding: 0.2rem; }
    .cal-grid { gap: 0.2rem; }
    .cal-event-text { display: none; }
    .cal-event { justify-content: center; padding: 0.1rem; }
    .cal-upcoming-date { font-size: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
    .modal-dialog .modal-content { animation: none !important; }
}

/* ───────────────────────────────────────────────────────────────
   35. LANDING PUBLIQUE (visiteurs anonymes)
   ─────────────────────────────────────────────────────────────── */
.lp {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}
.lp-container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding-inline: 1.5rem;
}
.lp .lp-eyebrow {
    display: inline-block;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: .75rem;
}
.lp-grad {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Header */
.lp-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    border-bottom: 1px solid var(--border);
}
.lp-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 66px;
}
.lp-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.lp-nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: .95rem;
    transition: color .15s ease;
}
.lp-nav-link:hover { color: var(--text); }
.lp-login-btn { padding-inline: 1.25rem; }

/* Hero */
.lp-hero {
    position: relative;
    padding-block: clamp(3rem, 8vw, 6rem);
    overflow: hidden;
}
.lp-hero-glow {
    position: absolute;
    top: -30%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    max-width: 720px;
    max-height: 720px;
    background: radial-gradient(circle, var(--accent-glow), transparent 62%);
    filter: blur(30px);
    opacity: .6;
    pointer-events: none;
    z-index: 0;
}
.lp-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 3rem;
    align-items: center;
}
.lp-hero-title {
    font-size: clamp(2.1rem, 4.6vw, 3.4rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.02em;
    margin-bottom: 1.25rem;
}
.lp-hero-sub {
    font-size: 1.12rem;
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 33rem;
    margin-bottom: 2rem;
}
.lp-hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
    margin-bottom: 2rem;
}
.lp-cta-main {
    background: var(--accent-gradient);
    border: none;
    box-shadow: 0 10px 26px var(--accent-glow);
    padding-inline: 1.9rem;
    font-weight: 700;
}
.lp-cta-main:hover { filter: brightness(1.06); }
.lp-cta-ghost {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
}
.lp-cta-ghost:hover { background: var(--surface-hover); color: var(--text); }
.lp-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: .92rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Hero visual (mock de fiche) */
.lp-hero-visual {
    position: relative;
    min-height: 360px;
}
.lp-mock {
    position: absolute;
    border-radius: 1.25rem;
    border: 1px solid var(--border);
    background: var(--surface-solid);
    box-shadow: var(--shadow-lg);
}
.lp-mock-back {
    inset: 2.5rem 0 0 3.5rem;
    background: var(--accent-gradient-soft), var(--surface-solid);
    transform: rotate(4deg);
    opacity: .8;
}
.lp-mock-main {
    inset: 0 3rem 2.5rem 0;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .85rem;
    animation: lp-float 6s ease-in-out infinite;
}
@keyframes lp-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.lp-mock-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.lp-mock-title {
    height: 12px;
    width: 45%;
    border-radius: 6px;
    background: var(--text-muted);
    opacity: .35;
}
.lp-mock-verdict {
    font-size: .72rem;
    font-weight: 700;
    color: var(--accent-contrast);
    background: var(--accent-gradient);
    padding: .28rem .6rem;
    border-radius: 999px;
    white-space: nowrap;
}
.lp-mock-img {
    height: 118px;
    border-radius: .8rem;
    background: var(--accent-gradient-soft), var(--surface-2);
}
.lp-mock-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
}
.lp-mock-stat {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .5rem .6rem;
    border-radius: .6rem;
    background: var(--surface-2);
}
.lp-mock-stat span { font-size: .68rem; color: var(--text-muted); }
.lp-mock-stat b { font-size: .92rem; }
.lp-mock-stat .lp-dpe { color: var(--accent-2); }
.lp-mock-bars {
    display: flex;
    align-items: flex-end;
    gap: .5rem;
    height: 48px;
}
.lp-mock-bar {
    flex: 1;
    height: var(--v);
    border-radius: .4rem .4rem 0 0;
    background: var(--accent-gradient);
    opacity: .85;
}

/* Sections */
.lp-section { padding-block: clamp(3rem, 6vw, 5rem); }
.lp-section-alt { background: var(--surface-2); }
.lp-section-head {
    text-align: center;
    max-width: 42rem;
    margin: 0 auto 3rem;
}
.lp-section-title {
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: .6rem;
}
.lp-section-sub {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* Grille de fonctionnalités */
.lp-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
.lp-feature {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease;
}
.lp-feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}
.lp-feature-icon {
    font-size: 1.8rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .8rem;
    background: var(--accent-gradient-soft), var(--surface-2);
    margin-bottom: 1rem;
}
.lp-feature-title { font-size: 1.12rem; font-weight: 700; margin-bottom: .4rem; }
.lp-feature-text { color: var(--text-muted); line-height: 1.55; margin: 0; }

/* Étapes */
.lp-steps {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.lp-step {
    flex: 1;
    min-width: 220px;
    max-width: 300px;
    text-align: center;
    padding: 1.5rem;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
}
.lp-step-num {
    width: 2.6rem;
    height: 2.6rem;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--accent-contrast);
    background: var(--accent-gradient);
    border-radius: 999px;
    box-shadow: 0 6px 16px var(--accent-glow);
}
.lp-step-title { font-size: 1.15rem; font-weight: 700; margin-bottom: .4rem; }
.lp-step-text { color: var(--text-muted); line-height: 1.55; margin: 0; }
.lp-step-arrow {
    display: flex;
    align-items: center;
    font-size: 1.6rem;
    color: var(--accent);
    font-weight: 700;
}

/* Confidentialité */
.lp-privacy {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    background: var(--accent-gradient-soft), var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: clamp(1.5rem, 4vw, 2.75rem);
    box-shadow: var(--shadow-sm);
}
.lp-privacy-badge {
    flex-shrink: 0;
    width: 4.5rem;
    height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    border-radius: 1rem;
    background: var(--surface-solid);
    box-shadow: var(--shadow-sm);
}
.lp-privacy .lp-section-title { text-align: left; }
.lp-privacy .lp-section-sub { text-align: left; }

/* CTA final */
.lp-final-inner {
    text-align: center;
    background: var(--accent-gradient);
    border-radius: 1.5rem;
    padding: clamp(2.5rem, 6vw, 4rem) 1.5rem;
    box-shadow: 0 20px 50px var(--accent-glow);
}
.lp-final-title {
    font-size: clamp(1.7rem, 3.4vw, 2.5rem);
    font-weight: 800;
    color: var(--accent-contrast);
    margin-bottom: .5rem;
}
.lp-final-sub {
    color: var(--accent-contrast);
    opacity: .9;
    font-size: 1.1rem;
    margin-bottom: 1.75rem;
}
.lp-final .lp-cta-main {
    background: var(--surface-solid);
    color: var(--accent-strong);
    box-shadow: 0 10px 26px rgba(0,0,0,.18);
}

/* Footer */
.lp-footer {
    border-top: 1px solid var(--border);
    padding-block: 2rem;
}
.lp-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.lp-footer-copy { color: var(--text-muted); font-size: .88rem; }

/* Bouton retour de la mire */
.login-back {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: .9rem;
    padding: 0;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: color .15s ease;
}
.login-back:hover { color: var(--text); }

/* Responsive */
@media (max-width: 860px) {
    .lp-hero-grid { grid-template-columns: 1fr; }
    .lp-hero-visual { display: none; }
    .lp-features { grid-template-columns: repeat(2, 1fr); }
    .lp-step-arrow { display: none; }
    .lp-privacy { flex-direction: column; text-align: center; }
    .lp-privacy .lp-section-title, .lp-privacy .lp-section-sub { text-align: center; }
}
@media (max-width: 560px) {
    .lp-nav { gap: .9rem; }
    .lp-nav-link { display: none; }
    .lp-features { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .lp-mock-main { animation: none; }
}

/* ── Critères auto-alimentés : emphase bouton synthèse + pastille de nav ───────── */
.btn-pulse {
    animation: btnPulse 1.8s ease-in-out infinite;
}
@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow, rgba(79, 70, 229, 0.35)); }
    50% { box-shadow: 0 0 0 6px transparent; }
}
@media (prefers-reduced-motion: reduce) {
    .btn-pulse { animation: none; }
}

.nav-pastille {
    display: inline-block;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.35rem;
    margin-left: auto;
    border-radius: 999px;
    background: var(--accent, #4338ca);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.15rem;
    text-align: center;
}
