:root {
  --paper: #FCFAF6;
  --surface: #FFFFFF;
  --ink: #1B211C;
  --ink-soft: #6E6E62;
  --line: #E8E2D4;
  --brass: #8E6F35;
  --forest: #2F5B37;
  --on-forest: #FFFFFF;

  --sage: #BFD8BA; --sage-ink: #2F5B37;
  --sky: #BFE1EC; --sky-ink: #265E73;
  --blush: #F6CBB8; --blush-ink: #95492A;
  --cream: #F6E5A9; --cream-ink: #7A5A12;
  --lavender: #D9D3EA; --lavender-ink: #4A4066;

  /* Rôles habitat (mêmes valeurs que ci-dessus, noms conservés pour compat) */
  --on-forest: #FFFFFF;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Work Sans', sans-serif;
}
h1, h2, h3, .display { font-family: 'Archivo', sans-serif; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
a { color: inherit; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------------- Chrome partagé (topbar public) ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 1.05rem 1.75rem; background: rgba(252,250,246,.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.topbar .word { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); white-space: nowrap; flex: none; }
.topbar .word .iris { width: 22px; height: 22px; flex: none; }
.topbar nav { display: flex; gap: 1.3rem; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav a { color: var(--ink); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; padding-bottom: 2px; white-space: nowrap; }
.topbar nav a:hover, .topbar nav a:focus-visible { border-bottom-color: var(--forest); }

.container { max-width: 1240px; margin: 0 auto; padding: 0 1.75rem; }
.section-title { font-size: 22px; margin: 0 0 1.4rem; }

/* ---------------- Boutons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0.7rem 1.35rem; border-radius: 999px; border: none;
  font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 13.5px;
  text-decoration: none; cursor: pointer;
  background: var(--forest); color: var(--on-forest);
}
.btn:hover { opacity: 0.92; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------------- Hero (accueil) ---------------- */
.hero { position: relative; padding: 3.5rem 1.75rem 4rem; display: grid; grid-template-columns: 1fr 1.15fr; gap: 3rem; align-items: center; }
.hero-copy .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass); margin: 0 0 1rem; }
.hero-copy h1 { font-size: 44px; line-height: 1.05; margin: 0 0 1.1rem; max-width: 14ch; }
.hero-copy p { font-size: 15px; color: var(--ink-soft); max-width: 40ch; line-height: 1.65; margin: 0 0 1.6rem; }
.signature { display: flex; align-items: center; gap: 10px; margin-top: 1.6rem; font-size: 13px; color: var(--ink-soft); }
.signature .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--sage); display: flex; align-items: center; justify-content: center; flex: none; }
.signature .avatar svg { width: 18px; height: 18px; }
.signature b { color: var(--ink); font-family: 'Archivo', sans-serif; }

.hero-visual { position: relative; aspect-ratio: 4/3.1; }
.hero-visual .blob { position: absolute; inset: -8% -6%; z-index: 0; }
.hero-visual .frame { position: relative; z-index: 1; aspect-ratio: 4/3; border: 10px solid #fff; box-shadow: 0 20px 45px rgba(27,33,28,.14); border-radius: 4px; overflow: hidden; background: var(--sage); display: flex; align-items: center; justify-content: center; }
.hero-visual .frame svg { width: 72%; height: 72%; }
.hero-visual .tag { position: absolute; bottom: -14px; left: 24px; z-index: 2; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 11.5px; font-weight: 600; box-shadow: 0 6px 16px rgba(27,33,28,.08); display: flex; align-items: center; gap: 7px; }
.hero-visual .tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--sage-ink); display: block; }

/* ---------------- Bandeau habitats ---------------- */
.habitat-strip { padding: 0 1.75rem 2.5rem; display: flex; gap: 10px; flex-wrap: wrap; }
.pill { font-size: 12.5px; font-weight: 600; padding: 7px 16px; border-radius: 999px; display: inline-block; }

/* Rôles couleur par habitat (nom retourné par App\Models\HabitatModel::chipClass),
   partagés entre le passe-partout du front (.pill/.print-card) et les étiquettes
   admin (.tag-chip) pour que les deux mondes restent cohérents. */
.pill.sage, .print-card.sage { background: var(--sage); color: var(--sage-ink); }
.pill.sky, .print-card.sky { background: var(--sky); color: var(--sky-ink); }
.pill.blush, .print-card.blush { background: var(--blush); color: var(--blush-ink); }
.pill.cream, .print-card.cream { background: var(--cream); color: var(--cream-ink); }
.pill.lavender, .print-card.lavender { background: var(--lavender); color: var(--lavender-ink); }

/* ---------------- Cartes tirage (passe-partout coloré) ---------------- */
.print-card { border-radius: 10px; padding: 14px; transition: transform 260ms cubic-bezier(.2,.8,.2,1), box-shadow 260ms ease; text-decoration: none; display: block; }
.print-card:hover { transform: translateY(-5px); box-shadow: 0 16px 30px rgba(27,33,28,.12); }
.print-card .thumb { aspect-ratio: 4/5; background: #fff; border-radius: 4px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.print-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.print-card .thumb svg { width: 56%; height: 56%; }
.print-card .body { padding: 0.9rem 0.1rem 0.1rem; }
.print-card .title { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 15px; margin: 0 0 3px; color: inherit; }
.print-card .meta { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; gap: 8px; }
.print-card .price { font-weight: 700; white-space: nowrap; }

.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
.print-card .pill { font-size: 10.5px; padding: 3px 10px; margin-bottom: 8px; }

/* ---------------- Formulaires ---------------- */
.form-field { margin: 0 0 1rem; }
.form-field label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; color: var(--ink); }
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="number"],
.form-field input[type="file"],
.form-field select,
.form-field textarea {
  width: 100%; padding: 0.65rem 0.8rem; border: 1px solid var(--line); border-radius: 8px;
  font-family: 'Work Sans', sans-serif; font-size: 14px; background: var(--surface); color: var(--ink);
}
.form-field textarea { resize: vertical; }
.form-error { color: #A3372A; font-size: 12.5px; margin: 4px 0 0; }
.form-success { color: var(--sage-ink); font-size: 14px; }

/* ---------------- Panier / listes ---------------- */
.line-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }

/* ---------------- Pages simples (contact, cours-photo, confirmation, panier) ---------------- */
.narrow-section { max-width: 640px; margin: 0 auto; padding: 3.5rem 1.75rem; }
.narrow-section h1 { font-size: 28px; margin: 0 0 0.9rem; }
.narrow-section p { color: var(--ink-soft); line-height: 1.6; }

/* ---------------- ADMIN ---------------- */
.admin-shell { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.admin-side { background: var(--surface); border-right: 1px solid var(--line); padding: 1.5rem 1.1rem; }
.admin-side .logo { font-family: 'Archivo', sans-serif; font-weight: 700; margin-bottom: 1.6rem; display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.admin-side .logo svg { width: 20px; height: 20px; flex: none; }
.admin-side a.nav-link { display: flex; align-items: center; gap: 9px; padding: 9px 11px; margin-bottom: 2px; border-radius: 8px; font-size: 13.5px; color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.admin-side a.nav-link.active { background: var(--sage); color: var(--sage-ink); font-weight: 700; }
.admin-side a.nav-link:hover:not(.active) { background: var(--paper); }
.admin-side .logout { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.admin-main { padding: 2rem 2.2rem; background: var(--paper); }
.admin-main h1 { font-size: 24px; margin: 0 0 1.4rem; }

.stat-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 1.6rem; }
.stat-tile { border-radius: 10px; padding: 1rem 1.1rem; }
.stat-tile.sage { background: var(--sage); color: var(--sage-ink); }
.stat-tile.sky { background: var(--sky); color: var(--sky-ink); }
.stat-tile.cream { background: var(--cream); color: var(--cream-ink); }
.stat-tile .label { font-size: 11.5px; opacity: 0.85; margin: 0 0 4px; }
.stat-tile .value { font-family: 'Archivo', sans-serif; font-size: 24px; font-weight: 700; margin: 0; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--surface); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.admin-table th { text-align: left; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); border-bottom: 1px solid var(--line); padding: 10px 12px; background: var(--paper); }
.admin-table td { border-bottom: 1px solid var(--line); padding: 11px 12px; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table a { text-decoration: none; font-weight: 600; color: var(--forest); }

.tag-chip { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; display: inline-block; }
.tag-chip.sage { background: var(--sage); color: var(--sage-ink); }
.tag-chip.sky { background: var(--sky); color: var(--sky-ink); }
.tag-chip.blush { background: var(--blush); color: var(--blush-ink); }
.tag-chip.status-pending { background: var(--cream); color: var(--cream-ink); }
.tag-chip.status-paid { background: var(--sage); color: var(--sage-ink); }
.tag-chip.status-shipped { background: var(--sky); color: var(--sky-ink); }
.tag-chip.lavender { background: var(--lavender); color: var(--lavender-ink); }
.tag-chip.cream { background: var(--cream); color: var(--cream-ink); }

.admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.2rem 1.3rem; margin-bottom: 1.4rem; }
.image-manager { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.image-manager .tile { aspect-ratio: 1; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.image-manager .tile img { width: 100%; height: 100%; object-fit: cover; }
.image-manager .tile .cap { position: absolute; bottom: 6px; left: 6px; right: 6px; font-size: 10px; color: #fff; background: rgba(27,33,28,.6); padding: 2px 6px; border-radius: 4px; }
.image-manager .tile .cover-badge { position: absolute; top: 28px; left: 6px; background: var(--forest); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.image-manager .tile .tile-select { position: absolute; top: 7px; left: 7px; width: 18px; height: 18px; margin: 0; cursor: pointer; accent-color: var(--forest); }
.bulk-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.bulk-select-all { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.bulk-select-all input { accent-color: var(--forest); }
.image-manager .tile .tile-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.image-manager .tile .tile-actions form { margin: 0; }
.image-manager .tile .btn-set-cover { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--cream-ink); border: none; cursor: pointer; font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.image-manager .tile .remove-btn { width: 22px; height: 22px; border-radius: 50%; background: rgba(27,33,28,.65); color: #fff; border: none; cursor: pointer; font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center; }

/* ---------------- Pied de page (public) ---------------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 2.5rem 1.75rem 2rem; }
.site-footer .footer-grid { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; }
.site-footer .word { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 0.7rem; }
.site-footer .word svg { width: 20px; height: 20px; flex: none; }
.site-footer p { color: var(--ink-soft); font-size: 13px; line-height: 1.6; margin: 0; max-width: 32ch; }
.site-footer h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 0.8rem; color: var(--ink-soft); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.site-footer a { color: var(--ink); text-decoration: none; font-size: 13.5px; }
.site-footer a:hover { color: var(--forest); }
.site-footer .footer-bottom { max-width: 1240px; margin: 2rem auto 0; padding-top: 1.4rem; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-soft); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
@media (max-width: 700px) { .site-footer .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; } }

/* ---------------- Uploader multi-photos (admin) ---------------- */
.uploader-drop {
  border: 2px dashed var(--line); border-radius: 12px; padding: 2.2rem 1.5rem; text-align: center;
  background: var(--paper); cursor: pointer; transition: border-color 180ms ease, background 180ms ease;
}
.uploader-drop.is-dragover { border-color: var(--forest); background: var(--sage); }
.uploader-drop .icon { width: 34px; height: 34px; margin: 0 auto 0.7rem; opacity: 0.7; }
.uploader-drop p { margin: 0; color: var(--ink-soft); font-size: 13.5px; }
.uploader-drop p strong { color: var(--ink); }
.uploader-drop input[type="file"] { display: none; }

.upload-queue { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 1.2rem; }
.upload-item { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.upload-item .preview { aspect-ratio: 1; background: var(--paper); display: block; }
.upload-item .preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-item .info { padding: 8px 9px; }
.upload-item .filename { font-size: 11px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0 0 5px; }
.upload-item input[type="text"] { width: 100%; padding: 5px 7px; font-size: 12.5px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 6px; }
.upload-item .progress-track { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.upload-item .progress-bar { height: 100%; width: 0%; background: var(--forest); transition: width 200ms ease; }
.upload-item .status-line { font-size: 10.5px; margin-top: 5px; color: var(--ink-soft); display: flex; align-items: center; gap: 5px; }
.upload-item.is-done .progress-bar { background: var(--sage-ink); }
.upload-item.is-error .progress-bar { background: #A3372A; }
.upload-item.is-error .status-line { color: #A3372A; }
.upload-item .remove-btn { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(27,33,28,.65); color: #fff; border: none; cursor: pointer; font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.upload-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 1.2rem; }
.upload-actions .count { font-size: 12.5px; color: var(--ink-soft); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; }
}
