/* ================================================================
   Claire Platform — Styles globaux
   Palette cohérente avec claireassistante.fr (forest / cream / gold)
   ================================================================ */

:root {
  --forest:       #1f3d35;
  --forest-deep:  #15291f;
  --forest-soft:  rgba(31, 61, 53, 0.08);
  --cream:        #f5f0e8;
  --cream-warm:   #ede5d3;
  --cream-deep:   #e3d8be;
  --charcoal:     #1a1a1a;
  --slate:        #4a4a4a;
  --slate-soft:   #7a7a7a;
  --gold:         #c4945a;
  --gold-dark:    #b07d3e;
  --gold-soft:    rgba(196, 148, 90, 0.12);
  --danger:       #c8553d;
  --danger-soft:  rgba(200, 85, 61, 0.10);
  --success:      #4a8c5e;
  --success-soft: rgba(74, 140, 94, 0.12);
  --warning:      #d4a017;
  --warning-soft: rgba(212, 160, 23, 0.12);
  --line:         rgba(31, 61, 53, 0.12);
  --line-soft:    rgba(31, 61, 53, 0.06);

  --serif:        'Fraunces', Georgia, serif;
  --sans:         'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 6px rgba(31, 61, 53, 0.06);
  --shadow:    0 8px 24px rgba(31, 61, 53, 0.08);
  --shadow-lg: 0 18px 40px rgba(31, 61, 53, 0.12);

  --t-fast:    0.15s ease;
  --t:         0.25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--charcoal);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- TYPOGRAPHIE UTILITAIRE ---------- */
.serif       { font-family: var(--serif); }
.italic      { font-style: italic; }
.text-gold   { color: var(--gold); }
.text-forest { color: var(--forest); }
.text-slate  { color: var(--slate); }
.text-muted  { color: var(--slate-soft); }

.text-xs  { font-size: 12px; }
.text-sm  { font-size: 13px; }
.text-md  { font-size: 15px; }
.text-lg  { font-size: 17px; }
.text-xl  { font-size: 22px; }
.text-2xl { font-size: 28px; }
.text-3xl { font-size: 36px; }

.uppercase     { text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }

/* ---------- BOUTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 100px; font-weight: 500; font-size: 14px;
  transition: all var(--t); white-space: nowrap; line-height: 1;
}
.btn-primary {
  background: var(--forest); color: var(--cream);
  box-shadow: 0 4px 14px rgba(31, 61, 53, 0.18);
}
.btn-primary:hover { background: var(--forest-deep); transform: translateY(-1px); }
.btn-gold {
  background: var(--gold); color: #fff;
  box-shadow: 0 4px 14px rgba(196, 148, 90, 0.25);
}
.btn-gold:hover { background: var(--gold-dark); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--forest);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--cream-warm); }
.btn-danger {
  background: var(--danger-soft); color: var(--danger);
}
.btn-danger:hover { background: rgba(200, 85, 61, 0.18); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---------- FORMULAIRES ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label {
  font-size: 13px; font-weight: 500; color: var(--slate);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--charcoal);
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.field textarea { resize: vertical; min-height: 100px; }
.field .help { font-size: 12px; color: var(--slate-soft); margin-top: 2px; }
.field .error { font-size: 13px; color: var(--danger); margin-top: 4px; }

/* Sur mobile, iOS zoome automatiquement au focus quand un champ fait moins de 16px.
   On force 16px sur petits écrans pour éviter ce zoom intempestif. */
@media (max-width: 600px) {
  .field input, .field textarea, .field select { font-size: 16px; }
}

/* ---------- BADGES ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 100px;
  font-size: 12px; font-weight: 600;
}
.badge-urgence-normale  { background: var(--success-soft); color: var(--success); }
.badge-urgence-moderee  { background: var(--warning-soft); color: #8a6510; }
.badge-urgence-elevee   { background: var(--danger-soft); color: var(--danger); }
.badge-statut-en_attente { background: var(--gold-soft); color: var(--gold-dark); }
.badge-statut-a_rappeler { background: var(--warning-soft); color: #8a6510; }
.badge-statut-traite     { background: var(--success-soft); color: var(--success); }
.badge-statut-ignore     { background: rgba(0,0,0,0.05); color: var(--slate); }

/* ---------- CARTES ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card-soft {
  background: var(--cream-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card-dark {
  background: var(--forest);
  color: var(--cream);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ---------- ALERTES ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error   { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-info    { background: var(--gold-soft); color: var(--gold-dark); }

/* ---------- LOADER ---------- */
.loader {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(31, 61, 53, 0.15);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--cream-warm) 25%, var(--cream-deep) 50%, var(--cream-warm) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- UTILS ---------- */
.flex      { display: flex; }
.flex-col  { display: flex; flex-direction: column; }
.flex-1    { flex: 1; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.gap-6  { gap: 24px; }
.mt-2   { margin-top: 8px; }
.mt-4   { margin-top: 16px; }
.mt-6   { margin-top: 24px; }
.mb-2   { margin-bottom: 8px; }
.mb-4   { margin-bottom: 16px; }
.mb-6   { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.hidden { display: none !important; }
.relative { position: relative; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
