/* =====================================================
   Ateliers Manager – Module RDV Téléphoniques
===================================================== */

:root {
  --rdv-primary:   #0EA5E9;
  --rdv-primary-d: #0284C7;
  --rdv-success:   #10B981;
  --rdv-warning:   #F59E0B;
  --rdv-error:     #EF4444;
  --rdv-grey:      #6B7280;
  --rdv-light:     #F0F9FF;
  --rdv-border:    #BAE6FD;
  --rdv-card-bg:   #ffffff;
  --rdv-radius:    12px;
  --rdv-shadow:    0 4px 24px rgba(14,165,233,.12);
  --rdv-font:      -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- Wrapper ---- */
.am-rdv-wrap {
  font-family: var(--rdv-font);
  color: #1F2937;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- En-tête page ---- */
.am-rdv-header {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--rdv-primary) 0%, #0369A1 100%);
  border-radius: var(--rdv-radius);
  padding: 24px 28px;
  margin-bottom: 20px;
  color: #fff;
}
.am-rdv-header__icon  { font-size: 36px; line-height: 1; }
.am-rdv-header__title { margin: 0 0 4px; font-size: 22px; font-weight: 700; color: #fff; }
.am-rdv-header__sub   { margin: 0; font-size: 14px; opacity: .88; }

/* ---- Légende ---- */
.am-rdv-legend {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--rdv-grey);
}
.am-rdv-legend__item  { display: flex; align-items: center; gap: 6px; }
.am-rdv-legend__dot   { width: 12px; height: 12px; border-radius: 50%; }
.am-rdv-legend__dot--free { background: var(--rdv-primary); }
.am-rdv-legend__dot--full { background: #94A3B8; }

/* ---- Calendrier ---- */
.am-rdv-calendar-wrap {
  background: var(--rdv-card-bg);
  border-radius: var(--rdv-radius);
  box-shadow: var(--rdv-shadow);
  padding: 20px;
  margin-bottom: 32px;
}
#am-rdv-calendar { min-height: 560px; }

/* Événements FullCalendar */
.am-rdv-fc-event        { padding: 2px 4px; line-height: 1.3; }
.am-rdv-fc-event__title { font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-rdv-fc-event__meta  { font-size: 11px; opacity: .85; }
.fc-event               { cursor: pointer; border-radius: 4px !important; border: none !important; }
.fc-event:hover         { filter: brightness(.92); }

/* ---- Modals ---- */
.am-rdv-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.am-rdv-overlay.open { display: flex; }

.am-rdv-modal {
  background: #fff;
  border-radius: var(--rdv-radius);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  position: relative;
  animation: rdv-slide-up .2s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.am-rdv-modal--form { max-width: 520px; }

@keyframes rdv-slide-up {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.am-rdv-modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #9CA3AF;
  line-height: 1;
  padding: 4px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.am-rdv-modal__close:hover { color: #1F2937; background: #F3F4F6; }

/* ---- Modal : header ---- */
.am-rdv-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--rdv-light);
}
.am-rdv-modal-header__icon  { font-size: 28px; }
.am-rdv-modal-header__title { margin: 0; font-size: 18px; color: var(--rdv-primary); line-height: 1.3; }

/* ---- Liste de détails ---- */
.am-rdv-detail-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.am-rdv-detail-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #F3F4F6;
  font-size: 14px;
}
.am-rdv-detail-list__label {
  min-width: 110px;
  font-weight: 600;
  color: #374151;
  flex-shrink: 0;
}
.am-rdv-modal-desc {
  background: var(--rdv-light);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.6;
}
.am-rdv-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- Formulaire ---- */
.am-rdv-form-title {
  margin: 0 0 16px;
  font-size: 18px;
  color: var(--rdv-primary);
}
.am-rdv-form-slot-info {
  background: var(--rdv-light);
  border: 1px solid var(--rdv-border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.7;
}
.am-rdv-form-slot-info strong { display: block; font-size: 15px; margin-bottom: 2px; }

.am-rdv-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.am-rdv-form-group       { margin-bottom: 16px; }
.am-rdv-form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #374151; }
.am-rdv-form-group input,
.am-rdv-form-group textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1.5px solid #D1D5DB;
  border-radius: 7px;
  font-size: 14px;
  font-family: var(--rdv-font);
  transition: border-color .2s;
  background: #fff;
}
.am-rdv-form-group input:focus,
.am-rdv-form-group textarea:focus {
  outline: none;
  border-color: var(--rdv-primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,.12);
}

.am-rdv-required { color: var(--rdv-error); }
.am-rdv-optional { font-weight: 400; color: #9CA3AF; font-size: 12px; }
.am-rdv-gdpr     { font-size: 11px; color: #9CA3AF; margin: 8px 0 16px; line-height: 1.5; }

/* ---- Boutons ---- */
.am-rdv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all .2s;
  line-height: 1.4;
  font-family: var(--rdv-font);
}
.am-rdv-btn--primary        { background: var(--rdv-primary); color: #fff; }
.am-rdv-btn--primary:hover  { background: var(--rdv-primary-d); }
.am-rdv-btn:disabled        { opacity: .55; cursor: not-allowed; }

/* ---- Notices ---- */
.am-rdv-form-notice {
  padding: 12px 14px;
  border-radius: 8px;
  margin-top: 14px;
  font-size: 14px;
  display: none;
  line-height: 1.5;
}
.am-rdv-form-notice.success { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; display: block; }
.am-rdv-form-notice.error   { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; display: block; }

.am-rdv-notice            { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin: 12px 0; }
.am-rdv-notice--error     { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }

/* ---- Tags ---- */
.am-rdv-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 6px;
}
.am-rdv-tag--full      { background: #FEF3C7; color: #92400E; }
.am-rdv-tag--cancelled { background: #F3F4F6; color: #6B7280; }

/* ---- Badge places ---- */
.am-rdv-places-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}
.am-rdv-places-badge--ok  { background: #D1FAE5; color: #065F46; }
.am-rdv-places-badge--low { background: #FEF3C7; color: #92400E; }

/* ---- Spinner ---- */
.am-rdv-spinner-wrap { display: flex; justify-content: center; padding: 32px; }
.am-rdv-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid rgba(14,165,233,.2);
  border-top-color: var(--rdv-primary);
  border-radius: 50%;
  animation: rdv-spin .7s linear infinite;
}
.am-rdv-spinner--inline {
  width: 14px;
  height: 14px;
  border-width: 2px;
  border-color: rgba(255,255,255,.4);
  border-top-color: #fff;
  vertical-align: middle;
}
@keyframes rdv-spin { to { transform: rotate(360deg); } }

/* ---- Formulaire standalone (shortcode direct) ---- */
.am-rdv-form-standalone {
  max-width: 560px;
  margin: 0 auto;
  background: var(--rdv-card-bg);
  border-radius: var(--rdv-radius);
  box-shadow: var(--rdv-shadow);
  padding: 32px;
}
.am-rdv-form-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--rdv-light);
}
.am-rdv-form-header__icon  { font-size: 30px; }
.am-rdv-form-header__title { margin: 0 0 4px; font-size: 18px; color: var(--rdv-primary); }
.am-rdv-form-header__meta  { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--rdv-grey); }
.am-rdv-form-desc {
  background: var(--rdv-light);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ---- Body lock ---- */
body.am-rdv-modal-open { overflow: hidden; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .am-rdv-form-row       { grid-template-columns: 1fr; }
  .am-rdv-header         { flex-direction: column; text-align: center; gap: 10px; }
  .am-rdv-modal          { padding: 20px; }
  .am-rdv-detail-list__label { min-width: 90px; }
}
