/* Direction « calme » : fond presque blanc, un seul accent vert profond, Rubik partout */
:root {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --surface-2: #F4F1EC;
  --line: #ECE8E1;
  --line-strong: #D9D4CA;
  --ink: #1A1714;
  --ink-2: #5E554B;
  --accent: #1F4D3A;
  --accent-ink: #163A2C;
  --accent-soft: #E8EFEC;
  --warn: #8A4A12;
  --warn-soft: #FDF1E4;
  --danger: #9B2C2C;
  --danger-soft: #FBEAEA;
  --radius: 16px;
  --font: 'Rubik', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.page { flex: 1; padding: 16px 16px 120px; display: flex; flex-direction: column; gap: 20px; }

/* En-tête */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
}
.logo { font-weight: 800; font-size: 22px; letter-spacing: -0.8px; color: var(--ink); }
.logo b { color: var(--accent); font-weight: 800; }
.logo { display: inline-flex; align-items: center; }
.logo-svg { display: block; height: 26px; width: auto; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.lang { display: flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.lang button { border: 0; background: transparent; border-radius: 999px; height: 32px; min-width: 36px; padding: 0 8px; font-size: 12px; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--surface-2); font-weight: 600; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; color: var(--ink);
}
[dir="rtl"] .flip { transform: scaleX(-1); }

.demo-banner { background: var(--warn-soft); color: var(--warn); font-size: 13px; padding: 8px 16px; text-align: center; }

/* Texte */
.hero h1 { font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -0.8px; }
.hero h1 span { color: var(--accent); }
.hero p { margin: 8px 0 0; color: var(--ink-2); max-width: 44ch; }
.h2 { font-size: 18px; font-weight: 700; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 14px; }
.wrap { flex-wrap: wrap; }

/* Recherche */
.search {
  display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 18px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px;
}
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; }

/* Cartes et tuiles */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.tile {
  display: flex; align-items: center; gap: 14px; padding: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
}
.tile-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tile-title { font-weight: 700; font-size: 16px; }
.tile-sub { font-size: 13px; color: var(--ink-2); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 12px; background: var(--surface-2); color: var(--ink); white-space: nowrap; }
.chip-accent { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.chip-dashed { background: transparent; border: 1px dashed var(--line-strong); color: var(--ink-2); padding: 7px 12px; font-size: 13px; }
.chip-warn { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.chip-danger { background: var(--danger-soft); color: var(--danger); font-weight: 600; }

.avatar {
  width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 84px; height: 84px; font-size: 28px; }

.pro-card { display: flex; flex-direction: column; gap: 12px; color: var(--ink); }
.pro-card .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding-top: 10px; border-top: 1px solid var(--line); }
.rating { font-weight: 700; font-variant-numeric: tabular-nums; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat b { font-size: 18px; font-variant-numeric: tabular-nums; }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.list > * { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.list > *:last-child { border-bottom: 0; }

.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.photos button { padding: 0; border: 0; background: var(--surface-2); border-radius: 10px; overflow: hidden; aspect-ratio: 1; cursor: zoom-in; }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.ph-fig { margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ph-fig button { width: 100%; }
.ph-fig figcaption { font-size: 12px; line-height: 1.3; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.photos-edit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ph-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ph-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.ph-card .input { font-size: 14px; padding: 8px 10px; min-height: 40px; }

.review { display: flex; flex-direction: column; gap: 8px; }
.review-photo { width: 88px; height: 88px; border-radius: 10px; object-fit: cover; }
.reply { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13px; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 8px 18px; line-height: 1.2; border-radius: 14px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer; text-align: center; width: 100%;
}
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-dark { background: var(--ink); color: #FFFFFF; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-wa { background: #1F7A4C; color: #FFFFFF; }
.btn-sm { min-height: 40px; font-size: 14px; border-radius: 12px; width: auto; padding: 6px 14px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }

.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
}
.cta-bar .inner { max-width: 528px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }

/* Formulaires */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
input[type="file"] { max-width: 100%; }
.uc { unicode-bidi: plaintext; }
.field label, .label { font-size: 14px; font-weight: 600; }
.input, textarea.input, select.input {
  width: 100%; min-height: 48px; padding: 12px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); font-size: 16px;
}
textarea.input { resize: vertical; min-height: 96px; }
.help { font-size: 12px; color: var(--ink-2); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg label {
  flex: 1; min-width: 90px; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); font-size: 14px; cursor: pointer; padding: 0 8px;
}
.seg input { accent-color: var(--accent); }
.seg label:has(input:checked) { border: 2px solid var(--ink); font-weight: 600; }
.seg-compact label { position: relative; min-width: 0; flex: 1 1 0; padding: 0 2px; }
.seg-compact input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-compact label:has(input:checked) { background: var(--accent-soft); border: 2px solid var(--accent); color: var(--accent-ink); }
.seg-compact label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.error { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.notice { background: var(--warn-soft); color: var(--warn); padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.success { background: var(--accent-soft); color: var(--accent-ink); padding: 10px 12px; border-radius: 12px; font-size: 14px; }

.stars { display: flex; gap: 4px; }
.stars button { width: 48px; height: 48px; border: 0; background: transparent; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }

/* Onglets */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tabs button {
  flex-shrink: 0; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); font-size: 14px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--ink); color: #FFFFFF; border-color: var(--ink); font-weight: 600; }
.badge { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #FFFFFF; font-size: 12px; align-items: center; justify-content: center; margin-inline-start: 6px; }

.balance { background: var(--ink); color: #FFFFFF; border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.balance b { font-size: 36px; letter-spacing: -0.8px; font-variant-numeric: tabular-nums; }
.balance span { color: #D9D4CA; font-size: 13px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: start; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-2); font-weight: 600; }

.empty { text-align: center; padding: 28px 16px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.empty b { color: var(--ink); font-size: 16px; }

/* Fenêtre modale et visionneuse photo */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(26, 23, 20, .55); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.modal .sheet { background: var(--surface); border-radius: 20px; padding: 20px; width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 12px; max-height: 90vh; overflow: auto; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; padding: 16px; }
.lightbox img { max-height: 80vh; max-width: 100%; border-radius: 10px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 70;
  background: var(--ink); color: #FFFFFF; padding: 10px 16px; border-radius: 999px; font-size: 14px;
}

.install { display: flex; align-items: center; gap: 12px; }

@media (prefers-reduced-motion: no-preference) {
  .page { animation: fade .18s ease-out; }
  @keyframes fade { from { opacity: .4; } to { opacity: 1; } }
}

/* Réalisations : carrousel à faire glisser */
.carousel { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
.carousel::-webkit-scrollbar { display: none; }
.slide { margin: 0; flex: 0 0 40%; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.slide button { padding: 0; border: 0; background: var(--surface-2); border-radius: 14px; overflow: hidden; aspect-ratio: 1; cursor: zoom-in; width: 100%; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide figcaption { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-2); line-height: 1.35; }

.dots { display: flex; justify-content: center; gap: 6px; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); transition: width .2s, background .2s; }
.dots span.on { width: 18px; border-radius: 3px; background: var(--accent); }
/* Galerie plein écran */
.gallery { position: fixed; inset: 0; z-index: 70; background: #0d0d0c; display: flex; flex-direction: column; }
.gal-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gal-track::-webkit-scrollbar { display: none; }
.gal-track figure { margin: 0; flex: 0 0 100%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; box-sizing: border-box; }
.gal-track img { max-width: 100%; max-height: 72vh; border-radius: 10px; object-fit: contain; }
.gal-track figcaption { color: #fff; font-size: 15px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.gal-track figcaption span { color: #9a948c; font-size: 13px; }
.gal-close { position: fixed; top: calc(env(safe-area-inset-top) + 14px); inset-inline-end: 14px; z-index: 80; width: 48px; height: 48px; border-radius: 50%; border: 0; background: #fff; color: #1A1714; font-size: 30px; line-height: 1; cursor: pointer; box-shadow: 0 2px 12px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }

/* Métiers en grille */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile-sq { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; }
.tile-sq .tile-icon { width: 40px; height: 40px; }
.tile-sq .tile-title { font-size: 15px; }
.tile-sq .tile-sub { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-sq > svg { display: none; }
