/* SubventionPilot — Design Tokens
 * Charte graphique 2026-04-25 (Claude Design)
 * Palette : outremer #1e3a8a · ambre #b8731f · crème #f3ede0
 * Typo : Geist (display + UI) + Geist Mono (chiffres et code)
 * Logo : voilier bicolore (outremer + ambre)
 */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Geist+Mono:wght@100..900&display=swap');

:root {
  /* Base neutrals — crème charte */
  --bg: #f3ede0;                       /* crème (charte) */
  --bg-elev: #f7f1e6;
  --bg-sunken: #ebe3d2;
  --surface: #ffffff;
  --border: #ddd2bd;
  --border-strong: #c5b89e;
  --rule: #d3c8b1;

  /* Ink — anthracite chaud */
  --ink: #1c1a17;
  --ink-soft: #44413c;
  --ink-muted: #6b665d;
  --ink-subtle: #908a7e;

  /* Brand — outremer (charte officielle #1e3a8a) */
  --brand: #1e3a8a;
  --brand-deep: #14266b;
  --brand-soft: #3a5dc1;
  --brand-bg: #e7eafa;
  --brand-ink: #f3ede0;                /* crème sur outremer */

  /* Accent — ambre cuivré (charte officielle #b8731f) */
  --accent: #b8731f;
  --accent-deep: #935a14;
  --accent-soft: #d99a4f;
  --accent-bg: #f8eddb;
  --accent-ink: #1c1a17;

  /* Semantic — palette danger charte */
  --positive: #2f7d4f;
  --positive-bg: #def0e3;
  --warning: #b8731f;                   /* aligné sur ambre charte */
  --danger: #5c2b2e;
  --danger-soft: #ff8a80;
  --danger-deep: #2a1215;

  /* Radius — conservative, cabinet */
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
  --r-xl: 16px;

  /* Shadow */
  --shadow-1: 0 1px 0 0 rgba(28, 26, 23, 0.06);
  --shadow-2: 0 1px 2px rgba(28, 26, 23, 0.04), 0 2px 8px rgba(28, 26, 23, 0.04);
  --shadow-3: 0 1px 2px rgba(28, 26, 23, 0.05), 0 8px 24px rgba(28, 26, 23, 0.06);

  /* Type — full Geist (charte) */
  --font-ui: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --container: 1200px;
  --container-narrow: 880px;
  --gutter: clamp(16px, 4vw, 40px);
}

[data-theme="dark"] {
  --bg: #14130f;
  --bg-elev: #1c1a16;
  --bg-sunken: #0f0e0b;
  --surface: #1f1d18;
  --border: #2e2b25;
  --border-strong: #3d3932;
  --rule: #2a2722;

  --ink: #f3ede0;
  --ink-soft: #d4cdba;
  --ink-muted: #9a9485;
  --ink-subtle: #6e695e;

  --brand: #6c8aff;                    /* outremer plus lumineux pour fond sombre */
  --brand-deep: #92a8ff;
  --brand-soft: #4a64d4;
  --brand-bg: #1a2348;
  --brand-ink: #14130f;

  --accent: #d99a4f;                   /* ambre plus lumineux */
  --accent-deep: #c08436;
  --accent-soft: #f0bc7b;
  --accent-bg: #2c2118;
  --accent-ink: #14130f;

  --positive: #5cb585;
  --positive-bg: #1a3024;
  --warning: #d99a4f;
  --danger: #ff8a80;
  --danger-soft: #ff8a80;
  --danger-deep: #5c2b2e;

  --shadow-1: 0 1px 0 0 rgba(0,0,0,0.6);
  --shadow-2: 0 1px 2px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-3: 0 1px 2px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.4);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; }
img, svg { display: block; max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 0; }

::selection { background: var(--brand); color: var(--brand-ink); }

/* Utility classes */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { width: 100%; max-width: var(--container-narrow); margin: 0 auto; padding: 0 var(--gutter); }

.mono { font-family: var(--font-mono); font-feature-settings: "tnum", "zero"; }
.display { font-family: var(--font-display); font-optical-sizing: auto; letter-spacing: -0.02em; }
.tnum { font-variant-numeric: tabular-nums; }

/* Eyebrow label */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r-md);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent-deep);
  box-shadow: inset 0 -1px 0 oklch(0 0 0 / 0.08);
}
.btn-primary:hover { background: var(--accent-deep); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-sunken); border-color: var(--ink-soft); }

.btn-brand {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand-deep);
}
.btn-brand:hover { background: var(--brand-deep); }

.btn-link {
  height: auto;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--brand);
  font-weight: 500;
  border-bottom: 1px solid transparent;
  border-radius: 0;
}
.btn-link:hover { border-bottom-color: currentColor; }

.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.card-hover:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  border-radius: var(--r-sm);
  background: var(--bg-sunken);
  color: var(--ink-soft);
  border: 1px solid var(--border);
}
.badge-brand { background: var(--brand-bg); color: var(--brand); border-color: color-mix(in oklch, var(--brand) 25%, transparent); }
.badge-accent { background: var(--accent-bg); color: var(--accent-deep); border-color: color-mix(in oklch, var(--accent) 40%, transparent); }
.badge-positive { background: var(--positive-bg); color: var(--positive); border-color: color-mix(in oklch, var(--positive) 30%, transparent); }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.input, .select, .textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.textarea { height: auto; padding: 12px 14px; min-height: 120px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand) 18%, transparent);
}

/* Placeholder boxes (imagery) */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      transparent 0 10px,
      color-mix(in oklch, var(--ink) 4%, transparent) 10px 11px);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* Section rhythm */
section { position: relative; }
.section { padding: clamp(56px, 8vw, 112px) 0; }
.section-sm { padding: clamp(40px, 5vw, 72px) 0; }

/* Type scale */
.h-display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 144;
}
.h1 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: clamp(34px, 4.5vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.h2 {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.018em;
  font-weight: 600;
  margin: 0;
}
.h3 {
  font-size: clamp(20px, 2.2vw, 24px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 0;
}
.lead {
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.45;
  color: var(--ink-soft);
}

/* Divider rule with tick */
.rule-label {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-muted);
}
.rule-label::before, .rule-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* Focus ring */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* Scrollbar subtle */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* Map island silhouette — used as subtle brand mark */
.isle {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.12em;
  color: currentColor;
}
