/* Buscamos — design maquette v2 (mode clair) */
:root {
    --ground: #ffffff;
    --panel: #ffffff;
    --panel-2: #f6f8fc;
    --line: #e4e8f1;
    --ink: #131c33;
    --ink-2: #5a6478;
    --ink-4: #8a94a8;
    --accent: #2f6fae;
    --accent-strong: #245a91;
    --accent-soft: rgba(47, 111, 174, 0.1);
    --chip-bg: #e8eff8;
    --chip-ink: #2f6fae;
    --green: #1e9e5a;
    --green-soft: rgba(30, 158, 90, 0.12);
    --orange: #c9822e;
    --overlay: rgba(19, 28, 51, 0.4);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--ground);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.55;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 48px; }

/* ============ Barre d'application ============ */
.appbar {
    display: flex; align-items: center; justify-content: space-between;
    margin: 0 0 16px; padding: 4px 2px 14px;
    border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-icon { width: 30px; height: 30px; border-radius: 8px; }
.brand-name {
    font-weight: 800; font-size: 17px; letter-spacing: 0.2px; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.appbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--panel);
    color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--panel-2); }
@media (max-width: 420px) {
    .brand-name { font-size: 15px; }
}

/* ============ Tiroir (menu) ============ */
.drawer-wrap { position: relative; z-index: 30; }
.drawer-overlay { position: fixed; inset: 0; background: var(--overlay); }
.drawer {
    position: absolute; top: -8px; right: 0; width: min(300px, 86vw);
    background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
    padding: 14px 10px; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
    display: flex; flex-direction: column; gap: 2px;
}
.drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.drawer-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; border: 0; border-radius: 10px;
    background: none; color: var(--ink-2); font: inherit; font-size: 15px; font-weight: 600;
    cursor: pointer; text-align: left; width: 100%; text-decoration: none;
}
.drawer-item:hover { background: var(--panel-2); color: var(--ink); }
.drawer-item-on { color: var(--accent-strong); background: var(--accent-soft); }
.drawer-sep { height: 1px; background: var(--line); margin: 10px 4px; }
.drawer-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; }
.drawer-row-label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.drawer-langs { display: flex; gap: 6px; }

/* ============ Sélecteur de langue ============ */
.langswitch { margin: 2px 0 18px; }
.langswitch-label { font-size: 13px; color: var(--ink-2); text-align: center; margin-bottom: 8px; }
.langswitch-btns { display: flex; gap: 10px; }
.lang-btn {
    flex: 1; padding: 17px 0; font: inherit; font-size: 19px; font-weight: 700;
    border-radius: 13px; cursor: pointer; letter-spacing: 0.2px;
    border: 2px solid var(--line); background: var(--panel); color: var(--ink-2);
}
.lang-btn.lang-on { border-color: var(--accent); background: var(--accent); color: #ffffff; }

/* ============ En-tête ============ */
.page-head h1 { font-size: 26px; margin: 2px 0 4px; line-height: 1.25; }
.page-head .fact { font-size: 14px; color: var(--ink-2); margin: 0 0 10px; }
.page-head .intro { font-size: 15px; line-height: 1.55; margin: 0 0 14px; }

/* ============ Onglets (pilules) ============ */
.tabs {
    display: flex; gap: 6px; margin: 4px 0 16px;
    overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex: 1 0 auto; text-align: center; font: inherit; font-size: 14px; font-weight: 600;
    color: var(--ink-2); background: var(--panel);
    border: 1px solid var(--line); border-radius: 999px;
    padding: 10px 14px; min-height: 44px; cursor: pointer; white-space: nowrap;
}
.tab-on { background: var(--accent); border-color: var(--accent); color: #ffffff; }

/* ============ Panneaux ============ */
.panel {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: 14px; padding: 14px 16px; margin: 0 0 12px;
}

/* ============ Tableau de bord ============ */
.dash { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.dash-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; }
.dash-head { display: flex; align-items: center; justify-content: space-between; }
.dash-title { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.dash-view {
    font: inherit; font-size: 13px; font-weight: 600; color: var(--accent-strong);
    background: none; border: 0; cursor: pointer; padding: 4px 0;
}
.dash-number { font-size: 34px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dash-sub { font-size: 13px; color: var(--ink-2); }
.segbar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--panel-2); margin-top: 6px; }
.seg { display: block; height: 100%; }
.seg-green { background: var(--green); }
.seg-blue { background: var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.legend b { color: var(--ink); font-weight: 700; margin-left: 2px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 999px; margin-right: 6px; }
.dot-green { background: var(--green); }
.dot-blue { background: var(--accent); }
.minibar-row { margin-top: 10px; }
.minibar-label { font-size: 13px; color: var(--ink-2); display: block; margin-bottom: 5px; }
.minibar { height: 7px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.minibar-fill { height: 100%; border-radius: 999px; background: var(--green); }

/* ============ Stats (Objectif) ============ */
.stats { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.stat { display: flex; flex-direction: column; gap: 3px; }
.stat-value { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-date { font-size: 21px; }
.stat-label { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
@media (min-width: 640px) {
    .stats { flex-direction: row; }
    .stat { flex: 1; }
}

/* ============ Progression ============ */
.progression-tete { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.progression-titre { font-weight: 600; font-size: 14px; }
.progression-pct { font-weight: 800; font-variant-numeric: tabular-nums; }
.progression-barre { height: 10px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.progression-remplissage { height: 100%; border-radius: 999px; background: var(--accent); }
.progression-txt { display: block; margin-top: 8px; font-size: 13px; color: var(--ink-2); }

/* ============ Tableaux ============ */
.table-wrap { padding: 4px 16px; }
.table-head {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 2px 8px; font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-2);
    border-bottom: 1px solid var(--line);
}
.table-head span:first-child { flex: 0 0 34%; }
.table-head span:nth-child(2) { flex: 1; }
.table-head-pistes { text-align: right; }
.table-row {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 2px; border-bottom: 1px solid var(--line);
}
.table-row:last-child { border-bottom: 0; }
.cal-date { flex: 0 0 34%; font-weight: 600; font-size: 14px; line-height: 1.3; }
.cal-zone { flex: 1; color: var(--ink-2); font-size: 13px; line-height: 1.35; }
.chip {
    font-size: 12px; font-weight: 700; white-space: nowrap;
    color: var(--chip-ink); background: var(--chip-bg);
    border-radius: 999px; padding: 4px 11px;
}
.rdv-note { font-size: 14px; line-height: 1.55; margin: 14px 0 0; background: var(--accent-soft); border-color: transparent; }

/* ============ Textes ============ */
h2 { font-size: 19px; margin: 20px 0 10px; }
.clin-oeil { margin: 14px 0 4px; font-size: 15px; line-height: 1.55; }
.caption { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 8px 0; }
.muted { color: var(--ink-2); font-size: 14px; }
.small { font-size: 13px; }
a { color: var(--accent-strong); }

/* ============ Boutons ============ */
.btn-primary, a.btn-primary {
    display: block; width: 100%; text-align: center; text-decoration: none;
    font: inherit; font-weight: 700; font-size: 15px; color: #ffffff;
    background: var(--accent); border: 0; border-radius: 11px;
    padding: 15px 16px; min-height: 50px; cursor: pointer;
}
.btn-primary:active { background: var(--accent-strong); }
.btn-outline, a.btn-outline {
    display: flex; align-items: center; justify-content: center; margin-top: 8px;
    font: inherit; font-weight: 600; color: var(--accent-strong); text-decoration: none;
    background: none; border: 1.5px solid var(--accent); border-radius: 11px;
    padding: 12px 16px; min-height: 46px; cursor: pointer; width: 100%;
}

/* ============ Inscription ============ */
.etapes { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.etape { display: flex; align-items: center; gap: 12px; margin-bottom: 0; }
.etape-num {
    flex: none; width: 30px; height: 30px; border-radius: 999px;
    background: var(--accent); color: #ffffff; font-weight: 800; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
}
.etape-txt { font-size: 15px; font-weight: 500; }
@media (min-width: 640px) { .etapes { flex-direction: row; gap: 12px; } .etape { flex: 1; } }
.instruction { margin: 0 0 12px; font-size: 15px; line-height: 1.5; }

/* ============ Questions ============ */
.questions { margin: 16px 0 2px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.questions-titre { font-weight: 700; }
.questions-txt { color: var(--ink-2); line-height: 1.5; }

/* ============ Fiches (onglet public) ============ */
.lock-panel { text-align: center; }
.lock-ico { font-size: 30px; }

/* ============ Fermeture ============ */
.closing { text-align: center; color: var(--ink-2); font-size: 14px; margin: 26px 0 0; }

/* ============ Puces génériques ============ */
.chip-btn {
    font: inherit; font-size: 12.5px; font-weight: 600;
    color: var(--ink-2); background: var(--panel-2);
    border: 1px solid var(--line); border-radius: 999px;
    padding: 7px 13px; cursor: pointer; min-height: 34px;
}
.chip-btn.chip-on { background: var(--chip-bg); color: var(--chip-ink); border-color: transparent; }

/* ============ Connexion ============ */
.login-card { max-width: 420px; margin: 30px auto 0; text-align: center; padding: 26px 22px; }
.login-card img { width: 84px; height: auto; border-radius: 14px; }
.login-card h1 { font-size: 22px; margin: 10px 0 6px; }
.login-card input[type="password"] {
    width: 100%; font: inherit; font-size: 18px; padding: 14px; border-radius: 11px;
    border: 2px solid var(--line); margin: 14px 0 10px; background: #fff; color: var(--ink);
}
.login-card input[type="password"]:focus { outline: none; border-color: var(--accent); }
.erreur {
    background: #fdecea; color: #a33; border: 1px solid #f5c6c0;
    border-radius: 10px; padding: 10px; font-size: 14px; margin-top: 10px;
}

/* ============ Mini sélecteur de langue (barre du haut) ============ */
.lang-mini { display: flex; gap: 4px; align-items: center; }
.lang-mini-btn {
    font: inherit; font-size: 13px; font-weight: 700; padding: 7px 10px;
    border-radius: 9px; border: 1px solid var(--line); background: var(--panel);
    color: var(--ink-2); cursor: pointer; min-height: 34px;
}
.lang-mini-btn.lang-on { background: var(--accent); border-color: var(--accent); color: #fff; }
