/* ============================================================================
 * Module : artisan/styles/pages/nouveau.css
 * Rôle   : Styles spécifiques à la page de création (3 étapes).
 *          - Tabs Manuel/Messagerie
 *          - Stepper visuel (3 dots + barres progression)
 *          - Type toggle Particulier/Entreprise
 *          - Grid champs client + mentions 2026
 *          - Catalogue rapide (boutons pills)
 *          - Grille lignes (7 colonnes : desc/qté/unité/prix/tva/total/×)
 *          - Bloc TVA défaut + totaux live
 *          - Récap + bouton sauvegarder
 *
 * Dépend de : tokens.css + dashboard-shell.css
 * Utilisé par : /artisan/nouveau.html
 * ============================================================================ */

.nouveau-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 820px;
}

/* ─── Tabs principal ─────────────────────────────────────────── */
.nv-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.nv-tab {
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200);
  background: white;
  color: var(--gray-600);
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: .88rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.nv-tab:hover { color: var(--brand-dark); }
.nv-tab.active {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

/* ─── Panel Bot ──────────────────────────────────────────────── */
.nv-panel-bot {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
  max-width: 560px;
  margin: 0 auto;
}
.bot-icon { font-size: 3rem; margin-bottom: 16px; }
.bot-title {
  font-family: var(--font-heading);
  font-weight: var(--weight-black);
  color: var(--brand-dark);
  font-size: 1.5rem;
  margin: 0 0 10px;
}
.bot-hint {
  color: var(--gray-500);
  font-size: .93rem;
  line-height: 1.7;
  margin: 0 0 28px;
}
.bot-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-telegram-large,
.btn-whatsapp-large {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: .9rem;
  text-decoration: none;
  color: white;
  border: none;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}
.btn-telegram-large { background: #229ED9; }
.btn-telegram-large:hover { background: #1B8AC2; }
.btn-whatsapp-large { background: #25D366; }
.btn-whatsapp-large:hover { background: #1FB955; }

.bot-footer {
  color: var(--gray-400);
  font-size: .76rem;
  margin: 20px 0 0;
}
.bot-footer a:not(.btn) { color: var(--brand); text-decoration: underline; }

/* ─── Panel Manuel ───────────────────────────────────────────── */
.nv-panel-manuel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ─── Stepper ────────────────────────────────────────────────── */
.nv-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nv-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nv-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  font-size: .8rem;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.nv-step.active .nv-step-dot,
.nv-step.done .nv-step-dot {
  background: var(--brand);
  color: white;
}

.nv-step-label {
  font-size: .82rem;
  font-weight: var(--weight-semibold);
  color: var(--gray-400);
  transition: color var(--transition-fast);
}
.nv-step.active .nv-step-label,
.nv-step.done .nv-step-label {
  color: var(--brand);
}

.nv-step-bar {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
}

.nv-step-prog {
  height: 100%;
  width: 0%;
  background: var(--brand);
  transition: width .4s ease;
}

/* ─── Carte d'étape ─────────────────────────────────────────── */
.nv-step-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nv-step-card-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nv-section-title {
  font-family: var(--font-heading);
  font-weight: var(--weight-black);
  color: var(--brand-dark);
  font-size: 1.1rem;
  margin: 0;
}

.nv-section-hint {
  font-size: .8rem;
  color: var(--gray-400);
  margin: 4px 0 16px;
}

/* ─── Type toggle (Part / Pro) ──────────────────────────────── */
.nv-type-toggle {
  display: inline-flex;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
}
.nv-type-btn {
  padding: 8px 20px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--gray-500);
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: .85rem;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.nv-type-btn.active {
  background: var(--brand);
  color: white;
}

/* ─── Grille champs client ──────────────────────────────────── */
.nv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.nv-grid .field.span-2 {
  grid-column: 1 / -1;
}

.nv-select {
  padding: 10px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  outline: none;
  background: white;
  cursor: pointer;
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%23065F46" stroke-width="2.5"><polyline points="6 9 12 15 18 9"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.nv-select:focus { border-color: var(--brand-mid); }

/* ─── Mentions 2026 ──────────────────────────────────────────── */
.nv-mentions {
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}

.nv-mentions-title {
  font-size: .75rem;
  font-weight: var(--weight-bold);
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0 0 12px;
}

/* ─── Actions étape ──────────────────────────────────────────── */
.nv-step-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.nv-actions-right { justify-content: flex-end; }
.nv-actions-left  { justify-content: flex-start; }

.btn-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  font-size: .93rem;
}

.btn-save { background: var(--brand-dark); }
.btn-save:hover { background: #0a3d28; }

/* ─── Résumé client ──────────────────────────────────────────── */
.nv-client-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px !important;
}
.nv-cs-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nv-cs-icon {
  width: 36px;
  height: 36px;
  background: var(--brand-50);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.nv-cs-text {
  font-size: .88rem;
  color: var(--gray-500);
}

/* ─── Catalogue rapide ──────────────────────────────────────── */
.nv-catalogue {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.nv-cat-btn {
  padding: 7px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  color: var(--gray-700);
  font-size: .82rem;
  font-weight: var(--weight-semibold);
  cursor: pointer;
  font-family: inherit;
  transition: border-color var(--transition-fast);
}
.nv-cat-btn:hover { border-color: var(--brand-mid); }

/* ─── Lignes ────────────────────────────────────────────────── */
.nv-lines-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.nv-lines-grid-head,
.nv-line {
  display: grid;
  grid-template-columns: 1fr 80px 90px 100px 90px 100px 36px;
  gap: 8px;
  align-items: center;
}

.nv-lines-grid-head {
  margin-bottom: 8px;
  padding: 0 4px;
}
.nv-lines-grid-head span {
  font-size: .72rem;
  font-weight: var(--weight-semibold);
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.nv-lines-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 48px;
}

.nv-line input,
.nv-line select {
  padding: 9px 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .85rem;
  outline: none;
  background: white;
  width: 100%;
}
.nv-line input:focus,
.nv-line select:focus { border-color: var(--brand-mid); }

.nv-line .line-total {
  text-align: right;
  font-weight: var(--weight-bold);
  color: var(--brand-dark);
  font-size: .9rem;
  padding: 9px 10px;
}

.nv-line-remove {
  width: 36px;
  height: 36px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: .9rem;
  color: var(--gray-500);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.nv-line-remove:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

.nv-lines-empty {
  text-align: center;
  padding: 20px;
  color: var(--gray-400);
  font-style: italic;
  font-size: .88rem;
}

/* ─── Totaux ─────────────────────────────────────────────────── */
.nv-totals-block {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
}

.nv-default-tva {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.nv-default-tva label {
  font-size: .82rem;
  font-weight: var(--weight-semibold);
  color: var(--gray-600);
}
.nv-default-tva-hint {
  font-size: .72rem;
  color: var(--gray-400);
}

.nv-totals {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.nv-totals-row {
  display: flex;
  gap: 16px;
  font-size: .88rem;
  color: var(--gray-500);
}
.nv-totals-row span:last-child {
  font-weight: var(--weight-semibold);
  color: var(--gray-800);
  min-width: 90px;
  text-align: right;
}

.nv-totals-final {
  font-size: 1rem;
  color: var(--brand-dark);
  border-top: 1.5px solid var(--gray-200);
  padding-top: 8px;
  margin-top: 4px;
}
.nv-totals-final span {
  font-weight: var(--weight-bold);
}
.nv-totals-final span:last-child {
  font-weight: var(--weight-black);
  color: var(--brand-dark);
}

/* ─── Récapitulatif ──────────────────────────────────────────── */
.nv-recap-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.nv-recap-icon {
  width: 44px;
  height: 44px;
  background: var(--brand-50);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.nv-recap-title { margin: 0; }
.nv-recap-ref {
  font-size: .8rem;
  color: var(--gray-400);
  margin: 2px 0 0;
}

.nv-recap-block {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.nv-recap-label {
  font-size: .75rem;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-400);
  margin: 0 0 8px;
}
.nv-recap-client {
  font-weight: var(--weight-bold);
  color: var(--gray-900);
  font-size: .95rem;
  margin: 0;
}
.nv-recap-contact,
.nv-recap-adresse {
  font-size: .85rem;
  color: var(--gray-500);
  margin: 3px 0 0;
}

.nv-recap-lines {
  margin: 0 0 16px;
}

.recap-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: .88rem;
}
.recap-line:last-child { border-bottom: none; }
.recap-line .rl-desc {
  flex: 1;
  color: var(--gray-700);
}
.recap-line .rl-total {
  font-weight: var(--weight-bold);
  color: var(--brand-dark);
  white-space: nowrap;
}

.nv-recap-totals {
  padding-top: 14px;
  border-top: 1.5px solid var(--gray-100);
}

/* ─── Conditions ─────────────────────────────────────────────── */
.nv-conditions {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--gray-100);
}
.nv-conditions label {
  font-size: .78rem;
  font-weight: var(--weight-semibold);
  color: var(--gray-600);
  display: block;
  margin-bottom: 6px;
}
.nv-conditions textarea {
  width: 100%;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: .88rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
}
.nv-conditions textarea:focus { border-color: var(--brand-mid); }
.nv-conditions-hint {
  font-size: .72rem;
  color: var(--gray-400);
  margin: 4px 0 0;
}

/* ─── Save card ──────────────────────────────────────────────── */
.nv-save-card { display: flex; flex-direction: column; gap: 12px; }
.nv-save-hint {
  font-size: .78rem;
  color: var(--gray-400);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

/* Override `.form-feedback` du shell : centré sur cette page */
.nv-save-card .form-feedback { text-align: center; }

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nv-grid { grid-template-columns: 1fr; }
  .nv-grid .field.span-2 { grid-column: auto; }
  .nv-lines-grid-head { display: none; }
  .nv-line {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-sm);
  }
  .nv-line input,
  .nv-line select { font-size: .9rem; }
  .nv-line .line-total {
    grid-column: 1 / -1;
    text-align: right;
    padding: 4px 0;
  }
  .nv-line-remove {
    grid-column: 1 / -1;
    width: auto;
    height: 36px;
  }
  .nv-stepper { gap: 4px; }
  .nv-step-label { display: none; }
}
