/*
  OrientApp — Design System v3
  Mobile-first. Une section = un écran.
  Dark premium · Orange accent · Responsive natif
*/

/* ══ TOKENS ══════════════════════════════════════════════════ */
:root {
  --bg0: #060c18;
  --bg1: #09142a;
  --bg2: #0c1d38;
  --card0: rgba(255,255,255,.09);
  --card1: rgba(255,255,255,.05);
  --stroke: rgba(255,255,255,.10);
  --stroke2: rgba(255,255,255,.06);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);
  --muted2: rgba(255,255,255,.42);
  --orange: #ff7a00;
  --orange2: #ff4d2e;
  --orange-glow: rgba(255,122,0,.22);
  --blue: rgba(68,189,255,.85);
  --green: rgba(34,197,94,.85);
  --red: rgba(239,68,68,.85);
  --shadow: 0 12px 40px rgba(0,0,0,.40);
  --shadow-sm: 0 4px 16px rgba(0,0,0,.28);
  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 10px;

  /* Tailles safe pour mobile */
  --topbar-h: 58px;
  --space: clamp(14px, 4vw, 22px);
}

/* ══ RESET ════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(900px 480px at 50% -60px, rgba(255,122,0,.16), transparent 65%),
    radial-gradient(700px 420px at 5% 40%, rgba(68,189,255,.10), transparent 60%),
    linear-gradient(160deg, var(--bg0) 0%, var(--bg1) 55%, var(--bg2) 100%);
  min-height: 100dvh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; font-size: inherit; }

/* ══ LAYOUT ═══════════════════════════════════════════════════ */
.container {
  width: min(1120px, 94vw);
  margin: 0 auto;
}

/* ══ TOPBAR ═══════════════════════════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-h);
  background: rgba(6,12,24,.72);
  border-bottom: 1px solid var(--stroke2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex; align-items: center;
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 8px; }
.brand-title { font-weight: 900; font-size: 20px; letter-spacing: -.02em; }

/* Nav desktop */
.nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 7px 12px; border-radius: var(--r-md);
  color: var(--muted); font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.06); border-color: var(--stroke); }
.nav-link.active { color: var(--text); background: rgba(255,122,0,.12); border-color: rgba(255,122,0,.3); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  border: 1px solid var(--stroke);
  background: var(--card0);
  color: var(--text);
  align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px;
}

/* ══ HERO ══════════════════════════════════════════════════════ */
.hero {
  min-height: calc(100dvh - var(--topbar-h));
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 48px var(--space) 40px;
}
.hero-badge {
  width: 72px; height: 72px; border-radius: 20px;
  display: grid; place-items: center;
  padding: 12px;
  border: 1px solid var(--stroke);
  background: var(--card0);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.hero-badge img { width: 46px; height: 46px; object-fit: contain; }
.hero-title {
  font-size: clamp(36px, 8vw, 56px);
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: 1.05;
}
.accent { color: var(--orange); }
.hero-sub {
  margin-top: 12px; margin-bottom: 0;
  color: var(--muted); font-size: clamp(15px, 3vw, 17px);
  max-width: 440px; line-height: 1.6;
}

/* ══ CARDS ════════════════════════════════════════════════════ */
.card {
  padding: var(--space);
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, var(--card0), var(--card1));
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.card-page {
  width: min(520px, 94vw);
  margin: 24px auto 0;
}
.card-md { width: min(680px, 94vw); margin: 24px auto 0; }
.card-lg { width: min(900px, 94vw); margin: 24px auto 0; }

/* ══ BUTTONS ══════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--stroke);
  background: var(--card0);
  color: var(--text);
  font-weight: 700; font-size: 14px;
  cursor: pointer; white-space: nowrap;
  text-decoration: none;
  transition: transform .14s, background .14s, border-color .14s, box-shadow .14s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); }
.btn:active { transform: translateY(0); }
.btn-primary {
  border-color: rgba(255,122,0,.5);
  background: linear-gradient(135deg, rgba(255,122,0,.95), rgba(255,77,46,.90));
  box-shadow: 0 8px 28px rgba(255,122,0,.20);
  color: #fff;
}
.btn-primary:hover { box-shadow: 0 12px 36px rgba(255,122,0,.28); }
.btn-ghost { background: rgba(255,255,255,.04); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: var(--r-md); }
.btn-block { width: 100%; }

/* ══ FORMS ════════════════════════════════════════════════════ */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  color: var(--text); font-size: 15px;
  outline: none; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: rgba(255,122,0,.5);
  box-shadow: 0 0 0 3px rgba(255,122,0,.15);
}
.form-input::placeholder { color: var(--muted2); }
.form-textarea { min-height: 90px; resize: vertical; }
.form-select option { background: #0b1630; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

/* ══ NOTICES ══════════════════════════════════════════════════ */
.notice { padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--stroke); background: var(--card1); margin-bottom: 14px; font-size: 14px; }
.notice-ok  { border-color: rgba(34,197,94,.35);  background: rgba(34,197,94,.08);  color: rgba(200,255,200,.9); }
.notice-err { border-color: rgba(239,68,68,.35);  background: rgba(239,68,68,.08);  color: rgba(255,200,200,.9); }
.notice-warn{ border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.08); color: rgba(255,240,180,.9); }

/* ══ BADGES ═══════════════════════════════════════════════════ */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-green  { background: rgba(34,197,94,.12);  border: 1px solid rgba(34,197,94,.28);  color: rgba(120,255,160,.9); }
.badge-orange { background: rgba(255,122,0,.12);  border: 1px solid rgba(255,122,0,.28);  color: rgba(255,180,80,.9); }
.badge-blue   { background: rgba(68,189,255,.12); border: 1px solid rgba(68,189,255,.28); color: rgba(140,220,255,.9); }
.badge-red    { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.28);  color: rgba(255,160,160,.9); }
.badge-muted  { background: rgba(255,255,255,.06); border: 1px solid var(--stroke); color: var(--muted); }

/* ══ PILLS & CHIPS ═════════════════════════════════════════════ */
.pill { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--card0); border: 1px solid var(--stroke); color: var(--muted); font-size: 13px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }

/* ══ TABLES ════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--stroke2); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { padding: 9px 12px; text-align: left; color: var(--muted2); font-weight: 600; border-bottom: 1px solid var(--stroke2); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--stroke2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(255,255,255,.025); }

/* ══ GRIDS UTILITAIRES ════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ══ LOADER ════════════════════════════════════════════════════ */
.loader-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: rgba(6,12,24,.85);
  backdrop-filter: blur(14px);
}
.loader-card {
  width: min(440px, 90vw);
  padding: 24px; border-radius: 22px;
  border: 1px solid var(--stroke);
  background: rgba(9,20,42,.85);
  box-shadow: var(--shadow); text-align: center;
}
.loader-logo {
  width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--card0) url('../img/logo.png') center/32px no-repeat;
}
.loader-bar { height: 6px; border-radius: 999px; background: var(--card0); overflow: hidden; }
.loader-progress {
  height: 100%; width: 40%;
  background: linear-gradient(90deg, var(--orange), var(--orange2));
  animation: loaderMove 1.2s ease-in-out infinite;
}
.loader-text { margin-top: 10px; color: var(--muted); font-size: 14px; }
body.is-loaded .loader-overlay { display: none; }
@keyframes loaderMove { 0%{transform:translateX(-80%)} 50%{transform:translateX(160%)} 100%{transform:translateX(-80%)} }

/* ══ ANIMATIONS ════════════════════════════════════════════════ */
.reveal { opacity: 0; transform: translateY(10px); animation: reveal .5s ease forwards; }
.delay-1 { animation-delay: .08s; }
.delay-2 { animation-delay: .16s; }
.delay-3 { animation-delay: .24s; }
.delay-4 { animation-delay: .32s; }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }

/* ══ BACK TO TOP ═══════════════════════════════════════════════ */
.to-top {
  position: fixed; right: 14px; bottom: 18px; display: none;
  width: 42px; height: 42px; border-radius: 14px;
  border: 1px solid var(--stroke); background: rgba(255,255,255,.06);
  color: var(--text); cursor: pointer; z-index: 60; font-size: 16px;
  align-items: center; justify-content: center;
}
.to-top:hover { background: rgba(255,255,255,.10); }

/* ══ DIVIDER ═══════════════════════════════════════════════════ */
.divider { height: 1px; background: var(--stroke2); margin: 44px 0 0; }

/* ══ SECTION LAYOUT ═════════════════════════════════════════════
   Mobile-first: chaque section occupe au moins 100dvh
═══════════════════════════════════════════════════════════════ */
.section-screen {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 48px var(--space);
}
.section-center { align-items: center; text-align: center; }
.section-title { font-size: clamp(22px, 5vw, 30px); font-weight: 900; letter-spacing: -.02em; margin-bottom: 8px; }
.section-sub { color: var(--muted); font-size: 15px; margin-bottom: 28px; }

/* ══ MOBILE NAV ════════════════════════════════════════════════ */
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav-menu {
    position: fixed;
    top: var(--topbar-h);
    right: 0; left: 0;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    background: rgba(6,12,24,.96);
    border-bottom: 1px solid var(--stroke);
    backdrop-filter: blur(16px);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s, transform .18s;
    z-index: 90;
    max-height: calc(100dvh - var(--topbar-h));
    overflow-y: auto;
  }
  .nav-menu { display: flex; }
  body.nav-open .nav-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-link { width: 100%; text-align: center; padding: 12px 16px; font-size: 15px; }
}
@media (min-width: 821px) {
  .nav-menu { display: flex !important; }
}

/* ══ RESPONSIVE GÉNÉRAL ═════════════════════════════════════════ */
@media (max-width: 480px) {
  .btn { padding: 12px 16px; font-size: 14px; width: 100%; justify-content: center; }
  .btn-sm { width: auto; font-size: 12px; padding: 6px 10px; }
  .card { padding: 16px; border-radius: var(--r-lg); }
}


/* patch1-home-mobile — fix boutons hero sur mobile */
@media (max-width: 480px) {
  .home-cta-block { flex-direction: column; align-items: stretch; gap: 10px; }
  .home-cta-block .btn-xl {
    width: 100%;
    padding: 14px 16px;
    font-size: 14px;
    min-height: 48px;
    white-space: normal;
    word-break: break-word;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
  }
}
@media (max-width: 360px) {
  .home-cta-block .btn-xl { font-size: 13px; padding: 12px 12px; }
}
