/* ============================================================
   dish-create.css — Wizard "Nouveau plat" en 3 étapes
   DA premium : colonne ~560px centrée, header arrondi, thème clair
   Daltonisme : jamais couleur seule, toujours un libellé textuel
   ============================================================ */

/* ── Overlay fond ────────────────────────────────────────────── */
.dc-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: #dde5f4;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 16px 60px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.dc-overlay[data-active="true"] {
  opacity: 1;
}

/* ── Shell — carte centrale compacte ─────────────────────────── */
.dc-shell {
  width: 100%;
  max-width: 560px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 8px 40px rgba(16, 52, 87, 0.14),
    0 2px 8px rgba(16, 52, 87, 0.06);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

/* ── Header & stepper (coins hauts arrondis via le shell) ────── */
.dc-header {
  background: linear-gradient(135deg, #073CBF 0%, #051040 100%);
  padding: 20px 22px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.dc-header-left {
  flex: 0 0 auto;
}

.dc-header-title {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* Stepper */
.dc-stepper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.dc-step {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.45;
}

.dc-step--active { opacity: 1; }
.dc-step--done   { opacity: 0.72; }

.dc-step-num {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dc-step--active .dc-step-num {
  background: #fff;
  color: #073CBF;
}

.dc-step--done .dc-step-num {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.dc-step-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

.dc-step-sep {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.22);
  padding: 0 8px;
  flex-shrink: 0;
}

/* Bouton fermer */
.dc-header-close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s ease;
}

.dc-header-close:hover {
  background: rgba(255, 255, 255, 0.26);
}

/* ── Body — fond blanc, zéro gap (card + footer collés) ──────── */
.dc-body {
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px 20px 0;
}

/* ── Bandeau marge (étapes 2 & 3) ───────────────────────────── */
.dc-bandeau {
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #073CBF 0%, #051040 100%);
  margin-bottom: 16px;
}

.dc-bandeau-pct {
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.dc-bandeau-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

.dc-bandeau--good   .dc-bandeau-label { color: #7de7b1; }
.dc-bandeau--alert  .dc-bandeau-label { color: #fbbf68; }
.dc-bandeau--danger .dc-bandeau-label { color: #f88080; }

.dc-bandeau-detail {
  font-size: 0.71rem;
  color: rgba(255, 255, 255, 0.5);
  margin-left: auto;
  white-space: nowrap;
}

/* ── Carte formulaire (coins hauts arrondis, ouverte en bas vers le footer) */
.dc-card {
  background: #f7faff;
  border-radius: 20px 20px 0 0;
  border: 1.5px solid rgba(17, 65, 108, 0.09);
  border-bottom: none;
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Footer attaché au bas de la carte ───────────────────────── */
.dc-footer {
  background: #f7faff;
  border: 1.5px solid rgba(17, 65, 108, 0.09);
  border-top: none;
  border-radius: 0 0 20px 20px;
  padding: 14px 22px 22px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 0;
}

/* ── Champs de formulaire ────────────────────────────────────── */
.dc-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dc-field-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #5a7099;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dc-field-input {
  padding: 11px 14px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  font-size: 0.93rem;
  color: #0d1b36;
  background: #f4f7fc;
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  width: 100%;
  box-sizing: border-box;
}

.dc-field-input:hover {
  background: #eef3fb;
}

.dc-field-input:focus {
  background: #fff;
  border-color: #073CBF;
  box-shadow: 0 0 0 3px rgba(7, 60, 191, 0.10);
}

.dc-field-input--error {
  border-color: #d02020 !important;
  box-shadow: 0 0 0 3px rgba(208, 32, 32, 0.08) !important;
}

.dc-field-error {
  font-size: 0.74rem;
  color: #d02020;
  font-weight: 600;
}

/* ── Chips catégorie ─────────────────────────────────────────── */
.dc-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.dc-chip {
  padding: 5px 13px;
  border-radius: 999px;
  border: 1.5px solid rgba(17, 65, 108, 0.13);
  background: #eef3fb;
  color: #4a6080;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease, color 0.1s ease;
}

.dc-chip:hover {
  background: rgba(7, 60, 191, 0.07);
}

.dc-chip--active {
  background: rgba(7, 60, 191, 0.10);
  border-color: rgba(7, 60, 191, 0.28);
  color: #073CBF;
  font-weight: 700;
}

.dc-chip--new {
  border-style: dashed;
  color: #073CBF;
  background: transparent;
}

.dc-chip--custom {
  background: rgba(7, 60, 191, 0.10);
  border-color: rgba(7, 60, 191, 0.28);
  color: #073CBF;
}

.dc-new-cat-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dc-new-cat-input {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1.5px solid #073CBF;
  font-size: 0.8rem;
  outline: none;
  background: #fff;
  color: #0d1b36;
  min-width: 150px;
}

/* ── Liste ingrédients (étape 2) ─────────────────────────────── */
.dc-ing-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dc-ing-empty {
  font-size: 0.84rem;
  color: #5a7099;
  margin: 0;
  padding: 10px 0 4px;
  text-align: center;
}

.dc-ing-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid rgba(17, 65, 108, 0.08);
}

.dc-ing-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dc-ing-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: #0d1b36;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-ing-supplier {
  font-size: 0.68rem;
  color: #5a7099;
}

.dc-ing-qty-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.dc-ing-qty {
  width: 60px;
  padding: 5px 7px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  font-size: 0.84rem;
  text-align: right;
  background: #f4f7fc;
  outline: none;
  color: #0d1b36;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.dc-ing-qty:focus {
  background: #fff;
  border-color: #073CBF;
}

.dc-ing-unit {
  padding: 5px 5px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  font-size: 0.8rem;
  background: #f4f7fc;
  color: #0d1b36;
  outline: none;
  cursor: pointer;
}

.dc-ing-cost {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0d1b36;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 68px;
  text-align: right;
}

.dc-ing-remove {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: none;
  background: rgba(208, 32, 32, 0.07);
  color: #d02020;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.1s ease;
}

.dc-ing-remove:hover {
  background: rgba(208, 32, 32, 0.16);
}

.dc-btn--add {
  margin-top: 4px;
  align-self: flex-start;
}

/* ── Récap (étape 3) ─────────────────────────────────────────── */
.dc-recap-dish {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(17, 65, 108, 0.07);
}

.dc-recap-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0d1b36;
  margin: 0 0 3px;
  letter-spacing: -0.02em;
}

.dc-recap-meta {
  font-size: 0.8rem;
  color: #5a7099;
  margin: 0;
}

.dc-recap-ing-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5a7099;
  margin: 0 0 8px;
}

.dc-recap-ing-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.dc-recap-ing-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(17, 65, 108, 0.07);
}

.dc-recap-ing-name {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: #0d1b36;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-recap-ing-qty {
  font-size: 0.76rem;
  color: #5a7099;
  white-space: nowrap;
  flex-shrink: 0;
}

.dc-recap-ing-cost {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0d1b36;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 60px;
  text-align: right;
}

/* ── Boutons ─────────────────────────────────────────────────── */
.dc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  min-height: 44px;
  border-radius: 14px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: box-shadow 0.12s ease, transform 0.1s ease, background 0.1s ease;
  letter-spacing: 0.01em;
}

.dc-btn--primary {
  background: linear-gradient(135deg, #073CBF 0%, #0a52e8 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(7, 60, 191, 0.30);
}

.dc-btn--primary:hover {
  box-shadow: 0 6px 20px rgba(7, 60, 191, 0.44);
  transform: translateY(-1px);
}

.dc-btn--ghost {
  background: transparent;
  color: #5a7099;
  border: 1.5px solid rgba(17, 65, 108, 0.13);
}

.dc-btn--ghost:hover {
  background: rgba(17, 65, 108, 0.05);
}

.dc-btn--outline {
  background: rgba(7, 60, 191, 0.06);
  color: #073CBF;
  border: 1.5px solid rgba(7, 60, 191, 0.2);
}

.dc-btn--outline:hover {
  background: rgba(7, 60, 191, 0.11);
}

.dc-btn--sm {
  min-height: 32px;
  padding: 0 13px;
  font-size: 0.78rem;
  border-radius: 999px;
}

/* ── Host du comparateur produit ─────────────────────────────── */
.dc-panel-host {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dc-panel-host:not([hidden]) {
  pointer-events: all;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .dc-overlay {
    padding: 0;
    align-items: flex-start;
  }

  .dc-shell {
    border-radius: 0;
    box-shadow: none;
    min-height: 100dvh;
  }

  .dc-header {
    padding: 14px 16px;
    gap: 10px;
  }

  .dc-step-label {
    display: none;
  }

  .dc-body {
    padding: 14px 14px 0;
  }

  .dc-card {
    padding: 16px 16px 14px;
  }

  .dc-footer {
    padding: 12px 14px 20px;
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .dc-btn {
    width: 100%;
  }

  .dc-ing-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .dc-bandeau-detail {
    display: none;
  }
}
