/* ═══════════════════════════════════════════════════════════
   appart.css — base commune
   Site privé d'aménagement · thème sombre bison
   DM Sans + Fraunces · or #e8a520 · brun #c4824a
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;1,9..144,400;1,9..144,500&display=swap');

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  /* Palette bison */
  --primary-color: #e8a520; --primary-dark: #c8881a;
  --bg-color: #0e0a06; --bg-deep: #0a0704; --card-bg: #181210; --surface-alt: #211914;
  --border-color: #2e2216; --border-soft: #3a2c1c;
  --text-main: #f0e4cc; --text-muted: #b0a28c;
  --color-ocre: #e8a520; --color-brun: #c4824a; --color-green: #4ade80;
  --color-danger: #f87171; --color-gold: #fbbf24;

  /* Shape */
  --border-radius: 10px; --radius-sm: 7px; --radius-xs: 5px;

  /* Typo */
  --font: 'DM Sans', sans-serif;
  --font-display: 'Fraunces', serif;
  --fs-xxs: .69rem; --fs-xs: .77rem; --fs-sm: .85rem;
  --fs-base: .94rem; --fs-md: 1rem; --fs-lg: 1.18rem;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.35);
}

/* ── RESET & A11Y ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
*:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
*:focus:not(:focus-visible) { outline: none; }

/* ── BASE ───────────────────────────────────────────────── */
body {
  font-family: var(--font);
  background-color: var(--bg-color);
  background-image:
    radial-gradient(ellipse 80% 60% at 15% 0%, rgba(196,130,74,.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 100%, rgba(232,165,32,.05) 0%, transparent 55%);
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: .005em;
  min-height: 100vh; padding: 88px 20px 40px; overflow-x: hidden;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* Micro-texture — grille de points subtile */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 28px 28px;
}
.site-nav, main, .site-footer { position: relative; z-index: 1; }

/* ── LAYOUT ─────────────────────────────────────────────── */
.container { max-width: 1240px; margin: 0 auto; }
.card {
  background: var(--card-bg); border: 1px solid var(--border-color);
  border-radius: var(--border-radius); margin-bottom: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 2px 8px rgba(0,0,0,.25);
}
.card-inner { padding: 1.3rem 1.5rem; }

/* ── PAGE HEADER ────────────────────────────────────────── */
.page-header { max-width: 1240px; margin: 0 auto 26px; }
.page-eyebrow {
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .2em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px;
}
.page-header h1 {
  font-family: var(--font-display); font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  font-weight: 400; line-height: 1.12; color: var(--text-main);
  letter-spacing: -.01em; font-optical-sizing: auto;
}
.page-header h1 em { font-style: italic; font-weight: 400; color: var(--color-brun); }

/* ── SECTION TITLE ──────────────────────────────────────── */
.section-title {
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .15em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: ''; display: block; width: 15px; height: 1.5px;
  background: var(--color-ocre); flex-shrink: 0;
}

/* ── BOUTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 20px; font-family: var(--font);
  font-size: var(--fs-sm); font-weight: 600; letter-spacing: .01em;
  border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer;
  transition: opacity .15s, background .15s, box-shadow .15s, color .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: #0e0a06; font-weight: 700; box-shadow: var(--shadow-sm);
}
.btn-primary:hover { opacity: .9; box-shadow: 0 0 0 3px rgba(232,165,32,.2); }
.btn-primary:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
.btn-outline {
  background: transparent; color: var(--primary-color); border-color: var(--border-soft);
}
.btn-outline:hover { border-color: var(--primary-color); background: rgba(232,165,32,.07); }
.btn-ghost { background: none; color: var(--text-muted); border-color: var(--border-color); }
.btn-ghost:hover { color: var(--text-main); border-color: var(--border-soft); }

/* Bouton-icône compact (verrou, suppression, etc.) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; background: none; color: var(--text-muted);
  border: 1px solid var(--border-color); border-radius: var(--radius-xs);
  cursor: pointer; font-size: .95rem;
  transition: color .15s, border-color .15s, background .15s; flex-shrink: 0;
}
.icon-btn:hover { color: var(--color-ocre); border-color: var(--color-ocre); }
.icon-btn.danger:hover { color: var(--color-danger); border-color: var(--color-danger); }
.icon-btn.on { color: var(--color-gold); border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.08); }

/* ── FORMULAIRES ────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.input,
input[type="text"], input[type="url"], input[type="number"],
input[type="email"], input[type="search"], input[type="password"],
textarea, select {
  width: 100%; padding: 9px 11px; font-family: var(--font);
  font-size: var(--fs-md); font-weight: 500; color: var(--text-main);
  background: var(--bg-deep); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, input::placeholder { color: #6b5c44; }
.input:focus, input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(232,165,32,.15);
}
textarea { resize: vertical; min-height: 5rem; }

/* Neutralise le fond clair de l'autocomplétion → même rendu que les autres champs
   (Chrome, Edge, Safari via -webkit ; Firefox via :autofill) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:active,
input:autofill,
input:autofill:hover {
  -webkit-text-fill-color: var(--text-main) !important;
  caret-color: var(--text-main);
  border: 1px solid var(--border-soft) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--bg-deep) inset !important;
  box-shadow: 0 0 0 1000px var(--bg-deep) inset !important;
  transition: background-color 9999s ease-in-out 0s; /* empêche le flash */
}
input:-webkit-autofill:focus,
input:autofill:focus {
  border-color: var(--primary-color) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--bg-deep) inset, 0 0 0 3px rgba(232,165,32,.15) !important;
  box-shadow: 0 0 0 1000px var(--bg-deep) inset, 0 0 0 3px rgba(232,165,32,.15) !important;
}
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type=number] { -moz-appearance: textfield; }

/* Case à cocher (toggles plan : dimensions, noms de pièces…) */
.check-label {
  display: inline-flex; align-items: center; gap: 9px; padding: 8px 13px;
  background: var(--surface-alt); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); cursor: pointer; user-select: none;
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted);
  transition: border-color .15s, color .15s, background .15s;
}
.check-label:hover { border-color: var(--border-soft); color: var(--text-main); }
.check-label input { width: 16px; height: 16px; accent-color: var(--primary-color); cursor: pointer; }
.check-label.checked { color: var(--color-ocre); border-color: rgba(232,165,32,.35); background: rgba(232,165,32,.07); }

/* ── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs);
  font-weight: 600; letter-spacing: .02em; padding: 3px 10px; border-radius: 20px;
  background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border-color);
}
.badge-ocre  { background: rgba(232,165,32,.10); color: var(--color-ocre); border-color: rgba(232,165,32,.22); }
.badge-brun  { background: rgba(196,130,74,.12); color: var(--color-brun); border-color: rgba(196,130,74,.25); }
.badge-green { background: #0d2318; color: var(--color-green); border-color: #1a4a28; }
.badge-danger { background: rgba(248,113,113,.10); color: var(--color-danger); border-color: rgba(248,113,113,.28); }

/* ── TOAST ──────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #f0e4cc; color: #0e0a06; font-size: var(--fs-sm); font-weight: 600;
  padding: 9px 16px; border-radius: var(--radius-sm);
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .2s; pointer-events: none; z-index: 2000;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Numérique tabulaire (dimensions, quantités) ────────── */
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

/* ── Icônes Lucide (SVG inline) ─────────────────────────── */
svg.lucide { display: inline-block; vertical-align: -0.18em; flex-shrink: 0; }
.badge svg.lucide { vertical-align: -0.16em; }

/* ═══════════════════════════════════════════════════════════
   SITE NAV — barre commune (Plan · Idées · Souhaits)
   ═══════════════════════════════════════════════════════════ */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: rgba(24, 18, 16, 0.82);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 0 rgba(232,165,32,.10);
}
.site-nav-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 20px; height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.site-nav-logo {
  display: flex; align-items: baseline; gap: 8px; text-decoration: none;
  font-family: var(--font-display); font-size: 1.4rem; font-style: italic; font-weight: 400;
  color: var(--text-main); line-height: 1;
}
.site-nav-logo span { color: var(--color-brun); }
.site-nav-logo small {
  font-family: var(--font); font-style: normal; font-size: var(--fs-xxs);
  font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted);
}
.site-nav-links { display: flex; align-items: center; gap: 2px; }
.site-nav-link {
  display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm);
  font-weight: 600; color: var(--text-muted); text-decoration: none;
  padding: 7px 14px; border-radius: var(--radius-xs); transition: color .15s, background .15s; white-space: nowrap;
}
.site-nav-link .nav-ico { font-size: .95rem; line-height: 1; opacity: .85; }
.site-nav-link:hover { color: var(--text-main); background: rgba(255,255,255,.03); }
.site-nav-link.active { color: var(--color-ocre); font-weight: 600; }

/* ── Burger (mobile) ────────────────────────────────────── */
.site-nav-burger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px; background: none; border: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.burger-line {
  display: block; width: 22px; height: 2px; background: var(--text-main);
  border-radius: 2px; transition: transform .25s ease, opacity .2s ease;
}
.nav-open .burger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .burger-line:nth-child(2) { opacity: 0; }
.nav-open .burger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── FOOTER ─────────────────────────────────────────────── */
.site-footer {
  max-width: 1240px; margin: 40px auto 0; padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}
.site-footer-inner {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.6;
}
.site-footer-brand { font-weight: 600; color: var(--color-brun); }
.site-footer-sep { opacity: .4; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 720px) {
  .site-nav-burger { display: flex; }
  .site-nav-logo small { display: none; }
  .site-nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: rgba(24, 18, 16, 0.96);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid var(--border-color); padding: 8px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
  }
  .nav-open .site-nav-links { display: flex; }
  .site-nav-link { padding: 12px 24px; font-size: var(--fs-base); border-radius: 0; }
  .site-nav-link:hover, .site-nav-link:focus-visible { background: rgba(232,165,32,.08); }
  .site-footer-inner { flex-direction: column; align-items: flex-start; }

  /* Touch targets */
  .btn, .icon-btn, input, select, .check-label { min-height: 44px; }
}

/* ── A11Y : mouvement réduit ────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
