/* Portail Client — Monarc Bâtisseurs Inc */
:root {
  --bg: #f4f4f5;
  --card: #ffffff;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --brand: #b45309;
  --brand-dark: #92400e;
  --brand-light: #fef3c7;
  --dark: #1c1917;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --bad: #b91c1c;
  --bad-bg: #fee2e2;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
a { color: var(--brand); }
.topbar {
  background: var(--dark);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .logo { font-weight: 800; font-size: 1.15rem; letter-spacing: .3px; display: flex; align-items: center; gap: 10px; }
.topbar .logo img { height: 42px; width: auto; display: block; mix-blend-mode: screen; }
.hero .hero-logo { width: 250px; max-width: 72%; height: auto; display: block; margin: 0 auto 18px; mix-blend-mode: screen; }
.topbar .logo span { color: #fbbf24; }
.topbar nav a { color: #e7e5e4; text-decoration: none; margin-left: 16px; font-size: .95rem; }
.topbar nav a:hover { color: #fbbf24; }
.container { max-width: 1080px; margin: 0 auto; padding: 24px 16px 60px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.card h2 { margin: 0 0 12px; font-size: 1.2rem; }
.card h3 { margin: 18px 0 8px; font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.btn {
  display: inline-block;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 1rem;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: #e7e5e4; color: var(--ink); }
.btn.secondary:hover { background: #d6d3d1; }
.btn.danger { background: var(--bad); }
.btn.small-btn { padding: 6px 12px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label { display: block; font-weight: 600; margin: 10px 0 4px; font-size: .92rem; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: #e0f2fe; color: #0369a1; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: .95rem; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .4px; }
tr:last-child td { border-bottom: 0; }
.amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.progress { background: #e7e5e4; border-radius: 999px; height: 12px; overflow: hidden; }
.progress > div { background: var(--brand); height: 100%; border-radius: 999px; transition: width .4s; }
.stages { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.stage-dot { padding: 6px 12px; border-radius: 999px; background: #e7e5e4; font-size: .85rem; }
.stage-dot.done { background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.stage-dot.current { background: var(--brand); color: #fff; font-weight: 700; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 10px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.gallery figcaption { font-size: .8rem; color: var(--muted); padding: 4px 2px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: .95rem;
}
.tab.active { background: var(--dark); color: #fff; border-color: var(--dark); }
.hero {
  background: linear-gradient(135deg, #1c1917 0%, #44403c 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  margin-bottom: 24px;
}
.hero h1 { margin: 0 0 10px; font-size: 2rem; }
.hero h1 span { color: #fbbf24; }
.hero p { color: #d6d3d1; max-width: 640px; margin: 0 auto 24px; }
.portal-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.portal-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.portal-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.portal-card .icon { font-size: 2.4rem; }
.portal-card h2 { margin: 10px 0 6px; font-size: 1.15rem; }
.portal-card p { color: var(--muted); font-size: .92rem; margin: 0; }
.code-box { max-width: 420px; margin: 60px auto; text-align: center; }
.code-box input { text-align: center; font-size: 1.4rem; letter-spacing: 3px; text-transform: uppercase; font-weight: 700; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .95rem; }
.alert.error { background: var(--bad-bg); color: var(--bad); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.info { background: #e0f2fe; color: #0369a1; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.modal { background: #fff; border-radius: var(--radius); padding: 24px; max-width: 520px; width: 100%; max-height: 90vh; overflow: auto; }
.modal h2 { margin-top: 0; }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.doc-row:last-child { border-bottom: 0; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 30px 0; }
@media (max-width: 640px) {
  .hero { padding: 32px 20px; }
  .hero h1 { font-size: 1.5rem; }
  th, td { padding: 8px 4px; font-size: .88rem; }
}
