/* ── GEVREK ALTIN — Styles ── */

:root {
  --navy:  #1b3a5c;
  --cyan:  #06b6d4;
  --gold:  #c8956c;
  --orange:#f97316;
  --bg:    #f8f6f2;
  --card:  #ffffff;
  --border:#e2ddd6;
  --text:  #1a1a1a;
  --muted: #7a7068;
  --violet:#6A1B9A;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── HEADER ── */
header {
  background: var(--navy);
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.2);
}
.logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 3px;
  text-transform: uppercase;
}
.logo span { color: white; font-weight: 300; }

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-user {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: white;
  font-weight: 400;
  letter-spacing: 0.5px;
}
.btn-logout-header {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.btn-logout-header:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  border-color: rgba(255,255,255,0.4);
}

/* ── LOADING OVERLAY ── */
#loadingOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
#loadingOverlay.active { display: flex; }
.spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── LAYOUT (single column) ── */
.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ── PRIX SPOT ── */
.spot-bar {
  background: linear-gradient(135deg, #fff8e1, #fffde7);
  border: 1px solid #f0d060;
  border-radius: 12px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.spot-bar label {
  font-size: 13px;
  font-weight: 500;
  color: #92400e;
  white-space: nowrap;
}
.spot-input-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: white;
  border: 2px solid #f0d060;
  border-radius: 8px;
  padding: 2px 6px;
}
.spot-input-group:focus-within { border-color: var(--orange); }
.spot-currency {
  font-size: 16px;
  font-weight: 600;
  color: #92400e;
  padding: 0 2px;
}
.spot-input-group .spot-input {
  width: 100px;
  padding: 6px 4px;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #92400e;
  background: transparent;
  text-align: center;
  outline: none;
}
.spot-label {
  font-size: 11px;
  color: #a16207;
  font-weight: 500;
  padding-right: 4px;
}
.spot-bar .btn-spot {
  background: var(--gold);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}
.spot-bar .btn-spot:hover { background: #b8845c; transform: scale(1.05); }
.spot-note { font-size: 12px; color: #a16207; font-style: italic; flex: 1; min-width: 120px; }

/* ── FORMULAIRE ── */
.form-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  overflow: hidden;
}
.form-header {
  background: var(--navy);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.form-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 400;
  color: white;
  letter-spacing: 1px;
}
.form-header .dot {
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
}
.form-body { padding: 28px; }

/* CODE PREVIEW */
.code-preview {
  background: var(--navy);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 28px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 1px;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.code-preview .segment { color: white; }
.code-preview .sep { color: #4a6a8a; }
.code-preview.empty { color: #4a6a8a; font-style: italic; font-family: 'DM Sans', sans-serif; font-size: 12px; }

/* SECTIONS */
.section-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.form-section { margin-bottom: 28px; }

/* GRILLE CHAMPS */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* CHAMPS */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}
.field input, .field select, .field textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: white;
  transition: border-color 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(6,182,212,0.1);
}
.field textarea { resize: vertical; min-height: 70px; }

/* CHIPS SELECTOR */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  background: white;
  color: var(--muted);
  user-select: none;
}
.chip:hover { border-color: var(--cyan); color: var(--cyan); }
.chip.selected {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}
.chip.selected.gold-chip {
  background: var(--gold);
  border-color: var(--gold);
}
.chip.selected.cyan-chip {
  background: var(--cyan);
  border-color: var(--cyan);
}

/* PRIX CALCULÉS */
.prix-calc {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid #86efac;
  border-radius: 10px;
  padding: 16px 18px;
  margin-top: 14px;
}
.prix-calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.prix-item { display: flex; flex-direction: column; gap: 3px; }
.prix-item label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #166534; }
.prix-item .val {
  font-size: 18px;
  font-weight: 600;
  color: #15803d;
  font-family: 'Cormorant Garamond', serif;
}
.prix-item .val.orange { color: var(--orange); }

/* BOUTONS */
.btn-row { display: flex; gap: 12px; margin-top: 28px; }
.btn {
  padding: 12px 28px;
  border: none;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.btn-primary {
  background: var(--navy);
  color: white;
  flex: 1;
}
.btn-primary:hover { background: #1e4570; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(27,58,92,0.3); }
.btn-secondary {
  background: white;
  color: var(--muted);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--muted); }
/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--navy);
  color: white;
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1);
  z-index: 999;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: #dc2626; }
.toast.success { background: #15803d; }

/* ═══════════════════════════════════════
   ÉTIQUETTES — Rendu hors écran pour PDF
   ═══════════════════════════════════════ */

/* ── Étiquette Photo (62 × 40 mm) ── */
.label-photo {
  width: 496px;   /* 62mm × 8 */
  height: 320px;  /* 40mm × 8 */
  background: white;
  border: 2px solid #333;
  border-radius: 12px;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'DM Sans', sans-serif;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}
.label-photo .lp-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 4px;
  text-transform: uppercase;
}
.label-photo .lp-code {
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: 1px;
  text-align: center;
  word-break: break-all;
}
.label-photo .lp-barcode svg {
  max-width: 100%;
  height: auto;
}
.label-photo .lp-name {
  font-size: 11px;
  font-weight: 500;
  color: #333;
  text-align: center;
  letter-spacing: 0.5px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.label-photo .lp-meta {
  font-size: 12px;
  color: #555;
  text-align: center;
  letter-spacing: 0.5px;
}

/* ── Étiquette Produit (25 × 12 mm) — le plus discret possible ── */
.label-product {
  width: 200px;   /* 25mm × 8 */
  height: 96px;   /* 12mm × 8 */
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-family: 'DM Sans', sans-serif;
}
.label-product .ls-barcode svg {
  max-width: 100%;
  height: auto;
}
.label-product .ls-code {
  font-family: 'Courier New', monospace;
  font-size: 5.5px;
  font-weight: 400;
  color: #666;
  letter-spacing: 0.2px;
  text-align: center;
  word-break: break-all;
  line-height: 1;
}

@media (max-width: 600px) {
  .container { padding: 20px 12px; }
  .spot-bar { flex-direction: column; align-items: stretch; }
  .grid-3 { grid-template-columns: 1fr; }
}
