/* ==========================================================================
   OmniXPro — socle commun (site vitrine + application)
   Jetons de design, base, boutons, formulaires, alertes
   ========================================================================== */

/* ---------- 1. Jetons de design ---------- */
:root {
  --night: #0a1628;
  --night-2: #0f213d;
  --night-3: #16305a;
  --electric: #1f5eff;
  --electric-hover: #1848cc;
  --cyan: #22d3ee;

  --bg: #ffffff;
  --bg-alt: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #dde5f0;
  --text: #0f1d33;
  --text-muted: #4a5b76;
  --primary: var(--electric);
  --primary-hover: var(--electric-hover);
  --on-primary: #ffffff;
  --accent: #0e7490;             /* cyan foncé : lisible sur fond clair */
  --focus: #1f5eff;

  --success: #15803d;  --success-bg: #ecfdf3;
  --warning: #b45309;  --warning-bg: #fff7e6;
  --danger:  #c81e1e;  --danger-bg:  #fef1f1;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(10, 22, 40, .06);
  --shadow: 0 10px 30px -12px rgba(10, 22, 40, .18);
  --shadow-lg: 0 24px 60px -20px rgba(10, 22, 40, .35);

  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --container: 1200px;
  --gutter: 16px;
  --header-h: 64px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07111f;
    --bg-alt: #0b1729;
    --surface: #0f1d33;
    --surface-2: #132540;
    --border: #213657;
    --text: #e6edf7;
    --text-muted: #a3b5cf;
    --primary: #3b7bff;
    --primary-hover: #5c91ff;
    --accent: #22d3ee;
    --focus: #22d3ee;
    --success: #4ade80; --success-bg: #0d2a1c;
    --warning: #fbbf24; --warning-bg: #2d220b;
    --danger:  #f87171; --danger-bg:  #2d1215;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07111f;
  --bg-alt: #0b1729;
  --surface: #0f1d33;
  --surface-2: #132540;
  --border: #213657;
  --text: #e6edf7;
  --text-muted: #a3b5cf;
  --primary: #3b7bff;
  --primary-hover: #5c91ff;
  --accent: #22d3ee;
  --focus: #22d3ee;
  --success: #4ade80; --success-bg: #0d2a1c;
  --warning: #fbbf24; --warning-bg: #2d220b;
  --danger:  #f87171; --danger-bg:  #2d1215;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, .h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .6em; font-weight: 800; }
h1 { font-size: clamp(2rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); }
h3, .h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
ul[role="list"], ol[role="list"] { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.center { text-align: center; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--primary); color: var(--on-primary); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--on-primary); }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 3. Boutons et liens ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: .7em 1.25em;
  border: 2px solid transparent; border-radius: 999px;
  font: inherit; font-weight: 700; font-size: .95rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s;
}
.btn .icon { width: 1.1em; height: 1.1em; }
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 40px; padding: .5em 1em; font-size: .9rem; }
.btn-lg { min-height: 52px; padding: .85em 1.6em; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 24px -10px rgba(31, 94, 255, .7); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-primary:hover .icon { transform: translateX(2px); }
.btn-primary .icon { transition: transform .2s; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline-light { background: rgba(255, 255, 255, .04); color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .12); border-color: #fff; color: #fff; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .7; cursor: progress; }

.link-arrow { display: inline-flex; align-items: center; gap: .4em; font-weight: 700; text-decoration: none; }
.link-arrow .icon { transition: transform .2s; }
.link-arrow:hover .icon { transform: translateX(4px); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  margin: 0 0 .9rem; font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
.eyebrow-light { color: var(--cyan); }
.lead { font-size: 1.1rem; color: var(--text-muted); }

/* ---------- 4. Formulaires et alertes ---------- */
.form { display: grid; gap: 18px; }
.form-row { display: grid; gap: 18px; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: .92rem; }
.req { color: var(--danger); }
.opt { font-weight: 500; color: var(--text-muted); }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="search"], input[type="url"], input[type="file"], select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
textarea { resize: vertical; min-height: 140px; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-error { margin: 0; color: var(--danger); font-size: .88rem; font-weight: 600; }
.field-help { margin: 0; color: var(--text-muted); font-size: .88rem; }
.form-legal { margin: 0; font-size: .88rem; color: var(--text-muted); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert { display: flex; gap: 12px; padding: 16px; margin-bottom: 24px; border-radius: var(--radius-sm); border: 1px solid; }
.alert .icon { margin-top: .15em; width: 22px; height: 22px; }
.alert p { margin: .25em 0 0; }
.alert-success { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 40%, transparent); color: var(--text); }
.alert-success .icon { color: var(--success); }
.alert-error { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--text); }
.alert-error .icon { color: var(--danger); }


/* ---------- 5. Éléments personnalisables (CMS) ---------- */
.logo-img { display: block; max-width: 220px; object-fit: contain; }
.alert-info { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 35%, transparent); color: var(--text); }
.alert-info .icon { color: var(--primary); }
.alert-warning { background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 45%, transparent); color: var(--text); }
.alert-warning .icon { color: var(--warning); }
