/* =============================================================================
   Tulipe — Frontend Client (mobile-first)
   Palette : orange #E87722, navy #1B2A4A, sky #87CEEB, cream #FAF6F1
   ============================================================================= */

:root {
  --orange: #E87722;
  --orange-dark: #D06618;
  --navy: #1B2A4A;
  --sky: #87CEEB;
  --cream: #FAF6F1;
  --cream-dark: #F0EAE3;
  --success: #2E7D32;
  --warning: #F57C00;
  --danger: #C62828;
  --gray: #9E9E9E;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --max-w: 480px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--cream);
  color: var(--navy);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.tulipe-app {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
}

/* Header */
.tulipe-header {
  text-align: center;
  padding: 24px 0 16px;
  border-bottom: 2px solid var(--orange);
  margin-bottom: 20px;
}
.tulipe-logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--orange);
}
.tulipe-sub {
  font-size: 0.85rem;
  color: var(--navy);
  opacity: 0.7;
  margin-top: 4px;
}

/* Steps */
.tulipe-step {
  animation: fadeIn 0.3s ease;
}
.tulipe-step.hidden { display: none; }

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

.tulipe-step h2 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--navy);
}

.tulipe-help {
  font-size: 0.9rem;
  color: var(--navy);
  opacity: 0.7;
  margin-bottom: 16px;
}

/* Inputs */
.tulipe-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

input, textarea, select {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius);
  font-size: 1rem;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--orange);
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231B2A4A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

textarea {
  width: 100%;
  margin: 12px 0;
  resize: vertical;
}

/* Buttons */
.tulipe-btn {
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
  white-space: nowrap;
}
.tulipe-btn:active { transform: scale(0.98); }
.tulipe-btn--primary {
  background: var(--orange);
  color: #fff;
}
.tulipe-btn--primary:hover { background: var(--orange-dark); }
.tulipe-btn--ghost {
  background: transparent;
  color: var(--orange);
  text-decoration: underline;
  padding: 8px;
}

/* Pétales */
.petales-grid { margin-top: 16px; }
.petales-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.petales-grid.hidden { display: none; }

.petal-card {
  aspect-ratio: 1;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  text-align: center;
  padding: 8px;
  box-shadow: var(--shadow);
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
}
.petal-card.active {
  opacity: 1;
  transform: scale(1.05);
  border: 3px solid var(--navy);
}

/* Prestations */
.prestations-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.presta-card {
  background: #fff;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.presta-card:hover, .presta-card.selected {
  border-color: var(--orange);
}
.presta-card h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}
.presta-card .presta-meta {
  font-size: 0.85rem;
  color: var(--gray);
}
.presta-card .presta-price {
  float: right;
  color: var(--orange);
  font-weight: 700;
}

/* Calendrier */
.calendrier {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.cal-day--vide {
  background: transparent;
  border: none;
  cursor: default;
}
.cal-header {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  padding: 4px 0;
}
.cal-day {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  background: #fff;
  border: 2px solid transparent;
  transition: transform 0.1s;
}
.cal-day:active { transform: scale(0.95); }
.cal-day .day-num { font-weight: 700; }
.cal-day .day-label { font-size: 0.6rem; }

.cal-day--open    { background: #E8F5E9; border-color: var(--success); color: var(--success); }
.cal-day--amorce  { background: #FFF3E0; border-color: var(--warning); color: var(--warning); }
.cal-day--full    { background: #FFEBEE; border-color: var(--danger); color: var(--danger); cursor: not-allowed; }
.cal-day--occupe  { background: #FFEBEE; border-color: #B71C1C; color: #B71C1C; cursor: not-allowed; text-decoration: line-through; }
.cal-day--closed  { background: #F5F5F5; border-color: #E0E0E0; color: var(--gray); cursor: not-allowed; }
.cal-day--selected { background: var(--orange); color: #fff; border-color: var(--orange-dark); }

.legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  margin-right: 12px;
}
.legend::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 3px;
}
.legend--open::before   { background: var(--success); }
.legend--amorce::before { background: var(--warning); }
.legend--full::before   { background: var(--danger); }
.legend--occupe::before { background: #B71C1C; }
.legend--closed::before { background: var(--gray); }

.creneaux-container { margin-top: 1.5rem; padding: 1rem; background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.creneaux-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.creneau-card { padding: 0.75rem; border: 2px solid var(--success); border-radius: 8px; text-align: center; cursor: pointer; background: #E8F5E9; transition: all 0.2s; }
.creneau-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.creneau-card--occupe { background: #FFEBEE; border-color: #B71C1C; color: #B71C1C; cursor: not-allowed; text-decoration: line-through; opacity: 0.7; }
.creneau-heure { font-weight: 700; font-size: 1.1rem; }
.creneau-label { font-size: 0.75rem; color: var(--gray); }

/* Préférences */
.preference-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.preference-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #fff;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.95rem;
}
.preference-label:has(input:checked) {
  border-color: var(--orange);
  background: #FFF8F0;
}

/* Récap */
.recap-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.recap-card p { margin-bottom: 8px; }
.amorce-notice {
  background: #FFF3E0;
  color: var(--warning);
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
}
.amorce-notice.hidden { display: none; }

/* Confirmation */
.confirmation-box {
  text-align: center;
  padding: 40px 20px;
}
.confirmation-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.tulipe-status {
  font-size: 0.85rem;
  margin: 8px 0;
  min-height: 1.2em;
}
.tulipe-status.ok { color: var(--success); }
.tulipe-status.err { color: var(--danger); }

.tulipe-contact {
  margin-top: 24px;
  font-size: 0.9rem;
}
.tulipe-contact a {
  color: var(--orange);
  text-decoration: none;
  font-weight: 700;
}

/* Utilitaires */
.hidden { display: none !important; }

/* Formulaire client */
.client-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.client-form input,
.client-form select {
  width: 100%;
}

/* Navigation calendrier */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}
.cal-nav span {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
}
.cal-nav .tulipe-btn {
  padding: 8px 14px;
  font-size: 0.9rem;
}
.cal-nav .tulipe-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
