/**
 * IGEVENTS - NOUVEAU CALENDRIER PUBLIC & FORMULAIRE DE PROJET
 * Design Cosy, Haut de Gamme, Boîtier Élégant & Cases Entièrement Colorées
 */

:root {
  --cosy-bg: #F8F2EA;
  --cosy-card: #FFFCF8;
  --cosy-gold: #B59A7C;
  --cosy-gold-hover: #9E8266;
  --cosy-taupe: #6D5847;
  --cosy-taupe-light: #8E7A6B;
  --sage-bg: #DCE8D6;
  --sage-border: #C8D8C0;
  --sage-text: #45644C;
  --rose-bg: #E8C6C2;
  --rose-border: #D9ABA5;
  --rose-text: #884B4B;
  --past-bg: #F2EFEB;
  --past-border: #E8E3DC;
  --past-text: #A99F96;
}

/* Section de réservation */
.reservation-section {
  background-color: var(--cosy-bg);
  padding: 90px 5% 100px;
  position: relative;
  overflow: hidden;
}

.reservation-section::before {
  content: "";
  position: absolute;
  top: -150px;
  right: -100px;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(181, 154, 124, 0.08) 0%, rgba(248, 242, 234, 0) 70%);
  pointer-events: none;
}

.reservation-container {
  max-width: 980px;
  margin: 0 auto;
}

/* En-tête calendrier public */
.reservation-header {
  text-align: center;
  margin-bottom: 35px;
}

.reservation-brand-tag {
  display: inline-block;
  font-size: 0.82rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cosy-gold);
  font-weight: 600;
  margin-bottom: 12px;
}

.reservation-title {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  color: var(--cosy-taupe);
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.25;
}

.reservation-subtitle {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--cosy-taupe-light);
  max-width: 550px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Grande Carte Blanche Cosy */
.calendar-card {
  background: var(--cosy-card);
  border: 1px solid rgba(181, 154, 124, 0.22);
  border-radius: 24px;
  box-shadow: 0 15px 45px rgba(109, 88, 71, 0.07), 0 2px 8px rgba(109, 88, 71, 0.04);
  padding: 40px 45px;
  transition: box-shadow 0.3s ease;
}

/* Barre de navigation du mois */
.calendar-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(181, 154, 124, 0.15);
}

.calendar-current-month {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--cosy-taupe);
  text-transform: capitalize;
  letter-spacing: 0.5px;
}

.calendar-nav-actions {
  display: flex;
  gap: 12px;
}

.calendar-nav-btn {
  background: #FFFFFF;
  border: 1px solid rgba(181, 154, 124, 0.3);
  color: var(--cosy-taupe);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.calendar-nav-btn:hover:not(:disabled) {
  background: var(--cosy-gold);
  border-color: var(--cosy-gold);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(181, 154, 124, 0.3);
}

.calendar-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.calendar-nav-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Jours de la semaine */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  text-align: center;
  margin-bottom: 12px;
}

.calendar-weekday {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cosy-taupe-light);
  padding: 8px 0;
}

/* Grille des journées */
.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

/* Cases des journées - Spécification stricte Section 7 */
.calendar-day-cell {
  position: relative;
  aspect-ratio: 1.15;
  min-height: 52px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding: 4px;
  user-select: none;
  background: transparent;
  outline: none;
}

.calendar-day-cell .day-number {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.3px;
  transition: transform 0.2s ease;
}

.calendar-day-cell .day-status-label {
  font-size: 0.65rem;
  margin-top: 3px;
  font-weight: 500;
  letter-spacing: 0.2px;
  opacity: 0.9;
}

/* 1. DATE DISPONIBLE : Fond vert sauge pastel */
.calendar-day-cell.is-available {
  background-color: var(--sage-bg) !important;
  border-color: var(--sage-border) !important;
  color: var(--sage-text) !important;
}

.calendar-day-cell.is-available:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(69, 100, 76, 0.15);
  border-color: #B5CBB0 !important;
}

/* 2. DATE INDISPONIBLE : Fond vieux rose pastel */
.calendar-day-cell.is-unavailable {
  background-color: var(--rose-bg) !important;
  border-color: var(--rose-border) !important;
  color: var(--rose-text) !important;
  cursor: pointer;
}

.calendar-day-cell.is-unavailable:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(136, 75, 75, 0.12);
}

/* 3. DATE SÉLECTIONNÉE : Fond doré champagne */
.calendar-day-cell.is-selected {
  background-color: var(--cosy-gold) !important;
  border-color: #8E7356 !important;
  color: #FFFFFF !important;
  transform: scale(1.04);
  box-shadow: 0 8px 22px rgba(181, 154, 124, 0.45);
  z-index: 2;
}

.calendar-day-cell.is-selected .day-number {
  color: #FFFFFF !important;
  font-weight: 700;
}

.calendar-day-cell.is-selected .day-status-label {
  color: rgba(255, 255, 255, 0.95) !important;
}

/* 4. DATE PASSÉE : Gris-beige très clair */
.calendar-day-cell.is-past {
  background-color: var(--past-bg) !important;
  border-color: var(--past-border) !important;
  color: var(--past-text) !important;
  cursor: not-allowed;
  opacity: 0.65;
}

.calendar-day-cell.is-past:hover {
  transform: none;
  box-shadow: none;
}

/* Cases vides d'alignement */
.calendar-day-cell.is-empty {
  visibility: hidden;
  pointer-events: none;
}

/* SUPPRESSION STRICTE DE TOUT PETIT POINT */
.calendar-day-cell::after,
.calendar-day-cell::before {
  display: none !important;
}

/* Légende Élégante */
.calendar-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid rgba(181, 154, 124, 0.15);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--cosy-taupe);
  font-weight: 500;
}

.legend-swatch {
  width: 22px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}

.legend-swatch.available {
  background-color: var(--sage-bg);
  border: 1px solid var(--sage-border);
}

.legend-swatch.unavailable {
  background-color: var(--rose-bg);
  border: 1px solid var(--rose-border);
}

/* Carte d'interaction sous le calendrier */
.calendar-feedback-wrapper {
  margin-top: 25px;
  transition: all 0.35s ease;
}

.calendar-action-card {
  background: #FFFFFF;
  border: 1px solid rgba(181, 154, 124, 0.25);
  border-radius: 20px;
  padding: 24px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 30px rgba(109, 88, 71, 0.08);
  animation: feedbackSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes feedbackSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.calendar-action-card.available-feedback {
  border-left: 5px solid var(--cosy-gold);
}

.calendar-action-card.unavailable-feedback {
  border-left: 5px solid var(--rose-text);
  background: #FFFDFC;
}

.action-card-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.action-card-date {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--cosy-taupe);
  text-transform: capitalize;
}

.action-card-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
}

.action-card-status.text-available {
  color: var(--sage-text);
  font-weight: 600;
}

.action-card-status.text-unavailable {
  color: var(--rose-text);
  font-weight: 500;
}

/* Bouton de demande chic */
.btn-calendar-request {
  background: var(--cosy-gold);
  color: #FFFFFF !important;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  padding: 13px 28px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(181, 154, 124, 0.35);
  text-decoration: none;
  white-space: nowrap;
}

.btn-calendar-request:hover {
  background: var(--cosy-taupe);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(109, 88, 71, 0.25);
}

.btn-calendar-request svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

.btn-calendar-request:hover svg {
  transform: translateX(3px);
}

/* ----------------------------------------------------
   FORMULAIRE DEMANDE DE PROJET CONNECTÉ
   ---------------------------------------------------- */
.project-form-section {
  background: #FFFFFF;
  padding: 80px 5% 100px;
}

.project-form-wrapper {
  background: var(--cosy-card);
  border: 1px solid rgba(181, 154, 124, 0.22);
  border-radius: 24px;
  max-width: 980px;
  margin: 0 auto;
  padding: 50px 55px;
  box-shadow: 0 20px 50px rgba(109, 88, 71, 0.08);
}

.form-header-box {
  text-align: center;
  margin-bottom: 40px;
}

.form-header-box h2 {
  font-family: var(--font-heading);
  font-size: 2.3rem;
  color: var(--cosy-taupe);
  margin-bottom: 10px;
}

.form-header-box p {
  color: var(--cosy-taupe-light);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

.form-selected-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #F4EFEA;
  border: 1px solid var(--cosy-gold);
  color: var(--cosy-taupe);
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.95rem;
  margin-top: 15px;
}

.project-form-container {
  display: flex;
  flex-direction: column;
  gap: 35px;
}

.form-block {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-block-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--cosy-gold);
  border-bottom: 1px solid rgba(181, 154, 124, 0.25);
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px 20px;
}

.form-group-cosy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group-cosy.full-width {
  grid-column: 1 / -1;
}

.form-group-cosy label {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--cosy-taupe);
}

.form-group-cosy label .req {
  color: #B34444;
}

.form-input-cosy {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--cosy-taupe);
  background: #FFFFFF;
  border: 1px solid rgba(181, 154, 124, 0.35);
  border-radius: 10px;
  padding: 12px 16px;
  transition: all 0.25s ease;
  outline: none;
}

.form-input-cosy:focus {
  border-color: var(--cosy-gold);
  box-shadow: 0 0 0 3px rgba(181, 154, 124, 0.2);
  background: #FFFDFB;
}

.form-input-cosy.date-highlight {
  border-color: var(--cosy-gold);
  background: #FCF9F5;
  font-weight: 600;
}

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

/* Radio buttons budget */
.budget-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.budget-option {
  position: relative;
}

.budget-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.budget-option label {
  display: block;
  text-align: center;
  padding: 12px 14px;
  border: 1px solid rgba(181, 154, 124, 0.35);
  border-radius: 10px;
  font-size: 0.92rem;
  color: var(--cosy-taupe);
  cursor: pointer;
  transition: all 0.2s ease;
  background: #FFFFFF;
}

.budget-option input[type="radio"]:checked + label {
  background: var(--cosy-gold);
  border-color: var(--cosy-gold);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(181, 154, 124, 0.3);
}

/* Bloc d'avertissement bienveillant Section 9 */
.form-notice-box {
  background: rgba(181, 154, 124, 0.08);
  border: 1px dashed rgba(181, 154, 124, 0.4);
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: var(--cosy-taupe);
  font-size: 0.92rem;
  line-height: 1.5;
}

.form-notice-box svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: var(--cosy-gold);
  margin-top: 2px;
}

/* Bouton Soumettre */
.form-submit-box {
  display: flex;
  justify-content: center;
  margin-top: 15px;
}

.btn-submit-cosy {
  background: var(--cosy-gold);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  padding: 16px 45px;
  border-radius: 35px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(181, 154, 124, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.btn-submit-cosy:hover:not(:disabled) {
  background: var(--cosy-taupe);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(109, 88, 71, 0.25);
}

.btn-submit-cosy:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* Message de succès post-soumission Section 9 */
.form-success-card {
  text-align: center;
  padding: 50px 30px;
  animation: feedbackSlideIn 0.4s ease forwards;
}

.success-icon-badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--sage-bg);
  color: var(--sage-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 24px;
  border: 2px solid var(--sage-border);
}

.form-success-card h3 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--cosy-taupe);
  margin-bottom: 16px;
}

.form-success-card .success-main-text {
  font-size: 1.15rem;
  color: var(--cosy-taupe);
  max-width: 650px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

.form-success-card .success-disclaimer {
  font-size: 0.95rem;
  color: var(--cosy-taupe-light);
  font-style: italic;
  max-width: 580px;
  margin: 0 auto 30px;
  line-height: 1.5;
  border-top: 1px solid rgba(181, 154, 124, 0.2);
  padding-top: 16px;
}

.btn-reset-form {
  background: transparent;
  color: var(--cosy-gold);
  border: 1px solid var(--cosy-gold);
  padding: 10px 24px;
  border-radius: 25px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reset-form:hover {
  background: var(--cosy-gold);
  color: #FFFFFF;
}

/* Spinner de chargement */
.cosy-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .reservation-section {
    padding: 60px 4% 70px;
  }
  .calendar-card {
    padding: 24px 18px;
    border-radius: 18px;
  }
  .reservation-title {
    font-size: 2rem;
  }
  .calendar-current-month {
    font-size: 1.35rem;
  }
  .calendar-weekdays {
    gap: 4px;
  }
  .calendar-weekday {
    font-size: 0.72rem;
    padding: 4px 0;
  }
  .calendar-days-grid {
    gap: 5px;
  }
  .calendar-day-cell {
    min-height: 44px;
    border-radius: 10px;
  }
  .calendar-day-cell .day-number {
    font-size: 0.92rem;
  }
  .calendar-day-cell .day-status-label {
    display: none; /* cache le micro-label sur mobile pour aérer */
  }
  .calendar-action-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
  }
  .btn-calendar-request {
    width: 100%;
    justify-content: center;
  }
  .calendar-legend {
    gap: 16px;
    font-size: 0.82rem;
  }
  .project-form-wrapper {
    padding: 30px 20px;
    border-radius: 18px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .budget-selector {
    grid-template-columns: 1fr;
  }
}
