/* ==========================================================================
   Monasso — feuille de style principale
   Mobile-first. Aucune bibliothèque externe, aucun emoji.
   ========================================================================== */

:root {
    --brand: #0f766e;
    --brand-600: #0d9488;
    --brand-700: #115e59;
    --brand-100: #ccfbf1;
    --brand-50: #f0fdfa;
    --accent: #f59e0b;
    --ink: #0f172a;
    --ink-soft: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f4f7f6;
    --card: #ffffff;
    --danger: #dc2626;
    --success: #15803d;
    --warn: #b45309;
    --r-sm: 10px;
    --r: 16px;
    --r-lg: 20px;
    --r-full: 999px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.warn-text { color: var(--warn); }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 780px; }

/* ---------- Écran d'ouverture (application installée) ---------- */
#app-splash {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.02em;
}
#app-splash.show { display: flex; animation: splashOut 0.4s ease 1.2s forwards; }
#app-splash img { border-radius: 22px; }
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--r-full);
    padding: 11px 18px;
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(15, 118, 110, 0.22); }
.btn-primary:hover { background: var(--brand-700); }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink-soft); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: rgba(15, 118, 110, 0.08); color: var(--brand); }
.btn-light { background: #fff; color: var(--brand-700); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-soft { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn-xs { padding: 6px 11px; font-size: 0.79rem; gap: 5px; }
.btn-lg { padding: 14px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: 0.5; pointer-events: none; }

.icon-btn {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink-soft);
    cursor: pointer;
    transition: transform 0.12s ease, color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn:hover { color: var(--brand); border-color: var(--brand-100); }
.icon-btn.danger { color: var(--danger); border-color: #fecaca; }

/* ---------- Cartes ---------- */
.card {
    background: var(--card);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    border: 1px solid rgba(15, 23, 42, 0.04);
    padding: 18px;
}
.card + .card { margin-top: 14px; }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.cards { display: grid; gap: 14px; grid-template-columns: 1fr; }
.cards .card + .card { margin-top: 0; }
.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr; }

/* ---------- Barre supérieure ---------- */
.topbar, .app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    padding-top: env(safe-area-inset-top, 0px);
}
.topbar-inner, .app-header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    max-width: 1120px;
    margin: 0 auto;
    min-height: 58px;
}
.brand-row { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: 0 0 auto; }
.brand-row:hover { text-decoration: none; }
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 0.98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 44vw; }
.brand-text small { color: var(--muted); font-size: 0.74rem; }
.topbar-actions, .app-header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.nav-links { display: none; gap: 20px; margin-left: 24px; }
.nav-links a { color: var(--ink-soft); font-size: 0.92rem; font-weight: 500; }
.nav-links a:hover { color: var(--brand); }

/* ---------- Hero / page publique ---------- */
.page-public main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

.hero { padding: 26px 0 10px; }
.hero-inner { display: grid; gap: 26px; grid-template-columns: 1fr; align-items: center; }
.eyebrow {
    display: inline-block;
    background: var(--brand-50);
    color: var(--brand-700);
    border: 1px solid var(--brand-100);
    border-radius: var(--r-full);
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 14px;
}
.hero h1 { font-size: clamp(1.85rem, 7vw, 3rem); letter-spacing: -0.02em; }
.hero-sub { margin-top: 14px; color: var(--ink-soft); font-size: 1.02rem; max-width: 60ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.hero-trust { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; color: var(--ink-soft); font-size: 0.9rem; }
.hero-trust li { display: flex; align-items: center; gap: 8px; }
.hero-trust svg { color: var(--brand); flex: 0 0 auto; }
.hero-media { position: relative; }
.hero-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.hero-card {
    position: relative;
    margin: -34px 14px 0;
    background: #fff;
    border-radius: var(--r);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    z-index: 2;
}
.hero-card-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.9rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.dot-green { background: var(--success); }
.hero-card-bars { margin: 10px 0 6px; }
.hero-card-bars span { display: block; height: 8px; border-radius: var(--r-full); background: linear-gradient(90deg, var(--brand), var(--brand-600)); }

.section { padding: 40px 0; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { margin-bottom: 22px; }
.section-title { font-size: clamp(1.35rem, 4.4vw, 1.9rem); letter-spacing: -0.015em; }
.section-sub { color: var(--muted); margin-top: 8px; max-width: 62ch; }

.feature { display: flex; flex-direction: column; gap: 10px; }
.feature-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--brand-50);
    color: var(--brand);
    border: 1px solid var(--brand-100);
}
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--ink-soft); font-size: 0.94rem; }
.feature-sm { padding: 16px; gap: 8px; }

.steps { display: grid; gap: 16px; grid-template-columns: 1fr; }
.step { background: #fff; border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); border: 1px solid rgba(15, 23, 42, 0.04); }
.step-num {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    margin-bottom: 10px;
}
.step p { color: var(--ink-soft); font-size: 0.94rem; margin-top: 6px; }

.pricing { display: grid; gap: 16px; grid-template-columns: 1fr; }
.plan { display: flex; flex-direction: column; gap: 12px; }
.plan-featured { border: 2px solid var(--brand-100); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-price { font-size: 2rem; font-weight: 800; color: var(--brand-700); }
.plan-price span { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.plan-features { display: flex; flex-direction: column; gap: 8px; }
.plan-features li { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--ink-soft); }
.plan-features svg { color: var(--brand); flex: 0 0 auto; }
.plan-note { text-align: center; }

.faq { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: #fff; border-radius: var(--r); box-shadow: var(--shadow-sm); border: 1px solid var(--line); padding: 14px 16px; }
.faq-item summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; float: right; color: var(--brand); font-weight: 700; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin-top: 10px; color: var(--ink-soft); font-size: 0.93rem; }

.cta-band { background: linear-gradient(135deg, var(--brand), var(--brand-700)); color: #fff; padding: 34px 0; }
.cta-inner { display: grid; gap: 18px; grid-template-columns: 1fr; align-items: center; }
.cta-band h2 { font-size: 1.4rem; }
.cta-band p { margin-top: 8px; opacity: 0.92; }

/* ---------- Pied de page ---------- */
.site-footer { background: #fff; border-top: 1px solid var(--line); padding: 32px 0 calc(96px + env(safe-area-inset-bottom)); margin-top: 0; }
.footer-grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
.footer-grid h4 { font-size: 0.9rem; margin-bottom: 10px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--ink-soft); font-size: 0.9rem; }
.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 26px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8rem;
}

/* ---------- Barre de navigation du bas ---------- */
.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    gap: 4px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
}
.tab {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 4px;
    border-radius: var(--r-full);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.12s ease, background 0.18s ease, color 0.18s ease;
}
.tab:hover { text-decoration: none; }
.tab:active { transform: scale(0.97); }
.tab.is-active { background: var(--brand); color: #fff; }
.tab-icon { display: grid; place-items: center; }
.tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Application ---------- */
.page-app { padding-bottom: 0; }
.app-main { max-width: 940px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
.page-head { margin-bottom: 14px; }
.page-head h1 { font-size: 1.35rem; letter-spacing: -0.01em; }

.welcome-band {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--brand-50);
    border: 1px solid var(--brand-100);
    border-radius: var(--r);
    padding: 14px 16px;
    margin: 14px auto 0;
    max-width: 940px;
}
.welcome-band strong { display: block; }
.welcome-band .icon-btn { margin-left: auto; background: transparent; border-color: transparent; }

.kpi-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 14px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px; }
.kpi-label { font-size: 0.76rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.kpi-value { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; color: var(--brand-700); overflow-wrap: anywhere; }
.kpi-sm .kpi-value { font-size: 1.2rem; }
.kpi-foot { line-height: 1.3; }

.chart-card { display: flex; flex-direction: column; }
.chart-box { position: relative; height: 230px; width: 100%; }
.chart-fallback { display: flex; flex-direction: column; gap: 8px; }
.fb-row { display: grid; grid-template-columns: 62px 1fr 72px; align-items: center; gap: 8px; }
.fb-bar { display: block; height: 9px; border-radius: var(--r-full); background: #eef2f1; overflow: hidden; }
.fb-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-600)); }

.list { display: flex; flex-direction: column; }
.list .row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.list .row:last-child { border-bottom: 0; }
.list .row-stack { align-items: flex-start; flex-direction: column; gap: 6px; }
.row-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 130px; }
.row-main strong { font-size: 0.93rem; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-left: auto; }
.list .empty { padding: 10px 0; }

.ann { padding: 12px 0; border-bottom: 1px solid var(--line); }
.ann:last-child { border-bottom: 0; }
.ann-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ann p { margin: 6px 0 10px; color: var(--ink-soft); }

.avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--brand-100);
    color: var(--brand-700);
    font-weight: 700;
    font-size: 0.88rem;
}
.avatar-soft { background: #e8edec; color: var(--ink-soft); }

.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.field-inline { display: flex; gap: 10px; flex-wrap: wrap; }
.field-sm { max-width: 220px; }

.search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    padding: 9px 16px;
    color: var(--muted);
}
.search-field input {
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    width: 100%;
    color: var(--ink);
    padding: 0;
}

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.chip {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-soft);
    border-radius: var(--r-full);
    padding: 7px 14px;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}
.chip:active { transform: scale(0.97); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.list-cards { display: flex; flex-direction: column; gap: 12px; }
.filter-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--brand-50);
    border: 1px solid var(--brand-100);
    border-radius: var(--r);
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.member-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.member-main { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.member-info { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; }
.member-info strong { font-size: 0.98rem; }
.member-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.member-money { display: flex; gap: 12px; flex-wrap: wrap; }
.cotis-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-left: auto; }
.cotis-card.is-late { border-left: 4px solid var(--danger); }

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: var(--r-full);
    padding: 4px 11px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #eef2f1;
    color: var(--ink-soft);
    white-space: nowrap;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-muted { background: #eef2f1; color: #475569; }

.progress { height: 9px; background: #eef2f1; border-radius: var(--r-full); overflow: hidden; width: 100%; }
.progress span { display: block; height: 100%; border-radius: var(--r-full); background: linear-gradient(90deg, var(--brand), var(--brand-600)); transition: width 0.4s ease; }
.progress-thin { height: 6px; }

.project-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.project-media img { width: 100%; height: 190px; object-fit: cover; }
.project-body { padding: 16px; display: flex; flex-direction: column; gap: 9px; }
.project-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.empty-state { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; padding: 28px 18px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 0 4px; }

.plans-mini { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.plan-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 12px 14px;
}
.plan-mini.is-current { border-color: var(--brand-100); background: var(--brand-50); }
.plan-mini small { display: block; }

.install-row { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.store-hint { font-size: 0.82rem; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.store-logo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-soft);
    background: #f1f5f4;
    border-radius: var(--r-full);
    padding: 5px 12px;
}
.install-steps-icons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-bordered { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 12px; }
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); }
input, select, textarea {
    width: 100%;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 11px 13px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14); }
.legal-note { line-height: 1.45; }

/* ---------- Pages d'authentification ---------- */
.auth-wrap { display: flex; justify-content: center; padding: 26px 16px calc(96px + env(safe-area-inset-bottom)); }
.auth-card { width: 100%; max-width: 470px; background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 24px 20px; }
.auth-head { margin-bottom: 18px; }
.auth-head h1 { font-size: 1.5rem; }
.auth-badge {
    display: inline-block;
    background: var(--brand-50);
    color: var(--brand-700);
    border: 1px solid var(--brand-100);
    border-radius: var(--r-full);
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 10px;
}
.auth-foot { margin-top: 16px; font-size: 0.9rem; }
.auth-foot a { font-weight: 600; }

/* ---------- Messages ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: var(--r);
    padding: 12px 14px;
    font-size: 0.9rem;
    margin-bottom: 14px;
    line-height: 1.45;
}
.alert svg { flex: 0 0 auto; margin-top: 2px; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info { background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }

/* ---------- Feuilles (modales bas de page) ---------- */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.18s ease;
}
.sheet {
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 22px 22px 0 0;
    padding: 18px 16px calc(28px + env(safe-area-inset-bottom));
    box-shadow: var(--shadow-lg);
    animation: sheetUp 0.24s ease;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(22px); opacity: 0.4; } to { transform: translateY(0); opacity: 1; } }

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    animation: fadeIn 0.18s ease;
}
.modal {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: var(--r-lg);
    padding: 22px 20px;
    box-shadow: var(--shadow-lg);
}
.modal h3 { margin-bottom: 8px; }
.modal-sub { color: var(--ink-soft); font-size: 0.93rem; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1 1 0; }

/* ---------- Notifications ---------- */
.toast-wrap {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(92vw, 480px);
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #0f172a;
    color: #fff;
    border-radius: 14px;
    padding: 12px 15px;
    font-size: 0.88rem;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.22s ease;
}
.toast svg { flex: 0 0 auto; margin-top: 1px; }
.toast-success svg { color: #4ade80; }
.toast-error { background: #7f1d1d; }
.toast-error svg { color: #fecaca; }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: opacity 0.35s ease, transform 0.35s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   Adaptation aux grands écrans
   ========================================================================== */
@media (min-width: 640px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
    .install-row { flex-direction: row; align-items: center; justify-content: space-between; }
    .footer-bottom { flex-direction: row; justify-content: space-between; }
}

@media (min-width: 768px) {
    body { font-size: 15.5px; }
    .cards-2 { grid-template-columns: repeat(2, 1fr); }
    .cards-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .kpi-grid { grid-template-columns: repeat(4, 1fr); }
    .steps { grid-template-columns: repeat(3, 1fr); }
    .pricing { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
    .nav-links { display: flex; }
    .chart-box { height: 260px; }
    .sheet {
        border-radius: var(--r-lg);
        max-width: 620px;
        margin: auto auto 34px;
        padding: 22px 22px 26px;
    }
    .sheet-backdrop { align-items: center; }
    .toolbar { flex-direction: row; align-items: center; flex-wrap: wrap; }
    .toolbar .search-field { flex: 1 1 240px; }
    .toolbar-actions { margin-left: auto; }
    .hero { padding: 44px 0 16px; }
    .hero-trust { flex-direction: row; flex-wrap: wrap; gap: 18px; }
    .section { padding: 56px 0; }
    .cta-inner { grid-template-columns: 1.6fr auto; }
}

@media (min-width: 960px) {
    .hero-inner { grid-template-columns: 1.05fr 0.95fr; }
    .cards-3 { grid-template-columns: repeat(3, 1fr); }
    .tabbar { left: 50%; right: auto; width: 100%; max-width: 640px; transform: translateX(-50%); border-radius: var(--r-lg) var(--r-lg) 0 0; border: 1px solid var(--line); border-bottom: 0; }
}

/* Sécurité mobile : aucune grille collée sur très petit écran */
@media (max-width: 380px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .fb-row { grid-template-columns: 52px 1fr 62px; }
}
