/* === Variables & bases (sécurise les vars si non définies ailleurs) === */
:root{
  --rdv-bg: #ffffff;
  --rdv-card: #ffffff;
  --rdv-br: #e5e7eb;           /* slate-200 */
  --rdv-txt: #0f172a;          /* slate-900 */
  --rdv-sub: #64748b;          /* slate-500 */
  --rdv-muted: #94a3b8;        /* slate-400 */
  --rdv-input-bg: #fff;
  --rdv-input-txt: #0f172a;
  --rdv-input-ph: #9aa4b2;
  --rdv-focus: #2563eb;        /* blue-600 */
  --rdv-focus-ring: rgba(37,99,235,.15);
  --rdv-danger: #dc2626;       /* red-600 */
  --rdv-ok: #16a34a;           /* green-600 */
  --rdv-shadow: 0 6px 18px rgba(0,0,0,.06);
}

*,
*::before,
*::after { box-sizing:border-box; }
.rdv-shell{ max-width:880px; margin:0 auto; padding:0 1rem; }
.rdv-card{
  background:var(--rdv-card);
  border:1px solid var(--rdv-br);
  border-radius:16px;
  box-shadow:var(--rdv-shadow);
  padding:2rem;
}
@media (min-width:640px){
  .rdv-card{ padding:2.25rem; }
}
.rdv-title{
  margin:0 0 .25rem 0;
  font-weight:800;
  font-size:1.5rem;           /* ~text-2xl */
  line-height:2rem;
  color:var(--rdv-txt);
}
.rdv-sub{
  margin:0;
  color:var(--rdv-sub);
  font-size:1rem;
  line-height:1.5rem;
}
.rdv-sep{
  height:1px;
  background:var(--rdv-br);
  margin:1.25rem 0 1.5rem 0;
}

/* === Forme & grille === */
.rdv-form{
  display:grid;
  grid-template-columns:1fr;
  gap:1rem 1rem;
}
@media (min-width:640px){
  .rdv-form{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }
}
/* force certains blocs à prendre toute la largeur */
.rdv-form .rdv-field:nth-child(n+5),
.rdv-form .rdv-field textarea,
.rdv-form .rdv-field--full{ grid-column:1 / -1; }

/* email + téléphone côte à côte en >=640px (garde l’ordre HTML) */
@media (min-width:640px){
  .rdv-form .rdv-field:has([name="email"]),
  .rdv-form .rdv-field:has([name="phone"]){
    grid-column:auto; /* chaque champ occupe une colonne */
  }
}

/* === Champs === */
.rdv-field{ display:flex; flex-direction:column; gap:.375rem; }
.rdv-label{
  font-weight:600;
  color:var(--rdv-txt);
  font-size:.95rem;
}
.rdv-err{ color:var(--rdv-danger); }

/* inputs / textarea uniformisés */
.rdv-input,
.rdv-text{
  appearance:none;
  width:100%;
  border:1px solid var(--rdv-br);
  background:var(--rdv-input-bg);
  color:var(--rdv-input-txt);
  border-radius:12px;
  padding:.75rem 1rem;
  line-height:1.4;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.rdv-input::placeholder,
.rdv-text::placeholder{ color:var(--rdv-input-ph); }

/* focus accessible (bleu, pas d'erreur rouge) */
.rdv-input:focus,
.rdv-text:focus{
  border-color:var(--rdv-focus);
  box-shadow:0 0 0 4px var(--rdv-focus-ring);
}

/* textarea sizing */
.rdv-text{ min-height:140px; resize:vertical; }

/* aide sous champ */
.rdv-help{
  margin-top:.25rem;
  font-size:.875rem;
  color:var(--rdv-sub);
}

/* === SUPPRESSION des bordures rouges par défaut === */
/* Retire toute mise en forme "invalid" native (Chrome/Safari/Firefox) */
.rdv-input:invalid,
.rdv-text:invalid,
.rdv-input:-moz-ui-invalid,
.rdv-text:-moz-ui-invalid,
.rdv-input:user-invalid,
.rdv-text:user-invalid{
  border-color: var(--rdv-br) !important;
  box-shadow: none !important;
  outline: none !important;
}
/* Conserve l’état neutre si le champ est vide */
.rdv-input:placeholder-shown:invalid,
.rdv-text:placeholder-shown:invalid{
  border-color: var(--rdv-br) !important;
  box-shadow: none !important;
}
/* (Remplace l’ancienne règle qui forçait le rouge) */
.rdv-input:invalid[required],
.rdv-text:invalid[required]{ 
  border-color: var(--rdv-br) !important;
}

/* === Bouton === */
.rdv-btn{
  grid-column:1 / -1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  padding:.75rem 1.25rem;
  border:1px solid transparent;
  border-radius:12px;
  background:#2563eb;             /* blue-600 */
  color:#fff;
  font-weight:600;
  line-height:1.2;
  cursor:pointer;
  transition:transform .06s ease, box-shadow .15s ease, background-color .15s ease;
  box-shadow:0 8px 18px rgba(37,99,235,.18);
}
.rdv-btn:hover{ background:#1d4ed8; }          /* hover:blue-700 */
.rdv-btn:active{ transform:translateY(1px); }
.rdv-btn:disabled{
  opacity:.6;
  cursor:not-allowed;
  box-shadow:none;
}

/* === Petites améliorations d’accessibilité === */
@media (prefers-reduced-motion: reduce){
  .rdv-input,.rdv-text,.rdv-btn{ transition:none !important; }
}

/* === Compat dark (optionnel) === */
.dark :root{
  --rdv-card:#0b1220;
  --rdv-br:#1f2937;
  --rdv-txt:#e5e7eb;
  --rdv-sub:#9ca3af;
}

.rdv-error {
  border: 2px solid #e63946;
  background: #fff5f5;
}

.rdv-error-msg {
  color: #e63946;
  font-size: 0.85em;
  margin-top: 4px;
}