/* =========================================================
   Move — Design System (mobile-first)
   Inspiré des maquettes (fond clair, cartes blanches, bleu, ombres douces)
   ========================================================= */

/* ---------- Tokens ---------- */
:root{
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --surface-2: #F7F9FD;

  --text: #1B2430;
  --muted: #667085;
  --muted-2: #98A2B3;

  --primary: #047a99;         /* bleu principal */
  --primary-2: #046881;       /* bleu plus sombre (dégradé) */
  --primary-soft: rgba(47,115,230,.12);

  --danger: #99042f;
  --danger-soft: rgba(180,35,24,.10);

  --border: rgba(16, 24, 40, .10);

  --shadow-sm: 0 6px 18px rgba(16, 24, 40, .08);
  --shadow-md: 0 14px 34px rgba(16, 24, 40, .12);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;

  --container: 750px; /* largeur max mobile */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  --focus: 0 0 0 4px rgba(47,115,230,.22);
}

@media (prefers-color-scheme: dark){
  :root{
    --bg: #0C111A;
    --surface: #101828;
    --surface-2: #0F172A;
    --text: #F2F4F7;
    --muted: #98A2B3;
    --muted-2:#667085;
    --border: rgba(242,244,247,.12);
    --shadow-sm: 0 10px 24px rgba(0,0,0,.35);
    --shadow-md: 0 18px 50px rgba(0,0,0,.55);
    --primary-soft: rgba(47,115,230,.18);
  }
}

/* ---------- Base ---------- */
*{ box-sizing:border-box; }
html, body { height:100%; }
body{
  margin:0;
  background: radial-gradient(1100px 520px at 50% -10%, rgba(47,115,230,.10), transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  line-height:1.35;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img{ max-width:100%; display:block; }

hr{
  border:0;
  height:1px;
  background: var(--border);
  margin:16px 0;
}

::selection{ background: rgba(47,115,230,.22); }

:focus-visible{
  outline: none;
  box-shadow: var(--focus);
  border-radius: 10px;
}

/* ---------- Layout helpers ---------- */
.page{
  min-height:100%;
  display:flex;
  flex-direction:column;
  padding-top: calc(14px + var(--safe-top));
  padding-bottom: calc(86px + var(--safe-bottom)); /* réserve pour la bottom nav */
}

.container{
  width: min(100%, var(--container));
  margin: 0 auto;
  padding: 16px;
}

.center{
  display:flex;
  align-items:center;
  justify-content:center;
}

.stack{ display:flex; flex-direction:column; gap:12px; }
.row{ display:flex; gap:12px; align-items:center; }
.space-between{ justify-content:space-between; }

/* ---------- Typography ---------- */
.h1{
  font-size: 26px;
  letter-spacing: -0.02em;
  margin: 6px 0 6px;
  font-weight: 750;
}
.h2{
  font-size: 18px;
  margin: 0;
  font-weight: 700;
}
.p{
  margin:0;
  color: var(--muted);
}

.kicker{
  font-size: 12px;
  color: var(--muted-2);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ---------- Card / Surface ---------- */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.card.soft{
  background: var(--surface-2);
  box-shadow: none;
}

.cardHeader{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
}

/* ---------- Forms ---------- */
.form{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.label{
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 6px;
}

.input, .select, .textarea{
  width:100%;
  background: rgba(255,255,255,.7);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text);
  outline:none;
  transition: box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

@media (prefers-color-scheme: dark){
  .input, .select, .textarea{
    background: rgba(16,24,40,.65);
  }
}

.input::placeholder, .textarea::placeholder{
  color: var(--muted-2);
}

.input:focus, .select:focus, .textarea:focus{
  border-color: rgba(47,115,230,.55);
  box-shadow: var(--focus);
}

.textarea{ min-height: 110px; resize: vertical; }

.fieldHint{
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* checkbox / toggles simples */
.checkRow{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(47,115,230,.06);
  border: 1px solid rgba(47,115,230,.15);
}
.checkRow input{ width:18px; height:18px; }

/* ---------- Buttons (maquette: gros bouton bleu dégradé) ---------- */
.btn{
  appearance:none;
  border:0;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 12px 16px;
  border-radius: 18px;
  font-weight: 750;
  font-size: 16px;
  transition: transform .06s ease, box-shadow .18s ease, filter .18s ease, background .18s ease;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active{ transform: translateY(1px); }

.btnPrimary{
  color: #fff;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 26px rgba(47,115,230,.30);
}

.btnPrimary:hover{ filter: brightness(1.02); }
.btnPrimary:disabled{
  opacity:.55;
  cursor:not-allowed;
  box-shadow:none;
}

.btnGhost{
  color: var(--primary);
  background: transparent;
  border: 1px solid rgba(47,115,230,.35);
}

.btnSubtle{
  color: var(--text);
  background: rgba(16,24,40,.06);
  border: 1px solid var(--border);
}

.btnDanger{
  color: #fff;
  background: linear-gradient(180deg, #D92D20, #B42318);
  box-shadow: 0 12px 26px rgba(180,35,24,.25);
}

.btnLink{
  background: transparent;
  padding: 10px 0;
  color: var(--muted);
  font-weight: 650;
}
.btnLink:hover{ color: var(--text); text-decoration: underline; }

.btnFull{ width:100%; }

/* ---------- Alerts ---------- */
.alert{
  border-radius: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.alertError{
  border-color: rgba(180,35,24,.25);
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 650;
}

.alertOk{
  border-color: rgba(18,183,106,.25);
  background: rgba(18,183,106,.10);
  color: #067647;
  font-weight: 650;
}

/* ---------- Onboarding / Hero (image + texte centré) ---------- */
.hero{
  text-align:center;
  padding: 6px 6px 0;
}

.heroImg{
  width: min(320px, 80vw);
  margin: 8px auto 14px;
  filter: drop-shadow(0 20px 40px rgba(16,24,40,.10));
}

.dots{
  display:flex;
  justify-content:center;
  gap:10px;
  padding: 10px 0 0;
}

.dot{
  width:10px;
  height:10px;
  border-radius:999px;
  background: rgba(16,24,40,.16);
}
.dot.active{ background: var(--primary); }

/* ---------- Bottom navigation (style app) ---------- */
.bottomNav{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  isolation: isolate;
  padding-bottom: var(--safe-bottom);
  background: rgba(255,255,255,.88);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (prefers-color-scheme: dark){
  .bottomNav{
    background: rgba(16,24,40,.85);
  }
}

.bottomNavInner{
  width: min(100%, var(--container));
  margin: 0 auto;
  display:flex;
  justify-content:space-around;
  padding: 10px 14px 12px;
}

.navItem{
  position:relative;
  display:flex;
  flex: 1 1 20%;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-width: 0;
  min-height: 48px;
  padding: 2px 3px;
  color: var(--muted);
  font-weight: 650;
  font-size: 12px;
  line-height: 1.1;
  text-align:center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(47,115,230,.14);
}

.navUnreadBadge{
  position:absolute;
  top:0;
  left:calc(50% + 9px);
  min-width:18px;
  height:18px;
  padding:0 5px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:2px solid var(--surface);
  border-radius:999px;
  background:#d92d20;
  color:#fff;
  font-size:10px;
  font-weight:900;
  line-height:1;
  box-sizing:border-box;
  pointer-events:none;
}

.navUnreadBadge[hidden]{ display:none !important; }

.navItem .icon{
  width: 26px;
  height: 26px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: 12px;
  color: currentColor;
}

.navItem.active{
  color: var(--primary);
}
.navItem.active .icon{
  background: var(--primary-soft);
}
/* --- Bottom navigation : pas de surlignage hover --- */

.bottomNav .navItem:hover,
.bottomNav .navItem:focus {
  background: transparent !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.bottomNav .navItem:active {
  background: var(--primary-soft) !important;
  transform: scale(.97);
  text-decoration: none !important;
}

@media (max-width: 380px){
  .bottomNavInner{ padding-left: 6px; padding-right: 6px; }
  .navItem{ font-size: 11px; }
}

/* Désactive le hover global sans neutraliser le retour tactile :active. */
.bottomNav a:hover:not(:active) {
  background: transparent !important;
}
/* ---------- Desktop enhancements ---------- */
@media (min-width: 900px){
  .page{
    padding-bottom: 24px;
  }
  .bottomNav{
    position: static;
    border-radius: var(--radius-lg);
    /*width: min(100%, var(--container));*/
    width:718px;
    margin: 18px auto 0;
    border: 1px solid var(--border);
  }
}
body {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
