/* =========================================================================
   BienImmobilier.ch - Mon compte (portail membre)
   Palette v2 (vert BienImmo) · Bricolage Grotesque + Inter
   ========================================================================= */

:root {
    --ink: #14171c;
    --ink-2: #232830;
    --paper: #ffffff;
    --cream: #f5f4ef;
    --cream-2: #efeee7;
    --line: #e6e5df;

    --green: #6cbf3b;
    --green-dark: #4d9a2a;
    --green-deep: #37711c;
    --green-pale: #eaf6dc;
    --green-bg: #f4faee;

    --muted: #6b7480;
    --muted-2: #8b939c;

    --radius: 18px;
    --radius-sm: 12px;
    --radius-lg: 26px;
    --shadow-sm: 0 2px 10px rgba(20, 23, 28, .05);
    --shadow: 0 14px 40px rgba(20, 23, 28, .10);
    --shadow-lg: 0 30px 70px rgba(20, 23, 28, .16);

    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --display: 'Bricolage Grotesque', 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--cream); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ── Boot ─────────────────────────────────────────────────────────────── */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); }
.boot-spin { width: 34px; height: 34px; border: 3px solid var(--green-pale); border-top-color: var(--green); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Boutons ──────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 999px; font-weight: 600; font-size: 15px; padding: 12px 20px; transition: .18s; white-space: nowrap; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-p { background: var(--green); color: #fff; box-shadow: 0 8px 22px rgba(108, 191, 59, .32); }
.btn-p:hover:not(:disabled) { background: var(--green-dark); }
.btn-g { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-g:hover:not(:disabled) { border-color: var(--green); color: var(--green-deep); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; padding: 8px 12px; }
.btn-ghost:hover { color: var(--ink); }
.btn-danger { background: transparent; color: #c0392b; border-color: #ecc7c2; }
.btn-danger:hover:not(:disabled) { background: #fdf1ef; }
.btn.full { width: 100%; }
.btn.sm { padding: 8px 14px; font-size: 13.5px; }
.btn-spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-g .btn-spin, .btn-danger .btn-spin { border-color: rgba(20,23,28,.2); border-top-color: var(--ink); }

/* ==========================================================================
   LOGIN - split gauche/droite
   ========================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }

/* Colonne gauche : formulaire */
.auth-left { display: flex; flex-direction: column; padding: 40px clamp(24px, 6vw, 88px); background: var(--paper); }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: -.01em; }
.auth-brand span { color: var(--green-deep); }
.auth-brand .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--green); color: #fff; display: grid; place-items: center; }
.auth-brand .mark .ico { width: 20px; height: 20px; }

.auth-body { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 400px; width: 100%; margin: 0 auto; padding: 40px 0; }
.auth-kicker { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; font-size: 12.5px; font-weight: 600; color: var(--green-deep); background: var(--green-pale); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }
.auth-title { font-family: var(--display); font-size: clamp(28px, 4vw, 36px); font-weight: 700; letter-spacing: -.02em; line-height: 1.08; }
.auth-sub { color: var(--muted); font-size: 15px; margin-top: 10px; line-height: 1.55; }

.field { margin-top: 20px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .ico { position: absolute; left: 14px; color: var(--muted-2); pointer-events: none; }
.field input { width: 100%; font: 500 15px var(--font); color: var(--ink); background: var(--cream); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px 14px 44px; transition: .18s; }
.field input:focus { outline: none; border-color: var(--green); background: #fff; box-shadow: 0 0 0 4px rgba(108, 191, 59, .12); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.field .link { color: var(--green-deep); font-weight: 600; }
.field .link:hover { text-decoration: underline; }

.turnstile-box { margin-top: 18px; min-height: 66px; }
.auth-actions { margin-top: 20px; }
.auth-actions .btn + .btn { margin-top: 10px; }

.auth-msg { margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13.5px; line-height: 1.5; }
.auth-msg.err { background: #fdf1ef; color: #b23b2b; border: 1px solid #f2d3cd; }
.auth-msg.ok { background: var(--green-bg); color: var(--green-deep); border: 1px solid var(--green-pale); }

.auth-sent { text-align: center; }
.auth-sent .env { width: 66px; height: 66px; border-radius: 20px; background: var(--green-pale); color: var(--green-deep); display: grid; place-items: center; margin: 0 auto 20px; }
.auth-sent .env .ico { width: 30px; height: 30px; stroke-width: 1.8; }
.auth-sent b { word-break: break-all; }

.auth-foot { color: var(--muted-2); font-size: 12.5px; margin-top: 20px; }
.auth-foot a { color: var(--green-deep); font-weight: 600; }

/* Colonne droite : promo */
.auth-right { position: relative; overflow: hidden; color: #fff; background: linear-gradient(150deg, var(--green-deep) 0%, var(--green-dark) 55%, var(--green) 100%); padding: 56px clamp(28px, 5vw, 72px); display: flex; flex-direction: column; justify-content: center; }
.auth-right::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 78% 18%, rgba(255,255,255,.16), transparent 46%), radial-gradient(circle at 12% 88%, rgba(255,255,255,.10), transparent 42%); pointer-events: none; }
.promo { position: relative; max-width: 460px; }
.promo-kicker { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .82; }
.promo h2 { font-family: var(--display); font-size: clamp(30px, 3.4vw, 42px); line-height: 1.06; letter-spacing: -.02em; margin-top: 12px; }
.promo p { font-size: 16px; line-height: 1.6; opacity: .9; margin-top: 16px; }
.promo-list { list-style: none; margin-top: 28px; display: grid; gap: 14px; }
.promo-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; }
.promo-list li .tick { width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.16); display: grid; place-items: center; flex-shrink: 0; }
.promo-list li .tick .ico { width: 16px; height: 16px; stroke-width: 2.6; }
.promo-cta { margin-top: 34px; display: inline-flex; align-items: center; gap: 9px; background: #fff; color: var(--green-deep); font-weight: 700; font-size: 15.5px; padding: 14px 24px; border-radius: 999px; box-shadow: var(--shadow); transition: .18s; }
.promo-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* Mock carte annonce (déco) */
.promo-card { position: relative; margin-top: 40px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); border-radius: var(--radius); padding: 16px; backdrop-filter: blur(6px); max-width: 340px; }
.promo-card .pc-img { height: 120px; border-radius: var(--radius-sm); background: linear-gradient(135deg, rgba(255,255,255,.28), rgba(255,255,255,.1)); display: grid; place-items: center; }
.promo-card .pc-img .ico { width: 42px; height: 42px; opacity: .7; stroke-width: 1.4; }
.promo-card .pc-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.promo-card .pc-title { font-weight: 700; font-size: 15px; }
.promo-card .pc-loc { font-size: 13px; opacity: .82; display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.promo-card .pc-price { font-family: var(--display); font-weight: 700; font-size: 18px; }
.promo-card .pc-badge { position: absolute; top: 26px; left: 26px; background: #fff; color: var(--green-deep); font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; }

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-right { display: none; }
    .auth-left { min-height: 100vh; }
}

/* ==========================================================================
   DASHBOARD - mes annonces
   ========================================================================== */
.app-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.app-header .wrap { max-width: 1080px; margin: 0 auto; padding: 14px clamp(16px, 4vw, 32px); display: flex; align-items: center; gap: 16px; }
.app-header .auth-brand { font-size: 18px; }
.app-header .spacer { flex: 1; }
.app-user { display: flex; align-items: center; gap: 10px; }
.app-user .av { width: 36px; height: 36px; border-radius: 50%; background: var(--green-pale); color: var(--green-deep); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.app-user .nm { font-size: 14px; font-weight: 600; }
.app-user .em { font-size: 12px; color: var(--muted); }
@media (max-width: 620px) { .app-user .meta { display: none; } }

.main { max-width: 1080px; margin: 0 auto; padding: clamp(24px, 5vw, 40px) clamp(16px, 4vw, 32px) 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { font-family: var(--display); font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; letter-spacing: -.02em; }
.page-head p { color: var(--muted); margin-top: 6px; font-size: 15px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat .k { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.stat .k .ico { width: 16px; height: 16px; color: var(--green); }
.stat .v { font-family: var(--display); font-size: 30px; font-weight: 700; margin-top: 6px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip { border: 1px solid var(--line); background: var(--paper); color: var(--muted); border-radius: 999px; padding: 8px 16px; font-size: 13.5px; font-weight: 600; transition: .16s; }
.chip:hover { color: var(--ink); }
.chip.active { background: var(--green); color: #fff; border-color: var(--green); }

.listings { display: grid; gap: 14px; }
.lcard { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; grid-template-columns: 128px 1fr auto; gap: 16px; align-items: center; transition: .16s; }
.lcard:hover { box-shadow: var(--shadow-sm); border-color: #dcdbd3; }
.lcard .thumb { width: 128px; height: 92px; border-radius: var(--radius-sm); background: var(--cream-2) center/cover no-repeat; display: grid; place-items: center; color: var(--muted-2); }
.lcard .thumb .ico { width: 30px; height: 30px; stroke-width: 1.4; }
.lcard .body { min-width: 0; }
.lcard .title { font-weight: 700; font-size: 16px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcard .meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 6px; }
.lcard .meta .loc { display: inline-flex; align-items: center; gap: 4px; }
.lcard .price { font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--ink); margin-top: 8px; }
.lcard .actions { display: flex; align-items: center; gap: 8px; }
@media (max-width: 720px) {
    .lcard { grid-template-columns: 88px 1fr; }
    .lcard .thumb { width: 88px; height: 72px; }
    .lcard .actions { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
}

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; letter-spacing: .01em; }
.badge.active { background: var(--green-pale); color: var(--green-deep); }
.badge.paused { background: #fdf3e0; color: #b7791f; }
.badge.expired { background: #f3e6e4; color: #b23b2b; }
.badge.pending { background: #e8eef7; color: #3b5b8c; }
.badge.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.empty { text-align: center; padding: 60px 20px; background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius-lg); }
.empty .em-icon { width: 72px; height: 72px; border-radius: 22px; background: var(--green-pale); color: var(--green-deep); display: grid; place-items: center; margin: 0 auto 20px; }
.empty .em-icon .ico { width: 34px; height: 34px; stroke-width: 1.6; }
.empty h3 { font-family: var(--display); font-size: 22px; font-weight: 700; }
.empty p { color: var(--muted); margin: 10px auto 22px; max-width: 380px; line-height: 1.55; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .25s; z-index: 60; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #b23b2b; }
