/* =========================================================
   Charte Briogel — module commandes personnel
   Couleurs et typographie alignées sur groupebriogel.com
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=Fredoka:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #fbf9f6;
  --surface: #ffffff;
  --ink: #1a1a1a;            /* noir Briogel (mot principal) */
  --ink-soft: #5e6e6c;
  --line: #e6e8e3;
  --brand: #2ebdb1;          /* teal "GROUPE" - couleur primaire */
  --brand-dark: #1f9e94;
  --brand-soft: #d6f1ee;
  --accent: #a8ce3a;          /* vert lime - feuille */
  --accent-dark: #88a92d;
  --accent-soft: #ecf5cf;
  --deep: #0f3a3f;            /* bleu-nuit - feuille / sidebar */
  --cream: #d6cfc0;           /* crème - feuille */
  --warn: #d6921e;
  --warn-soft: #fbecd2;
  --danger: #c83e3e;
  --danger-soft: #fadede;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: 'Inter', -apple-system, "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--ink); }
h1, h2, h3, h4 { font-family: 'Montserrat', sans-serif; }
h2 { font-weight: 800; letter-spacing: -.5px; margin: 0 0 8px; font-size: 22px; }
h3 { font-size: 16px; margin: 24px 0 12px; }
.lead { color: var(--ink-soft); font-size: 14px; margin: 0 0 24px; }

/* === LAYOUT === */
.appbar {
  background: #fff; padding: 14px 32px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.logo-block { display: flex; align-items: center; gap: 12px; }
.logo-block small { color: var(--ink-soft); font-weight: 400; font-size: 12px; padding-left: 14px; margin-left: 12px; border-left: 1px solid var(--line); text-transform: uppercase; letter-spacing: 1px; }
.appbar nav { display: flex; gap: 28px; }
.appbar nav a { color: var(--ink); text-decoration: none; font-size: 14px; padding: 6px 0; font-weight: 600; }
.appbar nav a:hover { color: var(--brand); }
.appbar nav a.current { color: var(--brand); border-bottom: 2px solid var(--brand); }
.appbar .user { font-size: 13px; color: var(--ink-soft); display: flex; gap: 12px; align-items: center; }
.appbar .user form { display: inline; }
.body { padding: 32px; max-width: 1200px; margin: 0 auto; }

/* === FORMULAIRES === */
label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; font-weight: 500; }
input, textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 200px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px;
  border-radius: 8px; border: 0; font-weight: 600; cursor: pointer; font-size: 14px;
  font-family: inherit; text-decoration: none; transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-success { background: var(--brand); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; margin-bottom: 16px;
}

/* === ALERTS === */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.info { background: var(--brand-soft); color: var(--brand-dark); }

/* === AUTH === */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 60px 32px; background: linear-gradient(135deg, #d6f1ee 0%, #ecf5cf 100%); }
.auth-card { max-width: 420px; width: 100%; background: #fff; padding: 40px; border-radius: 16px; box-shadow: 0 12px 40px rgba(15, 58, 63, .1); }
.auth-card .logo { text-align: center; font-family: 'Fredoka', sans-serif; font-size: 52px; font-weight: 700; color: var(--ink); margin: 4px 0; letter-spacing: -1.5px; line-height: .9; font-style: italic; }
.auth-card .groupe { display: block; text-align: center; color: var(--brand); font-size: 14px; text-transform: uppercase; letter-spacing: 3px; margin-bottom: 0; font-weight: 700; }
.auth-card h2 { text-align: center; font-size: 18px; margin-bottom: 24px; }
.auth-card .lead { text-align: center; }

/* === TABLES === */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 12px; background: #fbf7f1; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); }
tr:hover td { background: #fbf7f1; }
.ref-mono { font-family: ui-monospace, "Cascadia Code", monospace; font-size: 12px; color: var(--ink-soft); }

/* === STATUTS === */
.status { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.status.attente { background: var(--warn-soft); color: var(--warn); }
.status.devis { background: #e0eaf6; color: #2c5282; }
.status.validee { background: var(--brand-soft); color: var(--brand-dark); }
.status.enregistree { background: #ebebeb; color: #555; }
.status.refusee { background: var(--danger-soft); color: var(--danger); }

/* === CATALOGUE === */
.catalog-layout { display: grid; grid-template-columns: 220px 1fr 320px; gap: 24px; }
@media (max-width: 900px) { .catalog-layout { grid-template-columns: 1fr; } }
.families { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.families a { display: block; padding: 10px 12px; border: 0; background: none; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--ink-soft); text-decoration: none; }
.families a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .product-grid { grid-template-columns: 1fr; } }
.product { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; }
.product .name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.product .ref { font-family: ui-monospace, monospace; font-size: 11px; color: var(--ink-soft); margin-bottom: 12px; }
.product .uv { font-size: 12px; color: var(--ink-soft); margin-bottom: 12px; }
.product form { display: flex; align-items: center; gap: 8px; margin: 0; }
.product .qty { width: 64px; padding: 6px 8px; }
.product .add { background: var(--brand-soft); color: var(--brand-dark); border: 0; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 13px; }
.cart { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; position: sticky; top: 24px; }
.cart h4 { margin: 0 0 12px; font-size: 14px; }
.cart-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.cart-empty { text-align: center; color: var(--ink-soft); padding: 24px 0; font-size: 13px; }
.cart-total { padding: 12px 0; border-top: 2px solid var(--ink); margin-top: 12px; font-weight: 700; display: flex; justify-content: space-between; }

.pill-mode { display: inline-block; background: var(--brand-soft); color: var(--brand-dark); padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }

/* === STATS DASHBOARD === */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat .num { font-size: 28px; font-weight: 700; color: var(--ink); }
.stat .lbl { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .5px; }
.stat.warn .num { color: var(--warn); }
.stat.brand .num { color: var(--brand); }

/* === TIMELINE === */
.timeline { padding-left: 20px; border-left: 2px solid var(--line); }
.timeline-item { margin-bottom: 16px; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: -27px; top: 4px; width: 12px; height: 12px; background: var(--brand); border-radius: 50%; border: 3px solid var(--bg); }
.timeline-item.done::before { background: var(--brand); }
.timeline-item.pending::before { background: var(--line); }
.timeline-time { font-size: 12px; color: var(--ink-soft); }
