@import url('https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,400;0,600;1,400&family=Figtree:wght@400;500;600&display=swap');

:root {
  --fond: #f7f4ef;
  --carte: #ffffff;
  --primaire: #2c4a3e;
  --primaire-hover: #1e3329;
  --accent: #5c8a6f;
  --vert: #3d7a52;
  --vert-hover: #2e5e3e;
  --rouge: #b94040;
  --gris: #6b7c74;
  --gris-clair: #ede9e1;
  --bordure: #ddd9d0;
  --texte: #1e2d25;
  --blanc: #ffffff;
  --avertissement: #f5e9c8;
  --avertissement-texte: #7a5a1e;
  --radius: 10px;
  --radius-lg: 16px;
  --ombre: 0 2px 8px rgba(30,45,37,0.08);
  --ombre-lg: 0 8px 30px rgba(30,45,37,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Figtree', -apple-system, sans-serif;
  color: var(--texte);
  background: var(--fond);
  min-height: 100vh;
}

/* ── Header ─────────────────────────────── */
header {
  background: var(--primaire);
  color: var(--blanc);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(30,45,37,0.22);
}

header h1 {
  font-family: 'Cormorant', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: #e8e2d8;
}

#barre-recherche {
  flex: 1;
  max-width: 420px;
  position: relative;
}

#input-recherche {
  width: 100%;
  padding: 0.45rem 1.1rem;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 24px;
  font-size: 0.875rem;
  font-family: 'Figtree', sans-serif;
  outline: none;
  background: rgba(255,255,255,0.1);
  color: var(--blanc);
  transition: background 0.2s, border-color 0.2s;
}

#input-recherche::placeholder { color: rgba(255,255,255,0.5); }

#input-recherche:focus {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.4);
}

#resultats-recherche {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: var(--radius);
  box-shadow: var(--ombre-lg);
  z-index: 200;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

#resultats-recherche.visible { display: block; }

.resultat-item {
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--texte);
  transition: background 0.15s;
  border-bottom: 1px solid var(--gris-clair);
}

.resultat-item:last-child { border-bottom: none; }
.resultat-item:hover { background: #eef4f0; }

.btn-deconnexion {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.8);
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: 'Figtree', sans-serif;
  white-space: nowrap;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.btn-deconnexion:hover {
  background: rgba(255,255,255,0.15);
  color: var(--blanc);
}

/* ── Main ────────────────────────────────── */
main { max-width: 920px; margin: 0 auto; padding: 2rem 1.5rem; }

section { display: none; }
section.active { display: block; }

/* ── Cartes ──────────────────────────────── */
.carte {
  background: var(--carte);
  border-radius: var(--radius-lg);
  box-shadow: var(--ombre);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--bordure);
}

.carte h2 {
  font-family: 'Cormorant', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primaire);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: 0.01em;
}

/* ── Agenda ──────────────────────────────── */
.rdv-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--bordure);
  cursor: pointer;
  transition: background 0.15s, padding 0.15s;
  border-radius: 6px;
}

.rdv-item:last-child { border-bottom: none; }

.rdv-item:hover {
  background: #eef4f0;
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.rdv-heure {
  font-weight: 600;
  color: var(--accent);
  min-width: 55px;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.rdv-nom { flex: 1; font-size: 0.925rem; }

/* ── Fiche patient ───────────────────────── */
.retour {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--gris);
  cursor: pointer;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  background: none;
  border: none;
  padding: 0;
  transition: color 0.2s;
  font-family: 'Figtree', sans-serif;
}

.retour:hover { color: var(--primaire); }

.patient-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.patient-nom {
  font-family: 'Cormorant', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--primaire);
  letter-spacing: 0.01em;
}

.patient-info { color: var(--gris); font-size: 0.875rem; margin-top: 0.25rem; }

.infos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 2rem;
  margin-top: 1.25rem;
}

.info-item label {
  font-size: 0.72rem;
  color: var(--gris);
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.2rem;
  font-weight: 500;
}

.info-item span { font-size: 0.925rem; color: var(--texte); }

.antecedents-block {
  grid-column: 1 / -1;
  background: var(--avertissement);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-top: 0.75rem;
  border-left: 3px solid #d4a832;
}

.antecedents-block label {
  font-size: 0.72rem;
  color: var(--avertissement-texte) !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ── Soins liste ─────────────────────────── */
.soin-item {
  display: flex;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--bordure);
  cursor: pointer;
  align-items: flex-start;
  transition: background 0.15s, padding 0.15s;
  border-radius: 6px;
}

.soin-item:last-child { border-bottom: none; }

.soin-item:hover {
  background: #eef4f0;
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.soin-date {
  font-weight: 600;
  color: var(--accent);
  min-width: 95px;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.soin-motif { flex: 1; font-size: 0.9rem; color: var(--texte); }

.soin-montant {
  font-size: 0.875rem;
  color: var(--gris);
  white-space: nowrap;
  font-weight: 500;
}

/* ── Boutons ─────────────────────────────── */
.btn {
  padding: 0.5rem 1.3rem;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Figtree', sans-serif;
  transition: all 0.18s;
  letter-spacing: 0.01em;
}

.btn-primaire { background: var(--primaire); color: var(--blanc); }
.btn-primaire:hover { background: var(--primaire-hover); }
.btn-secondaire { background: var(--gris-clair); color: var(--texte); border: 1px solid var(--bordure); }
.btn-secondaire:hover { background: #e0dbd2; }
.btn-vert { background: var(--vert); color: var(--blanc); }
.btn-vert:hover { background: var(--vert-hover); }
.btn-danger { background: var(--rouge); color: var(--blanc); }
.btn-danger:hover { background: #9a3333; }
.btn-petit { padding: 0.3rem 0.85rem; font-size: 0.8rem; }

/* ── Modals ──────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,35,25,0.5);
  z-index: 300;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}

.modal-overlay.visible { display: flex; }

.modal {
  background: var(--carte);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(20,35,25,0.25);
}

.modal h2 {
  font-family: 'Cormorant', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.4rem;
  color: var(--primaire);
  letter-spacing: 0.01em;
}

/* ── Formulaires ─────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--gris);
  margin-bottom: 0.35rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.55rem 0.9rem;
  border: 1.5px solid var(--bordure);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: 'Figtree', sans-serif;
  background: #fdfcfa;
  color: var(--texte);
  transition: border-color 0.2s, background 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--blanc);
}

.form-group textarea { min-height: 85px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

/* ── Radio paiement ──────────────────────── */
.radio-group { display: flex; gap: 1.5rem; }

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--texte);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

/* ── Banner Google ───────────────────────── */
#banner-google {
  background: #fef6e4;
  border: 1px solid #e8c96a;
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  color: #7a5e18;
}

/* ── Alertes ─────────────────────────────── */
.alerte {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.1rem;
  font-size: 0.875rem;
}

.alerte-succes { background: #e4f4e8; color: #1a5c2a; border-left: 3px solid var(--vert); }
.alerte-erreur { background: #fce8e8; color: #8a1a1a; border-left: 3px solid var(--rouge); }

/* ── Login ───────────────────────────────── */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primaire);
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 55%, rgba(92,138,111,0.35) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 15%, rgba(196,113,78,0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 85%, rgba(44,74,62,0.4) 0%, transparent 55%);
}

.login-card {
  background: var(--carte);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
}

.login-card h1 {
  font-family: 'Cormorant', Georgia, serif;
  color: var(--primaire);
  margin-bottom: 0.35rem;
  font-size: 2.1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.login-card p { color: var(--gris); font-size: 0.875rem; margin-bottom: 1.75rem; }

/* ── Scrollbar ───────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bordure); border-radius: 3px; }

/* ── Responsive ──────────────────────────── */
@media (max-width: 600px) {
  .infos-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  header { padding: 0 1rem; }
  main { padding: 1.5rem 1rem; }
  .carte { padding: 1.25rem; }
}
