/* ==========================================================================
   OXCA MCP Hub — design system.
   Style « Apple » : sobre, aéré, intemporel. Un seul fichier, piloté par
   des variables ; chaque composant est défini une seule fois.
   ========================================================================== */

/* ------------------------------------------------------------- Variables */
:root {
  --bg:        #f5f5f7;
  --surface:   #ffffff;
  --surface-2: #fafafc;
  --text:      #1d1d1f;
  --text-2:    #6e6e73;
  --hairline:  rgba(0, 0, 0, .09);
  --accent:    #0071e3;
  --accent-2:  #0077ed;
  --ok:        #248a3d;
  --ok-bg:     rgba(52, 199, 89, .14);
  --warn:      #b25000;
  --warn-bg:   rgba(255, 159, 10, .16);
  --danger:    #d70015;
  --danger-bg: rgba(255, 59, 48, .12);
  --code-bg:   #1d1d1f;
  --code-text: #f5f5f7;
  --nav-bg:    rgba(251, 251, 253, .8);
  --shadow:    0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05);
  --shadow-up: 0 2px 4px rgba(0, 0, 0, .05), 0 16px 40px rgba(0, 0, 0, .09);
  --radius:    18px;
  --radius-sm: 12px;
  --ease:      cubic-bezier(.32, .72, .28, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #000000;
    --surface:   #1c1c1e;
    --surface-2: #161618;
    --text:      #f5f5f7;
    --text-2:    #98989d;
    --hairline:  rgba(255, 255, 255, .12);
    --accent:    #0a84ff;
    --accent-2:  #2491ff;
    --ok:        #32d74b;
    --ok-bg:     rgba(50, 215, 75, .16);
    --warn:      #ffd60a;
    --warn-bg:   rgba(255, 214, 10, .14);
    --danger:    #ff453a;
    --danger-bg: rgba(255, 69, 58, .15);
    --code-bg:   #111113;
    --code-text: #f5f5f7;
    --nav-bg:    rgba(22, 22, 24, .75);
    --shadow:    0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-up: 0 2px 4px rgba(0, 0, 0, .5), 0 16px 40px rgba(0, 0, 0, .5);
  }
}

/* ------------------------------------------------------------------ Base */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 { letter-spacing: -.02em; font-weight: 650; }
h1 { font-size: 32px; line-height: 1.15; }
h2 { font-size: 19px; }
h3 { font-size: 17px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--text-2); }
small.hint, p.hint { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 6px; }

code {
  font: 12px/1.5 ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 1.5px 6px;
  overflow-wrap: anywhere;
}

svg { flex: none; vertical-align: middle; }

/* ------------------------------------------------------------ Navigation */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  max-width: 980px; margin: 0 auto; padding: 0 22px;
  height: 52px; display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 650; font-size: 16px; color: var(--text); letter-spacing: -.02em;
}
.nav-brand:hover { text-decoration: none; opacity: .8; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-user {
  font-size: 13px; color: var(--text-2);
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 560px) { .nav-user { display: none; } }

/* ------------------------------------------------------------ Conteneurs */
.container {
  width: 100%; max-width: 720px; margin: 0 auto; padding: 40px 22px 80px;
  flex: 1;
}
.container-wide { max-width: 980px; }

.footer {
  border-top: 1px solid var(--hairline);
  padding: 28px 22px; text-align: center;
  font-size: 12.5px; color: var(--text-2);
}
.footer-links { margin-top: 8px; display: flex; gap: 18px; justify-content: center; }
.footer-links a { color: var(--text-2); }
.footer-links a:hover { color: var(--text); }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 28px; flex-wrap: wrap;
}
.page-head p { margin-top: 6px; }
.page-head-actions { display: flex; gap: 10px; }

/* ---------------------------------------------------------------- Cartes */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 20px;
}
.card-head { margin-bottom: 18px; }
.card-head p { margin-top: 4px; font-size: 13.5px; }

.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin-bottom: 20px;
}
.grid .card { margin-bottom: 0; }

.card-link {
  display: flex; flex-direction: column; gap: 8px;
  color: var(--text);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.card-link:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: var(--shadow-up);
}
.card-link-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.card-link-cta {
  margin-top: auto; padding-top: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-size: 13.5px; font-weight: 500;
}
.card-link-cta svg { width: 15px; height: 15px; transition: transform .3s var(--ease); }
.card-link:hover .card-link-cta svg { transform: translateX(3px); }

.type-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--hairline);
}
.type-icon svg { width: 22px; height: 22px; }

/* --------------------------------------------------------------- Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-size: 14.5px; font-weight: 500;
  padding: 10px 22px; border-radius: 980px;
  border: 1px solid transparent; cursor: pointer;
  color: var(--text); background: transparent;
  transition: background .25s var(--ease), transform .15s var(--ease),
    box-shadow .25s var(--ease), opacity .25s var(--ease);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }

.btn-ghost { border-color: var(--hairline); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); }

.btn-danger { color: var(--danger); border-color: var(--hairline); background: var(--surface); }
.btn-danger:hover { background: var(--danger-bg); border-color: transparent; }

.btn-sm { font-size: 13px; padding: 7px 15px; }
.btn-lg { font-size: 16px; padding: 13px 30px; }
.btn-icon { padding: 9px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

.inline-form { display: inline-flex; }

/* ------------------------------------------------------------ Formulaires */
.field { margin-bottom: 18px; }
.field > label,
.field > .field-label {
  display: block; font-size: 13px; font-weight: 550;
  color: var(--text); margin-bottom: 7px;
}

.input {
  width: 100%; font: inherit; font-size: 15px;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  padding: 11px 14px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.input:focus {
  outline: none; background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 22%, transparent);
}
.input[readonly] { color: var(--text-2); font-size: 13.5px; }

.input-code {
  font-size: 26px; font-weight: 600; letter-spacing: 14px;
  text-align: center; font-variant-numeric: tabular-nums;
}

.check { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; margin-bottom: 18px; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
  flex: none; width: 22px; height: 22px; margin-top: 1px;
  border: 1.5px solid var(--hairline); border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.check-box svg { width: 13px; height: 13px; color: #fff; opacity: 0; transform: scale(.5); transition: all .2s var(--ease); }
.check input:checked + .check-box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check-box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .check-box {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 22%, transparent);
}

.check-box.round { border-radius: 50%; }
.check-box.round::after {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: #fff; opacity: 0; transform: scale(.5);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.check input:checked + .check-box.round::after { opacity: 1; transform: scale(1); }

.copy-row { display: flex; gap: 8px; }
.copy-row .input { flex: 1; min-width: 0; }

/* --------------------------------------------------------- Bloc de code */
.code-block {
  position: relative;
  background: var(--code-bg); color: var(--code-text);
  border-radius: var(--radius-sm);
  padding: 14px 52px 14px 16px;
  overflow-x: auto;
}
.code-block pre {
  font: 12.5px/1.6 ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
}
.code-block .code-copy {
  position: absolute; top: 8px; right: 8px;
  color: var(--code-text); opacity: .6;
}
.code-block .code-copy:hover { opacity: 1; }

/* --------------------------------------------------------------- Badges */
.badge {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 550; letter-spacing: .01em;
  padding: 4px 11px; border-radius: 980px;
}
.badge-ok     { color: var(--ok); background: var(--ok-bg); }
.badge-warn   { color: var(--warn); background: var(--warn-bg); }
.badge-muted  { color: var(--text-2); background: var(--surface-2); border: 1px solid var(--hairline); }
.badge-accent { color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); }

/* ----------------------------------------------------- Listes en lignes */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 2px; border-top: 1px solid var(--hairline);
}
.row:first-child { border-top: 0; }
.row-main { min-width: 0; }
.row-main strong { font-weight: 550; font-size: 14.5px; display: block; overflow: hidden; text-overflow: ellipsis; }
.row-main span { font-size: 12.5px; color: var(--text-2); }
.row-actions { display: flex; gap: 8px; flex: none; }

/* ------------------------------------------------------------ État vide */
.empty {
  text-align: center; padding: 52px 24px;
  border: 1.5px dashed var(--hairline); border-radius: var(--radius);
  margin-bottom: 20px;
}
.empty svg { width: 34px; height: 34px; color: var(--text-2); margin-bottom: 12px; }
.empty h3 { margin-bottom: 6px; }
.empty p { max-width: 400px; margin: 0 auto 18px; }

/* ----------------------------------------------------------------- Flash */
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-radius: var(--radius-sm);
  margin-bottom: 20px; font-size: 14px; font-weight: 500;
  animation: flash-in .5s var(--ease);
}
.flash svg { width: 18px; height: 18px; }
.flash-ok    { color: var(--ok); background: var(--ok-bg); }
.flash-error { color: var(--danger); background: var(--danger-bg); }
.flash-info  { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ----------------------------------------------------------- Divulgation */
details.disclosure { border-top: 1px solid var(--hairline); margin-top: 4px; padding-top: 14px; }
details.disclosure summary {
  cursor: pointer; list-style: none;
  font-size: 13.5px; font-weight: 550; color: var(--text-2);
  display: flex; align-items: center; gap: 6px;
}
details.disclosure summary::before {
  content: ""; width: 7px; height: 7px;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg); transition: transform .25s var(--ease);
  margin-right: 2px;
}
details.disclosure[open] summary::before { transform: rotate(45deg); }
details.disclosure summary::-webkit-details-marker { display: none; }
details.disclosure > *:not(summary) { margin-top: 16px; }

/* --------------------------------------------------------------- Landing */
.hero { text-align: center; padding: 56px 0 40px; }
.hero h1 {
  font-size: clamp(38px, 7vw, 56px); line-height: 1.06;
  letter-spacing: -.03em; margin-bottom: 18px;
}
.hero p {
  font-size: clamp(17px, 2.6vw, 21px); color: var(--text-2);
  max-width: 560px; margin: 0 auto 30px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.steps { counter-reset: step; display: flex; flex-direction: column; gap: 0; }
.step {
  display: flex; gap: 18px; padding: 18px 2px;
  border-top: 1px solid var(--hairline);
}
.step:first-child { border-top: 0; }
.step::before {
  counter-increment: step; content: counter(step);
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--hairline);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13.5px; font-weight: 600; color: var(--accent);
}
.step strong { display: block; font-weight: 550; margin-bottom: 2px; }
.step p { font-size: 13.5px; color: var(--text-2); }

.feature svg { width: 24px; height: 24px; color: var(--accent); margin-bottom: 10px; }
.feature h3 { margin-bottom: 6px; }
.feature p { font-size: 13.5px; color: var(--text-2); }

/* ----------------------------------------------------- Pages éditoriales */
.prose h2 {
  font-size: 16px; margin: 26px 0 8px;
}
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li {
  font-size: 14px; color: var(--text-2); line-height: 1.65;
}
.prose p { margin-bottom: 12px; }
.prose ul { padding-left: 20px; margin-bottom: 12px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text); font-weight: 550; }

/* ------------------------------------------------------------ Animations */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes flash-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise-in .6s var(--ease) both; animation-delay: var(--d, 0ms); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }
}
