/* Design Lab — thème neutre orienté démo / présentation */

*,
*::before,
*::after {
  box-sizing: border-box;
}

.dl-body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #e8eaed;
  background: linear-gradient(160deg, #0f1419 0%, #1a2332 50%, #0d1117 100%);
}

.dl-skip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.dl-skip:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: #238636;
  color: #fff;
  z-index: 1000;
  border-radius: 6px;
}

.dl-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.dl-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dl-brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: #58a6ff;
  text-decoration: none;
}

.dl-brand:hover {
  text-decoration: underline;
}

.dl-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.dl-nav a {
  color: #8b949e;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.dl-nav a:hover {
  color: #c9d1d9;
}

.dl-nav a.is-active {
  color: #58a6ff;
  border-bottom-color: #58a6ff;
}

.dl-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.dl-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: #6e7681;
}

.dl-hero h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: #f0f6fc;
}

.dl-hero p {
  margin: 0 0 1rem;
  color: #8b949e;
  max-width: 56ch;
}

.dl-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.dl-card-link {
  display: block;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(22, 27, 34, 0.6);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.dl-card-link:hover {
  border-color: rgba(88, 166, 255, 0.45);
  transform: translateY(-2px);
}

.dl-card-link h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: #58a6ff;
}

.dl-card-link p {
  margin: 0;
  font-size: 0.9rem;
  color: #8b949e;
}

/* Configurateur */
.dl-config-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .dl-config-layout {
    grid-template-columns: 1fr;
  }
}

.dl-panel {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(22, 27, 34, 0.55);
  padding: 1rem 1.1rem;
}

.dl-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: #c9d1d9;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dl-field {
  margin-bottom: 0.85rem;
}

.dl-field label {
  display: block;
  font-size: 0.8rem;
  color: #8b949e;
  margin-bottom: 0.25rem;
}

.dl-field input[type="text"],
.dl-field input[type="number"],
.dl-field select {
  width: 100%;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #0d1117;
  color: #e6edf3;
  font-size: 0.9rem;
}

.dl-field input[type="range"] {
  width: 100%;
}

.dl-field-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dl-field-row input[type="range"] {
  flex: 1;
}

.dl-value {
  font-size: 0.8rem;
  color: #58a6ff;
  min-width: 3rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dl-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.dl-preset-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #21262d;
  color: #c9d1d9;
  cursor: pointer;
}

.dl-preset-btn:hover {
  background: #30363d;
}

.dl-preset-btn.is-active {
  border-color: #58a6ff;
  color: #58a6ff;
}

.dl-preview-wrap {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.25rem;
  background: #0d1117;
  min-height: 320px;
}

.dl-preview-title {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: #8b949e;
}

.dl-code-export {
  margin-top: 1rem;
}

.dl-code-export label {
  display: block;
  font-size: 0.8rem;
  color: #8b949e;
  margin-bottom: 0.35rem;
}

.dl-code-export textarea {
  width: 100%;
  min-height: 140px;
  padding: 0.65rem;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #161b22;
  color: #7ee787;
  resize: vertical;
}

.dl-copy-bar {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dl-btn-secondary {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #21262d;
  color: #c9d1d9;
  cursor: pointer;
}

.dl-btn-secondary:hover {
  background: #30363d;
}

/* Variables appliquées dans la zone preview */
.dl-preview-root {
  --dl-btn-radius: 8px;
  --dl-btn-pad-x: 1rem;
  --dl-btn-pad-y: 0.55rem;
  --dl-btn-bg: #238636;
  --dl-btn-color: #ffffff;
  --dl-btn-border-w: 0px;
  --dl-btn-border-c: transparent;
  --dl-btn-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  --dl-card-radius: 12px;
  --dl-card-pad: 1rem;
  --dl-card-bg: rgba(22, 27, 34, 0.9);
  --dl-card-border: 1px solid rgba(255, 255, 255, 0.1);
  --dl-card-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --dl-input-radius: 6px;
  --dl-input-border: 1px solid rgba(255, 255, 255, 0.2);
  --dl-input-pad: 0.5rem 0.65rem;
  --dl-font-size: 1rem;
  --dl-heading-weight: 600;
  --dl-muted: #8b949e;
}

.dl-preview-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--dl-font-size);
  font-weight: var(--dl-heading-weight);
  padding: var(--dl-btn-pad-y) var(--dl-btn-pad-x);
  border-radius: var(--dl-btn-radius);
  background: var(--dl-btn-bg);
  color: var(--dl-btn-color);
  border: var(--dl-btn-border-w) solid var(--dl-btn-border-c);
  box-shadow: var(--dl-btn-shadow);
  cursor: default;
  margin: 0 0.5rem 0.5rem 0;
}

.dl-preview-btn.dl-shape-circle {
  width: 3rem;
  height: 3rem;
  padding: 0;
  border-radius: 50%;
}

.dl-preview-card {
  border-radius: var(--dl-card-radius);
  padding: var(--dl-card-pad);
  background: var(--dl-card-bg);
  border: var(--dl-card-border);
  box-shadow: var(--dl-card-shadow);
  max-width: 280px;
  margin-bottom: 1rem;
}

.dl-preview-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: var(--dl-heading-weight);
  color: #f0f6fc;
}

.dl-preview-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--dl-muted);
}

.dl-preview-input {
  display: inline-block;
  font-size: var(--dl-font-size);
  padding: var(--dl-input-pad);
  border-radius: var(--dl-input-radius);
  border: var(--dl-input-border);
  background: #0d1117;
  color: #e6edf3;
  width: 100%;
  max-width: 260px;
}

/* Bibliothèques */
.dl-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}

.dl-toolbar .dl-field {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.dl-snippet {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  margin-bottom: 1rem;
  overflow: hidden;
  background: rgba(22, 27, 34, 0.5);
}

.dl-snippet-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.dl-snippet-header h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #58a6ff;
}

.dl-snippet-meta {
  font-size: 0.8rem;
  color: #6e7681;
}

.dl-snippet-desc {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: #8b949e;
}

.dl-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.dl-keyword {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(88, 166, 255, 0.15);
  color: #79c0ff;
}

.dl-snippet pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  background: #0d1117;
  color: #e6edf3;
}

.dl-empty {
  padding: 2rem;
  text-align: center;
  color: #6e7681;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.dl-api-hint {
  font-size: 0.85rem;
  color: #6e7681;
  margin-top: 0.5rem;
}

.dl-api-hint code {
  font-size: 0.8rem;
  background: rgba(110, 118, 129, 0.2);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.dl-live-badge {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: rgba(46, 160, 67, 0.2);
  color: #56d364;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/*
 * Référence visuelle « Carte verte » (projet client, style.css) :
 * page claire centrée, formulaire, bouton sombre, champs bord gris.
 * Ces variables ne modifient pas l’UI du Design Lab tant qu’elles ne sont pas utilisées ;
 * elles servent de rappel / copier-coller pour le configurateur CSS.
 */
:root {
  --carte-verte-page-bg: #f5f5f5;
  --carte-verte-text: #1a1a1a;
  --carte-verte-max-width: 40rem;
  --carte-verte-link: #0b57d0;
  --carte-verte-field-border: #ccc;
  --carte-verte-field-radius: 4px;
  --carte-verte-separator: #e0e0e0;
  --carte-verte-table-head: #eee;
  --carte-verte-btn-bg: #333;
  --carte-verte-btn-bg-hover: #222;
  --carte-verte-btn-fg: #fff;
  --carte-verte-btn-radius: 4px;
  --carte-verte-btn-pad-y: 0.55rem;
  --carte-verte-btn-pad-x: 1.25rem;
}
