/* ============================================
   GIRI TUNNEL BUILDER — PREMIUM EDITOR UI
   Style Figma / Webflow / Framer
   Préfixe : .tb-*
   ============================================ */

:root {
  --tb-sidebar-width: 280px;
  --tb-properties-width: 320px;
  --tb-toolbar-height: 56px;
  --tb-accent: var(--accent-light);
  --tb-accent-hover: var(--accent);
  --tb-bg-dark: #0f0f1a;
  --tb-bg-panel: #18182a;
  --tb-bg-hover: color-mix(in srgb, var(--accent) 10%, transparent);
  --tb-border: rgba(255, 255, 255, 0.08);
  --tb-text: #ffffff;
  --tb-text-muted: rgba(255, 255, 255, 0.5);
}

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.tb-editor {
  display: grid;
  grid-template-columns: var(--tb-sidebar-width) 1fr var(--tb-properties-width);
  height: 100vh;
  background: var(--tb-bg-dark);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================================
   SIDEBAR COMPOSANTS (gauche)
   ============================================================ */
.tb-sidebar {
  background: var(--tb-bg-panel);
  border-right: 1px solid var(--tb-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tb-sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--tb-border);
  flex-shrink: 0;
}

.tb-sidebar-header h3 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--tb-text-muted);
  margin: 0;
}

.tb-components-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.tb-components-list::-webkit-scrollbar {
  width: 4px;
}

.tb-components-list::-webkit-scrollbar-track {
  background: transparent;
}

.tb-components-list::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 2px;
}

/* Catégories */
.tb-category {
  margin-bottom: 1.75rem;
}

.tb-category-title {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tb-text-muted);
  margin: 0 0 0.75rem 0.25rem;
}

.tb-category-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

/* Composant draggable */
.tb-component-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.875rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: grab;
  user-select: none;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), background 0.18s ease-out, border-color 0.18s ease-out, opacity 0.18s ease-out;
}

.tb-component-item:hover {
  background: var(--tb-bg-hover);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tb-component-item:active {
  cursor: grabbing;
  transform: scale(0.95);
  opacity: 0.8;
}

.tb-component-item.tb-dragging {
  opacity: 0.4;
  transform: scale(0.88);
  border-color: var(--tb-accent);
}

.tb-component-icon {
  font-size: 1.4rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.tb-component-name {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--tb-text-muted);
  text-align: center;
  line-height: 1.2;
}

/* ============================================================
   ZONE CENTRALE (canvas + toolbar)
   ============================================================ */
.tb-canvas-wrapper {
  display: flex;
  flex-direction: column;
  background: var(--tb-bg-dark);
  overflow: hidden;
  min-width: 0;
}

/* ---- Toolbar ---- */
.tb-toolbar {
  height: var(--tb-toolbar-height);
  background: var(--tb-bg-panel);
  border-bottom: 1px solid var(--tb-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  flex-shrink: 0;
  gap: 0.5rem;
}

.tb-toolbar-left,
.tb-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.tb-toolbar-center {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Boutons toolbar */
.tb-tool-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--tb-text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease-out, background 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out, opacity 0.15s ease-out;
  flex-shrink: 0;
}

.tb-tool-btn:hover {
  background: var(--tb-bg-hover);
  color: var(--tb-text);
}

.tb-tool-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.tb-tool-btn:disabled:hover {
  background: transparent;
  color: var(--tb-text-muted);
}

/* Séparateur vertical */
.tb-toolbar-sep {
  width: 1px;
  height: 22px;
  background: var(--tb-border);
  margin: 0 0.25rem;
  flex-shrink: 0;
}

/* Device switcher */
.tb-device-switcher {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.tb-device-btn {
  width: 34px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--tb-text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s ease-out, background 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out, opacity 0.15s ease-out;
}

.tb-device-btn:hover {
  color: var(--tb-text);
}

.tb-device-btn.active {
  background: var(--tb-accent);
  color: white;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 50%, transparent);
}

/* Bouton sauvegarde */
.tb-btn-save {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  background: linear-gradient(135deg, var(--tb-accent), var(--accent));
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
  white-space: nowrap;
}

.tb-btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 45%, transparent);
}

.tb-btn-save:active {
  transform: translateY(0);
}

.tb-btn-save:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

/* Titre tunnel dans toolbar */
.tb-toolbar-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tb-text);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Canvas container ---- */
.tb-canvas-container {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem;
  overflow: auto;
  background:
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--accent) 7%, transparent) 0%, transparent 55%),
    var(--tb-bg-dark);
}

.tb-canvas-container::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.tb-canvas-container::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 3px;
}

/* Canvas (le "faux site") */
#tb-canvas {
  background: #1a1a2e;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px var(--tb-border),
    0 24px 60px rgba(0, 0, 0, 0.6);
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  flex-shrink: 0;
}

#tb-canvas[data-device="desktop"] {
  width: 100%;
  max-width: 1200px;
  min-height: 600px;
}

#tb-canvas[data-device="tablet"] {
  width: 768px;
  min-height: 600px;
}

#tb-canvas[data-device="mobile"] {
  width: 375px;
  min-height: 667px;
}

/* Zone de drop */
#tb-drop-zone {
  min-height: 400px;
  padding: 1rem;
  transition: background 0.2s;
}

#tb-drop-zone.tb-drag-over {
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}

/* Indicateur de drop */
.tb-drop-indicator {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--tb-accent), transparent);
  border-radius: 2px;
  margin: 0.35rem 0;
  animation: tb-pulse-line 1.2s ease-in-out infinite;
}

@keyframes tb-pulse-line {
  0%, 100% { opacity: 1; transform: scaleX(1); }
  50% { opacity: 0.5; transform: scaleX(0.9); }
}

/* État vide */
.tb-empty-canvas {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  padding: 3rem;
  color: var(--tb-text-muted);
  text-align: center;
  gap: 1rem;
}

.tb-empty-icon {
  font-size: 4rem;
  line-height: 1;
  animation: tb-float 3.5s ease-in-out infinite;
}

@keyframes tb-float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-12px) rotate(3deg); }
}

.tb-empty-canvas h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--tb-text);
  margin: 0;
}

.tb-empty-canvas p {
  font-size: 0.9rem;
  max-width: 240px;
  line-height: 1.6;
  margin: 0;
}

/* ============================================================
   BLOCS dans le canvas
   ============================================================ */
.tb-block {
  position: relative;
  border: 2px solid transparent;
  border-radius: 8px;
  transition: border-color 0.15s;
  margin-bottom: 0.5rem;
}

.tb-block:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.tb-block.tb-selected {
  border-color: var(--tb-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

/* Toolbar du bloc (apparaît au hover) */
.tb-block-toolbar {
  position: absolute;
  top: -38px;
  right: 4px;
  display: flex;
  gap: 3px;
  padding: 4px;
  background: var(--tb-bg-panel);
  border: 1px solid var(--tb-border);
  border-radius: 8px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), background 0.18s ease-out, border-color 0.18s ease-out, opacity 0.18s ease-out;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.tb-block:hover .tb-block-toolbar,
.tb-block.tb-selected .tb-block-toolbar {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.tb-block-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--tb-text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.12s ease-out, background 0.12s ease-out, border-color 0.12s ease-out, color 0.12s ease-out, opacity 0.12s ease-out;
}

.tb-block-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--tb-text);
}

.tb-block-btn-danger:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

/* Contenu du bloc — pointer-events désactivés sauf si sélectionné */
.tb-block-content {
  pointer-events: none;
}

.tb-block.tb-selected .tb-block-content {
  pointer-events: auto;
}

/* ============================================================
   PANNEAU PROPRIÉTÉS (droite)
   ============================================================ */
.tb-properties {
  background: var(--tb-bg-panel);
  border-left: 1px solid var(--tb-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tb-properties-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--tb-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tb-properties-header h3 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--tb-text-muted);
  margin: 0;
}

.tb-properties-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.tb-properties-content::-webkit-scrollbar {
  width: 4px;
}

.tb-properties-content::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 2px;
}

.tb-props-hint {
  color: var(--tb-text-muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 3rem 1.5rem;
  line-height: 1.6;
}

.tb-props-hint-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

/* Nom du composant sélectionné */
.tb-props-component-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: 10px;
}

.tb-props-component-icon {
  font-size: 1.25rem;
}

.tb-props-component-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tb-text);
}

/* ---- Formulaire de propriétés ---- */
.tb-prop-group {
  margin-bottom: 1.25rem;
}

.tb-prop-group > label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--tb-text-muted);
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tb-prop-group input[type="text"],
.tb-prop-group input[type="number"],
.tb-prop-group input[type="url"],
.tb-prop-group input[type="email"],
.tb-prop-group input[type="datetime-local"],
.tb-prop-group textarea,
.tb-prop-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--tb-border);
  border-radius: 8px;
  color: var(--tb-text);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.tb-prop-group input:focus,
.tb-prop-group textarea:focus,
.tb-prop-group select:focus {
  outline: none;
  border-color: var(--tb-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.tb-prop-group textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

.tb-prop-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='rgba(255,255,255,0.4)' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
}

/* Checkbox */
.tb-prop-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 0.5rem;
  accent-color: var(--tb-accent);
  cursor: pointer;
  vertical-align: middle;
}

/* Range */
.tb-prop-group input[type="range"] {
  width: 100%;
  accent-color: var(--tb-accent);
  cursor: pointer;
}

.tb-range-value {
  font-size: 0.8rem;
  color: var(--tb-text-muted);
  margin-left: 0.5rem;
}

/* Color input */
.tb-prop-group input[type="color"] {
  width: 100%;
  height: 40px;
  padding: 3px;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--tb-border);
}

/* Ligne à 2 colonnes */
.tb-prop-row {
  display: flex;
  gap: 0.75rem;
}

.tb-prop-half {
  flex: 1;
  min-width: 0;
}

/* Upload button */
.tb-btn-upload {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 8px;
  color: var(--tb-accent);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease-out, background 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out, opacity 0.15s ease-out;
  text-align: center;
}

.tb-btn-upload:hover {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-style: solid;
}

/* FAQ editor */
.tb-faq-editor {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.tb-faq-item-editor {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--tb-border);
  border-radius: 8px;
}

.tb-faq-item-editor input,
.tb-faq-item-editor textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--tb-border);
  border-radius: 6px;
  color: var(--tb-text);
  font-size: 0.8rem;
  font-family: inherit;
  box-sizing: border-box;
}

.tb-faq-item-editor input:focus,
.tb-faq-item-editor textarea:focus {
  outline: none;
  border-color: var(--tb-accent);
}

.tb-faq-item-editor textarea {
  min-height: 60px;
  resize: vertical;
}

.tb-btn-add {
  width: 100%;
  padding: 0.6rem;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px dashed color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 8px;
  color: var(--tb-accent);
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.15s ease-out, background 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out, opacity 0.15s ease-out;
}

.tb-btn-add:hover {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-style: solid;
}

.tb-btn-danger {
  padding: 0.35rem 0.6rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  color: #f87171;
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.15s ease-out, background 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out, opacity 0.15s ease-out;
  align-self: flex-end;
}

.tb-btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* Checkbox group */
.tb-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tb-checkbox-group label {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--tb-text);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}

/* ============================================================
   COMPOSANTS RENDUS dans le canvas
   ============================================================ */

/* Hero */
.tb-hero {
  padding: 5rem 2rem;
  text-align: center;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.tb-hero-content {
  position: relative;
  z-index: 1;
}

.tb-hero-headline {
  font-size: 2.75rem;
  font-weight: 800;
  color: white;
  margin: 0 0 1rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.tb-hero-subheadline {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 auto 2.5rem;
  max-width: 540px;
  line-height: 1.6;
}

.tb-hero-cta {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: white;
  color: #1a1a2e;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 50px;
  text-decoration: none;
  transition: transform 0.22s ease-out, background 0.22s ease-out, border-color 0.22s ease-out, color 0.22s ease-out, opacity 0.22s ease-out;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.tb-hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
}

/* Text */
.tb-text {
  padding: 1.25rem 1.5rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.75;
  font-size: 1rem;
}

.tb-text-content[contenteditable="true"]:focus {
  outline: 2px solid var(--tb-accent);
  outline-offset: 6px;
  border-radius: 4px;
}

/* Image */
.tb-image {
  text-align: center;
  padding: 0.5rem;
}

.tb-image img {
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

/* Button */
.tb-button-wrapper {
  padding: 1.25rem;
  text-align: center;
}

.tb-button-wrapper--full {
  display: block;
}

.tb-button {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 10px;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
  cursor: pointer;
}

.tb-button-primary {
  background: linear-gradient(135deg, var(--tb-accent), var(--accent));
  color: white;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent);
}

.tb-button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 50%, transparent);
}

.tb-button-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.tb-button-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.tb-button-outline {
  background: transparent;
  color: var(--tb-accent);
  border: 2px solid var(--tb-accent);
}

.tb-button-outline:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.tb-button-small  { padding: 0.5rem 1.25rem; font-size: 0.85rem; }
.tb-button-medium { padding: 0.75rem 1.75rem; font-size: 1rem; }
.tb-button-large  { padding: 1rem 2.5rem; font-size: 1.1rem; }

/* Video */
.tb-video {
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  display: block;
  width: 100%;
}

.tb-video iframe {
  display: block;
}

/* Form */
.tb-form {
  padding: 2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--tb-border);
  border-radius: 16px;
}

.tb-form-stacked .tb-form-inner {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.tb-form-inline .tb-form-inner {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.tb-form-input {
  flex: 1;
  padding: 0.875rem 1.1rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: white;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s;
}

.tb-form-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.tb-form-input:focus {
  outline: none;
  border-color: var(--tb-accent);
}

.tb-form-submit {
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, var(--tb-accent), var(--accent));
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
  font-family: inherit;
}

.tb-form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 40%, transparent);
}

/* Pricing */
.tb-pricing {
  padding: 2.5rem 2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--tb-border);
  border-radius: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tb-pricing-highlighted {
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 18%, transparent) 0%, color-mix(in srgb, var(--accent) 8%, transparent) 100%);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.tb-pricing-highlighted::before {
  content: '⭐ Populaire';
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tb-accent);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
}

.tb-pricing-header {
  margin-bottom: 1.5rem;
}

.tb-pricing-original {
  font-size: 1.1rem;
  color: var(--tb-text-muted);
  text-decoration: line-through;
  display: block;
  margin-bottom: 0.5rem;
}

.tb-pricing-amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.2rem;
}

.tb-pricing-currency {
  font-size: 1.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  align-self: flex-start;
  margin-top: 0.5rem;
}

.tb-pricing-value {
  font-size: 4.5rem;
  font-weight: 800;
  color: white;
  line-height: 1;
  letter-spacing: -0.03em;
}

.tb-pricing-period {
  font-size: 1rem;
  color: var(--tb-text-muted);
  align-self: flex-end;
  margin-bottom: 0.5rem;
}

.tb-pricing-features {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  text-align: left;
}

.tb-pricing-features li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--tb-border);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tb-pricing-features li:last-child {
  border-bottom: none;
}

.tb-pricing-cta {
  display: block;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--tb-accent), var(--accent));
  border-radius: 12px;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
}

.tb-pricing-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 50%, transparent);
}

/* Testimonial */
.tb-testimonial {
  padding: 2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--tb-border);
  border-radius: 16px;
  text-align: center;
}

.tb-testimonial-stars {
  font-size: 1.4rem;
  color: #fbbf24;
  margin-bottom: 1rem;
  letter-spacing: 2px;
}

.tb-testimonial-quote {
  font-size: 1.15rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.65;
  margin: 0 0 1.5rem;
}

.tb-testimonial-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.tb-testimonial-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.tb-testimonial-name {
  font-weight: 700;
  color: white;
  font-size: 0.95rem;
  text-align: left;
}

.tb-testimonial-role {
  font-size: 0.8rem;
  color: var(--tb-text-muted);
  text-align: left;
}

/* Countdown */
.tb-countdown {
  padding: 2rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(249, 115, 22, 0.08));
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 16px;
  text-align: center;
}

.tb-countdown-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fb923c;
  margin-bottom: 1.75rem;
  letter-spacing: 0.01em;
}

.tb-countdown-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tb-countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 0.75rem 0.5rem;
}

.tb-countdown-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.tb-countdown-label {
  font-size: 0.65rem;
  color: var(--tb-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.35rem;
}

.tb-countdown-sep {
  font-size: 2rem;
  font-weight: 700;
  color: rgba(239, 68, 68, 0.5);
  margin-bottom: 1.2rem;
}

.tb-countdown-expired {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f87171;
  padding: 1.5rem;
}

/* FAQ */
.tb-faq {
  padding: 2rem;
}

.tb-faq-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
  margin: 0 0 1.75rem;
  text-align: center;
}

.tb-faq-item {
  border-bottom: 1px solid var(--tb-border);
}

.tb-faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 0;
  background: none;
  border: none;
  color: white;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s;
  gap: 1rem;
}

.tb-faq-question:hover {
  color: var(--tb-accent);
}

.tb-faq-icon {
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--tb-accent);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  line-height: 1;
}

.tb-faq-item.open .tb-faq-icon {
  transform: rotate(45deg);
}

.tb-faq-answer {
  max-height: 0;
  overflow: hidden;
  color: var(--tb-text-muted);
  line-height: 1.7;
  font-size: 0.95rem;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding-bottom 0.3s;
}

.tb-faq-item.open .tb-faq-answer {
  max-height: 600px;
  padding-bottom: 1.25rem;
}

/* Spacer */
.tb-spacer {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 6px,
    color-mix(in srgb, var(--accent) 6%, transparent) 6px,
    color-mix(in srgb, var(--accent) 6%, transparent) 12px
  );
  border-radius: 4px;
  pointer-events: none;
}

/* Divider */
.tb-divider-wrapper {
  padding: 0.25rem 1rem;
}

.tb-divider {
  border: none;
  border-top: 1px solid var(--tb-border);
  margin: 0 auto;
  display: block;
}

/* ============================================================
   STATES & ANIMATIONS
   ============================================================ */

/* Loader sauvegarde */
@keyframes tb-spin {
  to { transform: rotate(360deg); }
}

.tb-saving::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: tb-spin 0.7s linear infinite;
  margin-left: 6px;
  vertical-align: middle;
}

/* Toast de confirmation */
.tb-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.75rem 1.5rem;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.tb-toast.tb-toast-visible {
  transform: translateX(-50%) translateY(0);
}

.tb-toast-success {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(20, 60, 30, 0.95);
  color: #86efac;
}

.tb-toast-error {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(60, 20, 20, 0.95);
  color: #f87171;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1280px) {
  :root {
    --tb-sidebar-width: 240px;
    --tb-properties-width: 280px;
  }
}

@media (max-width: 1024px) {
  .tb-editor {
    grid-template-columns: 220px 1fr;
  }

  .tb-properties {
    display: none;
  }
}

@media (max-width: 768px) {
  .tb-editor {
    grid-template-columns: 1fr;
  }

  .tb-sidebar {
    display: none;
  }

  #tb-canvas[data-device="desktop"],
  #tb-canvas[data-device="tablet"] {
    width: 100%;
  }
}

/* ============================================================
   ALIASES & CLASSES SUPPLÉMENTAIRES (tunnel-builder.js)
   ============================================================ */

/* #tb-components utilise .tb-components, alias de .tb-components-list */
.tb-components {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 30%, transparent) transparent;
}

.tb-components::-webkit-scrollbar { width: 4px; }
.tb-components::-webkit-scrollbar-track { background: transparent; }
.tb-components::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 2px;
}

/* Compteur de blocs dans toolbar */
.tb-block-count {
  font-size: 0.72rem;
  color: var(--tb-text-muted);
  margin-right: 0.25rem;
  font-weight: 500;
}

/* Hint texte vide dans panel propriétés */
.tb-hint {
  color: var(--tb-text-muted);
  font-size: 0.82rem;
  text-align: center;
  padding: 2.5rem 1rem;
  line-height: 1.6;
  margin: 0;
}

/* Empty canvas hint secondaire */
.tb-empty-hint {
  font-size: 0.78rem !important;
  color: rgba(255, 255, 255, 0.25) !important;
  margin-top: 0.25rem;
}

/* Placeholder de bloc (fallback si TunnelComponents pas chargé) */
.tb-block-placeholder {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  border: 2px dashed color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}

.tb-block-placeholder:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.tb-placeholder-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.tb-placeholder-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: capitalize;
}

.tb-placeholder-text {
  font-size: 0.78rem;
  color: var(--tb-text-muted);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

/* Label du type de bloc dans la toolbar flottante */
.tb-block-type-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--tb-accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0 0.4rem 0 0.2rem;
  border-right: 1px solid var(--tb-border);
  margin-right: 0.15rem;
}

.tb-block-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Section propriétés (formulaire par défaut de tunnel-builder.js) */
.tb-prop-section {
  margin-bottom: 1.5rem;
}

.tb-prop-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tb-accent);
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--tb-border);
}

.tb-prop-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tb-text-muted);
  margin-bottom: 0.4rem;
}

.tb-prop-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--tb-border);
  border-radius: 8px;
  color: var(--tb-text);
  font-size: 0.875rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tb-prop-input:focus {
  outline: none;
  border-color: var(--tb-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.tb-prop-input:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tb-prop-textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--tb-border);
  border-radius: 8px;
  color: var(--tb-text);
  font-size: 0.875rem;
  font-family: inherit;
  box-sizing: border-box;
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tb-prop-textarea:focus {
  outline: none;
  border-color: var(--tb-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

/* Intégration dans l'overlay TunnelEditor */
.tc-visual-builder-wrapper {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tc-visual-builder-wrapper .tb-editor {
  flex: 1;
  min-height: 0;
  height: 100%;
}

/* Animation slide-in pour nouveaux blocs */
@keyframes tbBlockIn {
  from { opacity: 0; transform: translateY(6px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tb-block {
  animation: tbBlockIn 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   BLOC INCONNU / FALLBACK
   ============================================================ */
.tb-unknown {
  padding: 20px 40px;
  text-align: center;
  font-size: 13px;
  color: #999;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(0, 0, 0, 0.02) 8px,
    rgba(0, 0, 0, 0.02) 16px
  );
  border: 1px dashed #ddd;
  border-radius: 4px;
  margin: 8px;
}

/* ============================================================
   COMPOSANTS AVANCÉS — v2.0
   ============================================================ */

/* ─── Countdown Timer Premium (.tb-ct-premium) ────────────── */
.tb-ct-premium {
  padding: 2rem 1.5rem;
  border-radius: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.tb-ct-premium::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(var(--ct-accent, 139 92 246) / 0.2), transparent 70%);
  pointer-events: none;
}
.tb-ct-badge {
  display: inline-block;
  padding: 0.3rem 1rem;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  animation: tb-ct-pulse 2s ease-in-out infinite;
}
@keyframes tb-ct-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}
.tb-ct-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.4rem;
}
.tb-ct-subtitle {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 1.5rem;
}
.tb-ct-blocks {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.tb-ct-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  min-width: 72px;
}
.tb-ct-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.tb-ct-unit {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}
.tb-ct-sep {
  font-size: 2rem;
  font-weight: 800;
  color: rgba(255,255,255,0.4);
  line-height: 1;
  padding-bottom: 1rem;
}
.tb-countdown-expired {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ef4444;
  padding: 1rem;
}

/* ─── Video Embed (.tb-video-embed) ──────────────────────── */
.tb-video-embed {
  width: 100%;
}
.tb-ve-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16/9;
}
.tb-ve-thumbnail {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #111;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.2s;
}
.tb-ve-thumbnail:hover { filter: brightness(0.85); }
.tb-ve-thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.25);
}
.tb-ve-play {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  background: color-mix(in srgb, var(--accent) 92%, transparent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #fff;
  box-shadow: 0 8px 30px color-mix(in srgb, var(--accent) 50%, transparent);
  transition: transform 0.2s, box-shadow 0.2s;
  text-indent: 4px;
}
.tb-ve-thumbnail:hover .tb-ve-play {
  transform: scale(1.1);
  box-shadow: 0 12px 40px color-mix(in srgb, var(--accent) 70%, transparent);
}
.tb-ve-player { position: absolute; inset: 0; }
.tb-ve-player iframe { width: 100%; height: 100%; border: none; }

/* ─── Testimonials Carousel (.tb-carousel) ───────────────── */
.tb-carousel { padding: 2rem 1rem; }
.tb-carousel-title {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e1b4b;
  margin: 0 0 1.5rem;
}
.tb-carousel-track-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tb-carousel-track {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.tb-carousel-slide {
  display: none;
  padding: 1.75rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
  text-align: center;
  animation: tb-slide-in 0.3s ease;
}
.tb-carousel-slide.active { display: block; }
@keyframes tb-slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tb-carousel-stars {
  font-size: 1.2rem;
  color: #f59e0b;
  margin-bottom: 0.75rem;
  letter-spacing: 2px;
}
.tb-carousel-quote {
  font-size: 1.05rem;
  line-height: 1.65;
  color: #374151;
  font-style: italic;
  margin: 0 0 1.25rem;
  quotes: none;
}
.tb-carousel-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.tb-carousel-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.tb-carousel-name { font-weight: 600; font-size: 0.9rem; color: #1e1b4b; }
.tb-carousel-role { font-size: 0.78rem; color: #6b7280; }
.tb-carousel-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  background: #fff;
  color: var(--accent-light);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease-out, background 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out, opacity 0.15s ease-out;
  line-height: 1;
}
.tb-carousel-btn:hover {
  background: var(--accent-light);
  color: #fff;
  border-color: var(--accent-light);
}
.tb-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 1rem;
}
.tb-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  cursor: pointer;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
  padding: 0;
}
.tb-carousel-dot.active {
  background: var(--accent-light);
  width: 20px;
  border-radius: 4px;
}

/* ─── Pricing Table (.tb-ptable) ────────────────────────── */
.tb-ptable { padding: 2rem 1rem; text-align: center; }
.tb-ptable-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e1b4b;
  margin: 0 0 0.5rem;
}
.tb-ptable-grid {
  display: grid;
  grid-template-columns: repeat(var(--plan-count, 3), 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}
@media (max-width: 640px) {
  .tb-ptable-grid { grid-template-columns: 1fr; }
}
.tb-ptable-plan {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.tb-ptable-plan:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}
.tb-ptable-plan-highlight {
  border-color: var(--accent-light);
  background: linear-gradient(160deg, #faf5ff, #fff);
  box-shadow: 0 8px 32px color-mix(in srgb, var(--accent) 20%, transparent);
  transform: scale(1.03);
}
.tb-ptable-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.85rem;
  border-radius: 20px;
  white-space: nowrap;
}
.tb-ptable-name {
  font-size: 1rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 0.75rem;
}
.tb-ptable-price {
  display: flex;
  align-items: baseline;
  gap: 0.1rem;
  margin-bottom: 1.25rem;
}
.tb-ptable-currency { font-size: 1.1rem; color: #6b7280; font-weight: 600; }
.tb-ptable-amount   { font-size: 2.5rem; font-weight: 800; color: #1e1b4b; line-height: 1; }
.tb-ptable-period   { font-size: 0.85rem; color: #9ca3af; }
.tb-ptable-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  width: 100%;
  text-align: left;
}
.tb-ptable-features li {
  padding: 0.4rem 0;
  font-size: 0.875rem;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  gap: 0.4rem;
}
.tb-ptable-check { color: #10b981; font-weight: 700; flex-shrink: 0; }
.tb-ptable-cta {
  display: block;
  width: 100%;
  padding: 0.75rem 1.25rem;
  text-align: center;
  border-radius: 10px;
  background: #f3f4f6;
  color: #374151;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform 0.15s ease-out, background 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out, opacity 0.15s ease-out;
  margin-top: auto;
}
.tb-ptable-cta:hover { background: #e5e7eb; }
.tb-ptable-cta-hl {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: #fff;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 40%, transparent);
}
.tb-ptable-cta-hl:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 50%, transparent);
  background: linear-gradient(135deg, var(--accent), var(--accent));
}

/* ─── FAQ Accordion (.tb-accordion) ─────────────────────── */
.tb-accordion { padding: 1.5rem; }
.tb-accordion-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e1b4b;
  margin: 0 0 1.25rem;
  text-align: center;
}
.tb-accordion-items { display: flex; flex-direction: column; gap: 0.5rem; }
.tb-accordion-item {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #fff;
  transition: border-color 0.2s;
}
.tb-accordion-item.open { border-color: rgba(var(--acc-accent, 139 92 246) / 0.4); }
.tb-accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s;
}
.tb-accordion-trigger:hover { background: #faf5ff; }
.tb-accordion-item.open .tb-accordion-trigger { background: #faf5ff; }
.tb-accordion-icon { font-size: 1.1rem; flex-shrink: 0; }
.tb-accordion-question {
  flex: 1;
  font-size: 0.925rem;
  font-weight: 600;
  color: #1e1b4b;
}
.tb-accordion-arrow {
  font-size: 1.4rem;
  color: var(--accent-light);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  line-height: 1;
}
.tb-accordion-item.open .tb-accordion-arrow { transform: rotate(90deg); }
.tb-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tb-accordion-item.open .tb-accordion-body { max-height: 400px; }
.tb-accordion-answer {
  padding: 0 1.25rem 1rem 3.25rem;
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.7;
}

/* ─── Progress Bars (.tb-progress-section) ──────────────── */
.tb-progress-section { padding: 1.5rem; }
.tb-progress-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e1b4b;
  margin: 0 0 1.25rem;
  text-align: center;
}
.tb-progress-bars { display: flex; flex-direction: column; gap: 1.1rem; }
.tb-progress-row {}
.tb-progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.tb-progress-label { font-size: 0.875rem; font-weight: 600; color: #374151; }
.tb-progress-pct   { font-size: 0.875rem; font-weight: 700; color: var(--accent-light); }
.tb-progress-track {
  height: 10px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
}
.tb-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.tb-progress-anim { transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1); }

/* ─── Social Proof (.tb-sproof) ──────────────────────────── */
.tb-sproof {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.tb-sp-live {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: #374151;
  font-weight: 500;
}
.tb-sp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: tb-sp-blink 1.5s ease-in-out infinite;
}
@keyframes tb-sp-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.tb-sp-total {
  font-size: 0.9rem;
  color: #1e1b4b;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  background: rgba(16, 185, 129, 0.06);
  border-radius: 8px;
}
.tb-sp-recent { position: relative; }
.tb-sp-notification {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.82rem;
  color: #374151;
  opacity: 0;
  transform: translateY(4px);
  transition: transform 0.4s ease-out, background 0.4s ease-out, border-color 0.4s ease-out, color 0.4s ease-out, opacity 0.4s ease-out;
}
.tb-sp-notification.tb-sp-visible {
  opacity: 1;
  transform: translateY(0);
}
.tb-sp-bell { font-size: 1rem; flex-shrink: 0; }
.tb-sp-msg  { font-weight: 500; color: #1e1b4b; }

/* ============================================================
   COUNTDOWN TIMER PREMIUM (.tb-ct-*)
   ============================================================ */
.tb-ct-premium {
  padding: 40px 32px;
  border-radius: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.tb-ct-premium::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, var(--ct-accent, var(--accent-light)) 0%, transparent 70%);
  opacity: 0.15;
  pointer-events: none;
}
.tb-ct-badge {
  display: inline-block;
  background: var(--ct-accent, var(--accent-light));
  color: white;
  padding: 5px 18px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}
.tb-ct-title {
  font-size: 1.5em;
  font-weight: 800;
  color: white;
  margin-bottom: 6px;
}
.tb-ct-subtitle {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95em;
  margin-bottom: 28px;
}
.tb-ct-blocks {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.tb-ct-block {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 18px 22px;
  min-width: 78px;
  transition: transform 0.2s;
}
.tb-ct-block:hover { transform: translateY(-2px); }
.tb-ct-number {
  font-size: 2.6em;
  font-weight: 900;
  color: white;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 0 20px var(--ct-accent, var(--accent-light));
}
.tb-ct-unit {
  font-size: 0.7em;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
.tb-ct-sep {
  font-size: 2em;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1;
  padding-bottom: 20px;
}

/* ============================================================
   VIDEO EMBED PREMIUM (.tb-ve-*)
   ============================================================ */
.tb-video-embed {
  border-radius: 16px;
  overflow: hidden;
}
.tb-ve-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}
.tb-ve-thumbnail {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.4s ease;
}
.tb-ve-thumbnail::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  transition: background 0.3s;
}
.tb-ve-thumbnail:hover::before { background: rgba(0, 0, 0, 0.2); }
.tb-ve-thumbnail:hover { transform: scale(1.02); }
.tb-ve-play {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #1a1a2e;
  transition: transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
.tb-ve-thumbnail:hover .tb-ve-play {
  transform: scale(1.12);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
}
.tb-ve-player {
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}
.tb-ve-info {
  padding: 16px 4px 4px;
}
.tb-ve-title {
  font-size: 1.05em;
  font-weight: 700;
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.92);
}
.tb-ve-desc {
  font-size: 0.88em;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  line-height: 1.5;
}

/* ============================================================
   TESTIMONIALS CAROUSEL (.tb-carousel-*)
   ============================================================ */
.tb-carousel {
  padding: 32px 0;
}
.tb-carousel-title {
  text-align: center;
  font-size: 1.55em;
  font-weight: 700;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.95);
}
.tb-carousel-track-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tb-carousel-track {
  flex: 1;
  overflow: hidden;
  border-radius: 16px;
}
.tb-carousel-slide {
  display: none;
  padding: 28px 32px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  animation: tbSlideIn 0.4s ease;
  text-align: center;
}
.tb-carousel-slide.active { display: block; }
@keyframes tbSlideIn {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}
.tb-carousel-stars {
  color: #fbbf24;
  font-size: 1.25em;
  margin-bottom: 16px;
}
.tb-carousel-quote {
  font-size: 1.05em;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.88);
  font-style: italic;
  margin: 0 0 20px;
}
.tb-carousel-author {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}
.tb-carousel-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--accent) 50%, transparent);
}
.tb-carousel-name {
  font-weight: 700;
  font-size: 0.95em;
  color: rgba(255, 255, 255, 0.9);
}
.tb-carousel-role {
  font-size: 0.82em;
  color: rgba(255, 255, 255, 0.5);
}
.tb-carousel-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.6em;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.tb-carousel-btn:hover {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  transform: scale(1.08);
}
.tb-carousel-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}
.tb-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  cursor: pointer;
  transition: transform 0.3s ease-out, background 0.3s ease-out, border-color 0.3s ease-out, color 0.3s ease-out, opacity 0.3s ease-out;
  padding: 0;
}
.tb-carousel-dot.active {
  background: var(--accent-light);
  width: 24px;
  border-radius: 4px;
}

/* ============================================================
   PRICING TABLE (.tb-ptable-*)
   ============================================================ */
.tb-ptable {
  padding: 32px 0;
}
.tb-ptable-title {
  text-align: center;
  font-size: 1.55em;
  font-weight: 700;
  margin-bottom: 32px;
  color: rgba(255, 255, 255, 0.95);
}
.tb-ptable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  align-items: stretch;
}
.tb-ptable-plan {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 32px 24px;
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.tb-ptable-plan:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.tb-ptable-plan-highlight {
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 18%, transparent), rgba(109, 40, 217, 0.06));
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 18%, transparent);
  transform: scale(1.03);
}
.tb-ptable-plan-highlight:hover {
  transform: scale(1.03) translateY(-3px);
}
.tb-ptable-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: white;
  padding: 5px 18px;
  border-radius: 20px;
  font-size: 0.78em;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 40%, transparent);
}
.tb-ptable-name {
  font-size: 1.1em;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 16px;
}
.tb-ptable-price {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  margin-bottom: 8px;
}
.tb-ptable-currency {
  font-size: 1.2em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
}
.tb-ptable-amount {
  font-size: 3.2em;
  font-weight: 900;
  color: white;
  line-height: 1;
}
.tb-ptable-period {
  font-size: 0.82em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 6px;
}
.tb-ptable-features {
  list-style: none;
  padding: 0;
  margin: 16px 0 24px;
  text-align: left;
  flex: 1;
}
.tb-ptable-features li {
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88em;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.tb-ptable-check {
  color: #10b981;
  flex-shrink: 0;
  font-weight: 700;
}
.tb-ptable-cta {
  display: block;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 13px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95em;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: auto;
}
.tb-ptable-cta:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}
.tb-ptable-cta-hl {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 40%, transparent);
}
.tb-ptable-cta-hl:hover {
  background: linear-gradient(135deg, #9d6fff, var(--accent));
  box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 50%, transparent);
}

/* ============================================================
   FAQ ACCORDION (.tb-accordion-*)
   ============================================================ */
.tb-accordion {
  padding: 32px 0;
}
.tb-accordion-title {
  font-size: 1.55em;
  font-weight: 700;
  text-align: center;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.95);
}
.tb-accordion-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tb-accordion-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.3s;
}
.tb-accordion-item.open {
  border-color: var(--acc-accent, var(--accent-light));
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.tb-accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 20px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  text-align: left;
  font-size: 0.97em;
  font-weight: 600;
  transition: color 0.2s;
}
.tb-accordion-item.open .tb-accordion-trigger {
  color: white;
}
.tb-accordion-icon {
  font-size: 1.25em;
  flex-shrink: 0;
}
.tb-accordion-question {
  flex: 1;
}
.tb-accordion-arrow {
  flex-shrink: 0;
  font-size: 1.3em;
  color: rgba(255, 255, 255, 0.35);
  transition: transform 0.35s ease, color 0.3s;
  line-height: 1;
}
.tb-accordion-item.open .tb-accordion-arrow {
  transform: rotate(90deg);
  color: var(--acc-accent, var(--accent-light));
}
.tb-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.tb-accordion-item.open .tb-accordion-body {
  max-height: 500px;
}
.tb-accordion-answer {
  padding: 0 20px 18px 52px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.7;
  font-size: 0.92em;
}

/* ============================================================
   PROGRESS BAR (.tb-progress-*)
   ============================================================ */
.tb-progress-section {
  padding: 32px 0;
}
.tb-progress-title {
  font-size: 1.45em;
  font-weight: 700;
  text-align: center;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.95);
}
.tb-progress-bars {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.tb-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.tb-progress-label {
  font-size: 0.93em;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}
.tb-progress-pct {
  font-size: 0.88em;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
}
.tb-progress-track {
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
}
.tb-progress-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0s;
  position: relative;
}
.tb-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
  animation: tbProgressShine 2.5s infinite;
}
@keyframes tbProgressShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}
.tb-progress-fill.tb-progress-anim {
  width: 0 !important;
  transition: width 1.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   SOCIAL PROOF (.tb-sp-* / .tb-sproof)
   ============================================================ */
.tb-sproof {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tb-sp-live {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 0.92em;
  color: rgba(255, 255, 255, 0.85);
}
.tb-sp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sp-accent, #10b981);
  flex-shrink: 0;
  animation: tbSpPulse 1.8s ease-in-out infinite;
}
@keyframes tbSpPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sp-accent, #10b981) 70%, transparent); }
  50% { box-shadow: 0 0 0 7px transparent; }
}
.tb-sp-total {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 0.92em;
  color: rgba(255, 255, 255, 0.85);
}
.tb-sp-recent {
  position: relative;
  min-height: 46px;
}
.tb-sp-notification {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  color: #1a1a2e;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 0.88em;
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.tb-sp-notification.tb-sp-visible {
  opacity: 1;
  transform: translateY(0);
}
.tb-sp-bell {
  font-size: 1.15em;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   TUNNEL AI CHAT — Chat IA + Prompt Forge Premium
   Prefix: .tac-*
   ══════════════════════════════════════════════════════════ */

/* ── Overlay principal ── */
.tac-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
.tac-overlay.active { display: flex; }

.tac-modal {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary, #0f0f13);
  overflow: hidden;
}

/* ── Header ── */
.tac-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-secondary, #1a1a22);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.tac-back-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary, #a0a0b0);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
  white-space: nowrap;
}
.tac-back-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

.tac-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary, #fff);
  flex: 1;
}
.tac-title-icon { font-size: 18px; }

.tac-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

/* Crédit badge */
.tac-credit-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 20px;
  padding: 4px 10px 4px 8px;
  font-size: 12px;
  color: var(--accent-light);
}
.tac-credit-icon { font-size: 14px; }
.tac-credit-count { font-weight: 600; }

.tac-buy-btn {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  border: none;
  color: #e9d5ff;
  padding: 3px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: background 0.2s;
}
.tac-buy-btn:hover { background: color-mix(in srgb, var(--accent) 50%, transparent); }

/* Bouton sauvegarder */
.tac-save-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
  white-space: nowrap;
}
.tac-save-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.tac-save-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── Corps : layout 60/40 ── */
.tac-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Preview pane (60%) ── */
.tac-preview-pane {
  width: 60%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}

.tac-preview-label {
  padding: 8px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted, #666);
  background: var(--bg-secondary, #1a1a22);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.tac-preview-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background: #fff;
}

/* Contenu preview tunnel */
.tac-pv-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 24px;
  color: #111;
}

.tac-pv-hero {
  text-align: center;
  padding: 32px 0 24px;
}
.tac-pv-headline {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.3;
  color: #111;
  margin-bottom: 12px;
}
.tac-pv-sub {
  font-size: 15px;
  color: #555;
  margin-bottom: 20px;
  line-height: 1.6;
}
.tac-pv-cta {
  display: inline-block;
  padding: 12px 28px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
}
.tac-pv-cta:hover { filter: brightness(1.1); transform: translateY(-2px); }

.tac-pv-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  margin: 8px 0;
}
.tac-pv-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.tac-pv-feature-icon { font-size: 18px; flex-shrink: 0; }
.tac-pv-feature-title { font-weight: 600; font-size: 14px; color: #222; }
.tac-pv-feature-desc { font-size: 13px; color: #666; margin-top: 2px; }

.tac-pv-section {
  padding: 20px 0;
  border-top: 1px solid #eee;
}
.tac-pv-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
  margin-bottom: 12px;
}

.tac-pv-testimonial {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 8px;
}
.tac-pv-avatar { font-size: 24px; flex-shrink: 0; }
.tac-pv-testimonial-content { font-size: 13px; color: #333; font-style: italic; line-height: 1.5; }
.tac-pv-testimonial-author { font-size: 12px; color: #888; margin-top: 4px; font-weight: 600; }

.tac-pv-faq-item {
  margin-bottom: 12px;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 6px;
}
.tac-pv-faq-q { font-weight: 600; font-size: 13px; color: #222; margin-bottom: 4px; }
.tac-pv-faq-a { font-size: 13px; color: #555; line-height: 1.5; }

.tac-pv-block-chip {
  display: inline-block;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent-light);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: monospace;
  margin: 2px;
}

.tac-preview-empty {
  padding: 60px 20px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

/* ── Chat pane (40%) ── */
.tac-chat-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary, #0f0f13);
}

/* Toolbar chat */
.tac-chat-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: var(--bg-secondary, #1a1a22);
  flex-shrink: 0;
}

.tac-rollback-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary, #a0a0b0);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
}
.tac-rollback-btn:hover:not(:disabled) { background: rgba(255,100,100,0.15); color: #fca5a5; border-color: rgba(255,100,100,0.3); }
.tac-rollback-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Prompt Forge button — golden gradient */
.tac-forge-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #fff;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
  box-shadow: 0 2px 8px rgba(245,158,11,0.3);
}
.tac-forge-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.tac-forge-btn.active {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 0 0 2px rgba(251,191,36,0.4), 0 2px 12px rgba(245,158,11,0.5);
}

/* Messages list */
.tac-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tac-messages::-webkit-scrollbar { width: 4px; }
.tac-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* Message de bienvenue */
.tac-welcome {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-secondary, #a0a0b0);
}
.tac-welcome-icon { font-size: 40px; margin-bottom: 12px; }
.tac-welcome h3 { font-size: 16px; color: var(--text-primary, #fff); margin-bottom: 8px; }
.tac-welcome p { font-size: 13px; margin-bottom: 16px; }

.tac-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.tac-suggestion {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent-light);
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
}
.tac-suggestion:hover { background: color-mix(in srgb, var(--accent) 25%, transparent); color: #e9d5ff; }

/* Messages individuels */
.tac-message {
  display: flex;
  gap: 8px;
  animation: tac-fade-in 0.25s ease;
}
@keyframes tac-fade-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

.tac-message-user {
  flex-direction: row-reverse;
}
.tac-message-user .tac-msg-bubble {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: #fff;
  border-radius: 16px 4px 16px 16px;
  padding: 10px 14px;
  font-size: 13px;
  max-width: 85%;
  word-break: break-word;
}

.tac-message-assistant .tac-msg-body { display: flex; flex-direction: column; gap: 6px; max-width: 90%; }
.tac-message-assistant .tac-msg-bubble {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-primary, #e8e8f0);
  border-radius: 4px 16px 16px 16px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.6;
}

.tac-msg-avatar {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Forge badge sur messages */
.tac-message-forge .tac-msg-bubble {
  border-color: rgba(245,158,11,0.3);
  background: rgba(245,158,11,0.06);
}
.tac-forge-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.3);
  color: #fbbf24;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  width: fit-content;
}

/* Message erreur */
.tac-message-error .tac-msg-bubble {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.25);
  color: #fca5a5;
}

/* Bouton voir changements */
.tac-msg-preview-btn {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--accent-light);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
  align-self: flex-start;
}
.tac-msg-preview-btn:hover { background: color-mix(in srgb, var(--accent) 25%, transparent); }

/* Loading dots */
.tac-dots { display: inline-flex; gap: 4px; align-items: center; }
.tac-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  animation: tac-bounce 1s infinite;
}
.tac-dots span:nth-child(2) { animation-delay: 0.2s; }
.tac-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes tac-bounce { 0%,80%,100%{transform:scale(1);opacity:0.5} 40%{transform:scale(1.3);opacity:1} }

.tac-forge-hint-text {
  font-size: 11px;
  color: #fbbf24;
  margin-top: 6px;
  font-style: italic;
}

/* ── Zone de saisie ── */
.tac-input-area {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 10px 12px;
  background: var(--bg-secondary, #1a1a22);
  flex-shrink: 0;
}

.tac-forge-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25);
  color: #fbbf24;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.tac-cancel-forge {
  background: rgba(245,158,11,0.15);
  border: none;
  color: #fbbf24;
  padding: 2px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
  margin-left: auto;
}
.tac-cancel-forge:hover { background: rgba(245,158,11,0.3); }

.tac-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.tac-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-primary, #fff);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  line-height: 1.5;
  transition: border-color 0.2s;
  min-height: 40px;
  max-height: 120px;
}
.tac-input:focus { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.tac-input::placeholder { color: rgba(255,255,255,0.3); }

.tac-send-btn {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
  flex-shrink: 0;
}
.tac-send-btn:hover { filter: brightness(1.15); transform: scale(1.05); }
.tac-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.tac-send-btn.loading svg { animation: tac-spin 0.8s linear infinite; }
@keyframes tac-spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }

/* ── Modal crédits ── */
.tac-credits-modal {
  position: fixed;
  inset: 0;
  z-index: 1150;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.tac-credits-card {
  background: var(--bg-secondary, #1a1a22);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 32px;
  max-width: 520px;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.tac-credits-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--text-secondary, #a0a0b0);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tac-credits-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary, #fff);
  margin-bottom: 8px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tac-credits-subtitle {
  font-size: 13px;
  color: var(--text-secondary, #a0a0b0);
  margin-bottom: 24px;
  line-height: 1.5;
}

.tac-packs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.tac-pack {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  position: relative;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tac-pack:hover { border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.04); }

.tac-pack-featured {
  border-color: rgba(245,158,11,0.5);
  background: rgba(245,158,11,0.06);
  transform: scale(1.03);
}

.tac-pack-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
  white-space: nowrap;
}

.tac-pack-name { font-weight: 700; color: var(--text-primary, #fff); font-size: 14px; }
.tac-pack-credits { font-size: 20px; font-weight: 800; color: #fbbf24; }
.tac-pack-price { font-size: 22px; font-weight: 800; color: var(--text-primary, #fff); }
.tac-pack-price-unit { font-size: 10px; color: var(--text-muted, #666); margin-bottom: 8px; }

.tac-pack-buy {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #fff;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
  margin-top: auto;
}
.tac-pack-buy:hover { filter: brightness(1.1); }
.tac-pack-buy:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Bouton Chat IA dans tunnel-editor ── */
.tc-btn-ai-chat {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 25%, transparent), color-mix(in srgb, var(--accent) 20%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent-light);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
}
.tc-btn-ai-chat:hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 40%, transparent), color-mix(in srgb, var(--accent) 35%, transparent));
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  color: #e9d5ff;
}

/* Responsive */
@media (max-width: 768px) {
  .tac-body { flex-direction: column; }
  .tac-preview-pane { width: 100%; height: 40%; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .tac-packs { grid-template-columns: 1fr; }
  .tac-pack-featured { transform: none; }
}
