/* patterns: UX.008 — Charte graphique Jaikit (dark-first, or premium) */

@font-face {
  font-family: 'Syne';
  src: url('/static/fonts/Syne-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/static/fonts/DM_Sans-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/static/fonts/DM_Sans-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/static/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ── Tokens invariants ──────────────────────────────────────────── */
:root {
  --or:       #d4a853;
  --or-clair: #e8c278;
  --or-pale:  #f5e6c0;
  --accent:   #4a9eff;
  --rouge:    #e85d4a;
  --vert:     #52c07e;
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 40px;
}

/* ── Thème sombre (défaut) ──────────────────────────────────────── */
:root[data-theme="dark"], :root:not([data-theme]) {
  --bg:        #0a0a0f;
  --bg-2:      #12121a;
  --bg-3:      #1c1c28;
  --text:          #f0ece4;
  --text-dim:      #c8c4bc;
  --text-muted:    #6b6878;
  --text-contrast: #ffffff;
  --border:      #334155;
  --shadow-or:   0 0 60px rgba(212, 168, 83, .18);
  --shadow-card: 0 4px 32px rgba(0, 0, 0, .5);
  --primary: var(--or);
}

/* ── Thème clair ─────────────────────────────────────────────────── */
:root[data-theme="light"] {
  --bg:        #ffffff;
  --bg-2:      #f8fafc;
  --bg-3:      #f1f5f9;
  --text:          #0f172a;
  --text-dim:      #475569;
  --text-muted:    #64748b;
  --text-contrast: #000000;
  --border:      #e2e8f0;
  --shadow-or:   0 0 40px rgba(212, 168, 83, .12);
  --shadow-card: 0 4px 24px rgba(15, 23, 42, .08);
  --primary: var(--or);
}

/* ── Reset & base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
}
h1, h2, h3, h4, h5 { font-family: 'Syne', sans-serif; line-height: 1.1; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--or-clair); }
code, .mono { font-family: 'JetBrains Mono', monospace; font-size: 0.875em; }

/* ── Layout ──────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.section--alt { background: var(--bg-2); }

/* ── Navbar ──────────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}
:root[data-theme="light"] .navbar { background: rgba(255,255,255,0.92); }
.navbar__inner {
  max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.navbar__brand {
  display: flex; align-items: center; gap: 0.75rem;
  text-decoration: none;
}
.navbar__logo { height: 36px; width: auto; }
.navbar__wordmark {
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: 1.1rem; letter-spacing: 4px;
  color: var(--text); text-transform: uppercase;
}
.navbar__actions { display: flex; align-items: center; gap: 1rem; }

/* ── Boutons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: 'DM Sans', sans-serif; font-weight: 500;
  border: none; cursor: pointer; text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primary {
  background: var(--or); color: var(--text-contrast);
  border-radius: var(--r-md); padding: 12px 28px; font-size: 1rem;
}
.btn-primary:hover { background: var(--or-clair); color: var(--text-contrast); }
.btn-secondary {
  background: transparent; color: var(--or);
  border: 1px solid var(--or); border-radius: var(--r-md);
  padding: 10px 24px; font-size: 0.95rem;
}
.btn-secondary:hover { background: var(--or); color: var(--text-contrast); }
.btn-ghost {
  background: transparent; color: var(--text-dim);
  border-radius: var(--r-sm); padding: 8px 16px;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-3); }
.btn-theme {
  background: none; border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 6px 10px;
  cursor: pointer; font-size: 1rem; color: var(--text-dim);
  transition: border-color 0.2s;
}
.btn-theme:hover { border-color: var(--or); }

/* ── Hero ────────────────────────────────────────────────────────── */
.hero {
  min-height: 80vh;
  display: flex; align-items: center;
  padding: 6rem 0 4rem;
  position: relative; overflow: hidden;
}
.hero__content { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.hero__logo-wrap { display: flex; justify-content: center; margin-bottom: 2.5rem; }
.hero__logo-img { height: 80px; width: auto; filter: drop-shadow(var(--shadow-or)); }
.hero__tagline {
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  background: linear-gradient(135deg, var(--text) 60%, var(--or));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
}
.hero__sub {
  text-align: center; color: var(--text-dim);
  font-size: 1.1rem; max-width: 600px; margin: 0 auto 2.5rem;
}
.hero__cta { display: flex; justify-content: center; }

/* ── Projects grid ───────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
@media (max-width: 900px) { .projects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .projects-grid { grid-template-columns: 1fr; } }

.project-card {
  background: var(--bg-2);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 0.75rem;
  transition: border-color 0.2s, transform 0.2s;
}
.project-card:hover { border-color: var(--or); transform: translateY(-2px); }
.project-card__icon { font-size: 2rem; }
.project-card__name { font-family: 'Syne', sans-serif; font-size: 1.2rem; font-weight: 700; }
.project-card__tagline { color: var(--text-dim); font-size: 0.9rem; flex: 1; }
.project-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  border-radius: var(--r-xl); padding: 3px 12px;
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.5px;
  border: 0.5px solid currentColor;
}
.badge--live   { color: var(--vert); background: rgba(82,192,126,.1); }
.badge--beta   { color: var(--or);   background: rgba(212,168,83,.1); }
.badge--soon   { color: var(--text-muted); background: var(--bg-3); border-color: var(--border); }

/* ── Section titles ──────────────────────────────────────────────── */
.section-title {
  font-family: 'Syne', sans-serif; font-size: 2rem; font-weight: 700;
  margin-bottom: 0.5rem;
}
.section-title span { color: var(--or); }
.section-sep {
  width: 48px; height: 3px;
  background: var(--or); border-radius: 2px;
  margin-bottom: 2rem;
}

/* ── About / BMC ─────────────────────────────────────────────────── */
.about-content { max-width: 800px; }
.about-content p, .about-content li { color: var(--text-dim); line-height: 1.8; margin-bottom: 0.75rem; }
.about-content strong { color: var(--text); }
.about-content h2, .about-content h3 { margin-bottom: 0.5rem; margin-top: 1.5rem; }

.bmc-wrap {
  display: flex; align-items: flex-start; gap: 2rem;
  background: var(--bg-2); border: 0.5px solid var(--or);
  border-radius: var(--r-lg); padding: 2rem;
  box-shadow: var(--shadow-or);
}
@media (max-width: 600px) { .bmc-wrap { flex-direction: column; align-items: center; text-align: center; } }
.bmc-avatar { width: 80px; height: 80px; border-radius: 50%; flex-shrink: 0; }
.bmc-text { flex: 1; }
.bmc-text p { color: var(--text-dim); margin-bottom: 1rem; }
.bmc-text strong { color: var(--text); }

/* ── Footer ──────────────────────────────────────────────────────── */
footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
}
.footer__links { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.footer__links a { color: var(--text-muted); font-size: 0.875rem; }
.footer__links a:hover { color: var(--or); }
.footer__copy { color: var(--text-muted); font-size: 0.8rem; }

/* ── Cards admin ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-2); border: 0.5px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem;
  box-shadow: var(--shadow-card);
}
.stat-card {
  background: var(--bg-2); border: 0.5px solid var(--border);
  border-radius: var(--r-md); padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.stat-card__value { font-family: 'Syne', sans-serif; font-size: 2rem; font-weight: 700; color: var(--or); }
.stat-card__label { color: var(--text-muted); font-size: 0.875rem; }

.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
}
@media (max-width: 800px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Admin layout ────────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px; background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0; flex-shrink: 0;
}
.admin-sidebar__logo { padding: 0 1.25rem 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.admin-sidebar__logo a { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.admin-sidebar__logo img { height: 28px; }
.admin-sidebar__logo span { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.9rem; letter-spacing: 3px; color: var(--text); }
.admin-nav__item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  color: var(--text-dim); text-decoration: none; font-size: 0.9rem;
  transition: color 0.15s, background 0.15s;
}
.admin-nav__item:hover { color: var(--text); background: var(--bg-3); }
.admin-nav__item.active { color: var(--or); background: rgba(212,168,83,.08); border-right: 2px solid var(--or); }
.admin-main { flex: 1; padding: 2rem; overflow-x: hidden; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.admin-title { font-family: 'Syne', sans-serif; font-size: 1.5rem; font-weight: 700; }

/* ── Forms ───────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
label { font-size: 0.875rem; color: var(--text-dim); }
input[type="text"], input[type="password"], input[type="number"], input[type="email"],
textarea, select {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text);
  padding: 10px 14px; font-family: 'DM Sans', sans-serif; font-size: 0.95rem;
  transition: border-color 0.2s; width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--or);
}
textarea { resize: vertical; min-height: 100px; }

/* ── Table ───────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 0.5px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th { background: var(--bg-3); color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; padding: 0.75rem 1rem; text-align: left; }
td { padding: 0.75rem 1rem; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 0.9rem; }
tr:hover td { background: var(--bg-3); }

/* ── Status indicators ───────────────────────────────────────────── */
.status-ok  { color: var(--vert); }
.status-ko  { color: var(--rouge); }
.status-unk { color: var(--text-muted); }

/* ── Login ───────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-card {
  background: var(--bg-2); border: 0.5px solid var(--border);
  border-radius: var(--r-lg); padding: 2.5rem; width: 100%; max-width: 400px;
  box-shadow: var(--shadow-card);
}
.login-card__logo { display: flex; justify-content: center; margin-bottom: 2rem; }
.login-card__logo img { height: 48px; }
.login-title { font-family: 'Syne', sans-serif; font-size: 1.3rem; font-weight: 700; text-align: center; margin-bottom: 1.5rem; }
.error-msg {
  background: rgba(232,93,74,.12); color: var(--rouge);
  border: 1px solid rgba(232,93,74,.3); border-radius: var(--r-sm);
  padding: 0.65rem 1rem; margin-bottom: 1rem; font-size: 0.9rem;
}

/* ── Ops Toolbox ─────────────────────────────────────────────────── */
.ops-layout { display: flex; gap: 1.5rem; }
.ops-sidebar { width: 200px; flex-shrink: 0; }
.ops-sidebar__item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1rem; border-radius: var(--r-sm);
  cursor: pointer; color: var(--text-dim); font-size: 0.9rem;
  transition: color 0.15s, background 0.15s; text-decoration: none;
}
.ops-sidebar__item:hover { background: var(--bg-3); color: var(--text); }
.ops-sidebar__item.active { background: rgba(212,168,83,.08); color: var(--or); }
.ops-main { flex: 1; min-width: 0; }

.recipe-card {
  background: var(--bg-2); border: 0.5px solid var(--border);
  border-radius: var(--r-md); padding: 1.25rem; margin-bottom: 1rem;
}
.recipe-card__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.recipe-card__title { font-weight: 600; font-size: 0.95rem; }
.recipe-card__meta { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 0.75rem; }
.recipe-cmd {
  background: var(--bg-3); border-radius: var(--r-sm);
  padding: 0.75rem 1rem; position: relative;
  font-family: 'JetBrains Mono', monospace; font-size: 0.82rem;
  color: var(--text-dim); word-break: break-all;
  border: 0.5px solid var(--border);
}
.recipe-copy-btn {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 3px 10px;
  font-size: 0.75rem; color: var(--text-muted); cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.recipe-copy-btn:hover { color: var(--or); border-color: var(--or); }
.copy-toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999;
  background: var(--or); color: var(--text-contrast);
  border-radius: var(--r-md); padding: 0.65rem 1.25rem;
  font-size: 0.875rem; opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.copy-toast.show { opacity: 1; }

/* ── Variables sélecteur ─────────────────────────────────────────── */
.vars-bar {
  display: flex; gap: 1rem; flex-wrap: wrap;
  background: var(--bg-2); border: 0.5px solid var(--border);
  border-radius: var(--r-md); padding: 1rem; margin-bottom: 1.5rem;
}
.vars-bar label { font-size: 0.8rem; color: var(--text-muted); }
.vars-bar select, .vars-bar input {
  width: auto; min-width: 160px;
}

/* ── Legal pages ─────────────────────────────────────────────────── */
.legal-content { max-width: 800px; margin: 0 auto; padding: 3rem 1.5rem; }
.legal-content h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.legal-content h2 { font-size: 1.2rem; margin-top: 2rem; margin-bottom: 0.5rem; color: var(--text-dim); }
.legal-content p, .legal-content li { color: var(--text-dim); line-height: 1.8; margin-bottom: 0.5rem; }
.legal-content .placeholder { color: var(--rouge); font-style: italic; }

/* ── Search bar ──────────────────────────────────────────────────── */
.search-bar {
  width: 100%; padding: 10px 14px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text);
  font-size: 0.9rem; margin-bottom: 1rem;
}
.search-bar:focus { outline: none; border-color: var(--or); }

/* ── Pre output ──────────────────────────────────────────────────── */
pre.script-output {
  background: var(--bg-3); border: 0.5px solid var(--border);
  border-radius: var(--r-sm); padding: 1rem;
  font-family: 'JetBrains Mono', monospace; font-size: 0.82rem;
  color: var(--text-dim); overflow-x: auto; white-space: pre-wrap;
  max-height: 400px; overflow-y: auto;
}

/* ── Misc ────────────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-or    { color: var(--or); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none; }
