/* ============================================================
   Structure & Design du livre — Tab styles
   ============================================================ */

/* --- Layout général --- */
.sl-container { max-width: 100%; }
.sl-layout { display: flex; gap: 1.25rem; align-items: flex-start; }
.sl-form-col { flex: 1; min-width: 0; }
.sl-preview-col { width: 280px; flex-shrink: 0; }
.sl-preview-sticky {
    position: sticky; top: 10px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 0.85rem; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* --- Titre aperçu --- */
.sl-preview-title {
    font-size: 0.75rem; font-weight: 700; color: #6b7280;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 0.6rem; text-align: center;
}

/* --- Maquette livre --- */
.sl-mockup-wrap { display: flex; flex-direction: column; align-items: center; }
.sl-mockup {
    display: flex; width: 100%;
    border-radius: 3px; overflow: hidden;
    box-shadow: 2px 3px 12px rgba(0,0,0,0.15);
    min-height: 200px;
}

/* 4ème de couverture */
.sl-mock-4c {
    width: 38%; background: #f3f4f6;
    padding: 8px 6px; display: flex; flex-direction: column;
    justify-content: space-between; font-size: 0.5rem; color: #374151;
    border-right: 1px solid #d1d5db; position: relative;
    overflow: hidden;
}
.sl-mock-4c-resume {
    font-size: 0.48rem; line-height: 1.35; color: #4b5563;
    max-height: 80px; overflow: hidden;
}
.sl-mock-4c-citation {
    font-style: italic; font-size: 0.45rem; color: #6b7280;
    margin: 3px 0; max-height: 20px; overflow: hidden;
}
.sl-mock-4c-bio {
    font-size: 0.42rem; color: #9ca3af;
    max-height: 25px; overflow: hidden;
}
.sl-mock-4c-isbn { text-align: center; margin-top: auto; padding-top: 4px; }
.sl-mock-barcode {
    width: 32px; height: 18px; margin: 0 auto;
    background: repeating-linear-gradient(90deg, #000 0px, #000 1px, #fff 1px, #fff 3px);
    border-radius: 1px;
}

/* Dos */
.sl-mock-dos {
    width: 8%; min-width: 18px;
    background: #ec4899; display: flex; align-items: center; justify-content: center;
    writing-mode: vertical-rl; text-orientation: mixed;
    font-size: 0.45rem; font-weight: 700; color: #fff;
    letter-spacing: 0.3px; padding: 4px 0;
    overflow: hidden;
}
.sl-mock-dos-text { white-space: nowrap; transform: rotate(180deg); }

/* 1ère de couverture */
.sl-mock-1c {
    width: 54%; background: linear-gradient(135deg, #3b82f6, #6366f1);
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; position: relative;
    padding: 10px 8px; color: #fff; text-align: center;
    overflow: hidden;
}
.sl-mock-1c-img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: 0.35;
}
.sl-mock-1c-content { position: relative; z-index: 1; }
.sl-mock-1c-title {
    font-size: 0.75rem; font-weight: 800; line-height: 1.2;
    margin-bottom: 4px; text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    word-break: break-word;
}
.sl-mock-1c-author {
    font-size: 0.52rem; font-weight: 500; opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.sl-mock-1c-genre {
    position: absolute; bottom: 4px; right: 6px;
    font-size: 0.4rem; opacity: 0.7; z-index: 1;
}

/* Tranche */
.sl-mock-tranche {
    height: 6px; width: 100%;
    background: #f59e0b; border-radius: 0 0 3px 3px;
    margin-top: -1px;
}

/* Infos format sous la maquette */
.sl-preview-info {
    text-align: center; font-size: 0.7rem; color: #9ca3af;
    margin-top: 0.5rem; margin-bottom: 0.5rem;
}

/* Checklist de remplissage */
.sl-preview-checklist { border-top: 1px solid #f3f4f6; padding-top: 0.5rem; }
.sl-check-item {
    font-size: 0.7rem; color: #9ca3af; padding: 2px 0;
    display: flex; align-items: center; gap: 0.35rem;
}
.sl-check-item i { font-size: 0.4rem; }
.sl-check-item.sl-check-done { color: #059669; }
.sl-check-item.sl-check-done i::before { content: "\f058"; font-weight: 900; font-size: 0.6rem; }

/* --- Récap brief sidebar --- */
.sl-brief-recap { border-top: 1px solid #f3f4f6; }
.sl-recap-content { font-size: 0.68rem; color: #374151; line-height: 1.4; }
.sl-recap-line {
    padding: 3px 0; border-bottom: 1px dashed #f3f4f6;
    display: flex; gap: 0.3rem;
}
.sl-recap-line:last-child { border-bottom: none; }
.sl-recap-label { color: #9ca3af; font-weight: 600; white-space: nowrap; min-width: 52px; }
.sl-recap-value { color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-recap-brief { white-space: normal; max-height: 32px; overflow: hidden; color: #6b7280; font-style: italic; }

/* --- Prestataires sidebar --- */
.sl-sidebar-providers { border-top: 1px solid #f3f4f6; }
.sl-prov-card {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 0.35rem; border-radius: 8px;
    text-decoration: none; color: #374151;
    transition: background 0.15s; border: 1px solid transparent;
}
.sl-prov-card:hover { background: #f9fafb; border-color: #e5e7eb; text-decoration: none; color: #374151; }
.sl-prov-boosted { border-color: #fde68a; background: #fffbeb; }
.sl-prov-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0;
    border: 2px solid #e5e7eb;
}
.sl-prov-boosted .sl-prov-avatar { border-color: #f59e0b; }
.sl-prov-info { flex: 1; min-width: 0; overflow: hidden; }
.sl-prov-name {
    font-size: 0.73rem; font-weight: 600; line-height: 1.2;
    display: flex; align-items: center; gap: 0.25rem;
}
.sl-prov-boost {
    color: #f59e0b; font-size: 0.6rem;
}
.sl-prov-role { font-size: 0.62rem; color: #9ca3af; }
.sl-prov-bio { font-size: 0.6rem; color: #9ca3af; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Ligne prestataire + bouton devis */
.sl-prov-row { display: flex; align-items: center; gap: 0.3rem; }
.sl-prov-row .sl-prov-card { flex: 1; min-width: 0; }
.sl-devis-btn {
    padding: 4px 8px; border-radius: 6px;
    border: 1px solid #3b82f6; background: #eff6ff;
    color: #1d4ed8; font-size: 0.62rem; font-weight: 700;
    cursor: pointer; white-space: nowrap;
    transition: all 0.15s; flex-shrink: 0;
}
.sl-devis-btn:hover { background: #3b82f6; color: #fff; }
.sl-devis-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Confirm devis inline */
.sl-devis-confirm {
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
    padding: 0.5rem; margin-top: 0.3rem;
    width: 100%;
}
.sl-devis-msg {
    width: 100%; border: 1px solid #d1d5db; border-radius: 6px;
    padding: 0.4rem; font-size: 0.72rem; resize: none;
    margin-bottom: 0.3rem;
}
.sl-devis-msg:focus { border-color: #3b82f6; outline: none; box-shadow: 0 0 0 2px #3b82f620; }
.sl-devis-actions { display: flex; gap: 0.3rem; justify-content: flex-end; }
.sl-devis-actions .btn { font-size: 0.68rem; padding: 2px 8px; }

.sl-prov-more {
    display: block; text-align: center;
    font-size: 0.7rem; color: #6b7280;
    text-decoration: none; padding: 0.35rem 0; margin-top: 0.2rem;
    border-radius: 6px; transition: background 0.15s;
}
.sl-prov-more:hover { background: #f3f4f6; color: #374151; text-decoration: none; }

.sl-section { margin-bottom: 1.5rem; }
.sl-section-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s;
}
.sl-section-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.sl-section-card.sl-open { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }

/* --- Section header (accordéon) --- */
.sl-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    background: #fafafa;
    border-bottom: 1px solid transparent;
    transition: background 0.2s;
}
.sl-section-header:hover { background: #f3f4f6; }
.sl-open .sl-section-header { border-bottom-color: #e5e7eb; background: #fff; }
.sl-section-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.9rem; flex-shrink: 0;
}
.sl-section-title { font-weight: 600; font-size: 0.95rem; flex: 1; color: #1f2937; }
.sl-section-badge {
    font-size: 0.7rem; padding: 2px 8px; border-radius: 99px;
    background: #e5e7eb; color: #6b7280; font-weight: 500;
}
.sl-section-badge.sl-filled { background: #d1fae5; color: #065f46; }
.sl-section-chevron {
    color: #9ca3af; transition: transform 0.25s; font-size: 0.8rem;
}
.sl-open .sl-section-chevron { transform: rotate(180deg); }

/* --- Section body --- */
.sl-section-body { padding: 1.25rem; display: none; }
.sl-open .sl-section-body { display: block; }

/* --- SVG Anatomie livre --- */
.sl-book-svg-wrap {
    display: flex; justify-content: center; align-items: center;
    padding: 1rem 0;
}
.sl-book-svg { max-width: 520px; width: 100%; height: auto; }
.sl-book-part {
    cursor: pointer; transition: opacity 0.2s, filter 0.2s;
}
.sl-book-part:hover { opacity: 0.85; filter: brightness(1.05); }
.sl-book-label {
    font-size: 11px; font-weight: 600; pointer-events: none;
    fill: #fff; text-anchor: middle;
}
.sl-book-sublabel {
    font-size: 9px; font-weight: 400; pointer-events: none;
    fill: rgba(255,255,255,0.8); text-anchor: middle;
}

/* --- Cartes de choix (style, format, reliure) --- */
.sl-choices {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.6rem;
}
.sl-choice-card {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}
.sl-choice-card:hover { border-color: #9ca3af; background: #f9fafb; }
.sl-choice-card.sl-selected {
    border-color: var(--sl-accent, #6366f1);
    background: color-mix(in srgb, var(--sl-accent, #6366f1) 6%, white);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sl-accent, #6366f1) 15%, transparent);
}
.sl-choice-icon { font-size: 1.3rem; margin-bottom: 0.3rem; color: #6b7280; }
.sl-choice-card.sl-selected .sl-choice-icon { color: var(--sl-accent, #6366f1); }
.sl-choice-label { font-size: 0.78rem; font-weight: 600; color: #374151; }
.sl-choice-desc { font-size: 0.68rem; color: #9ca3af; margin-top: 2px; }

/* --- Palette couleurs --- */
.sl-palette-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.sl-color-swatch {
    width: 36px; height: 36px; border-radius: 8px;
    border: 2px solid #e5e7eb; cursor: pointer;
    position: relative; transition: transform 0.15s;
}
.sl-color-swatch:hover { transform: scale(1.1); }
.sl-color-swatch input[type="color"] {
    opacity: 0; position: absolute; inset: 0;
    width: 100%; height: 100%; cursor: pointer; border: none;
}
.sl-color-add {
    width: 36px; height: 36px; border-radius: 8px;
    border: 2px dashed #d1d5db; display: flex;
    align-items: center; justify-content: center;
    cursor: pointer; color: #9ca3af; font-size: 1rem;
    transition: border-color 0.2s;
}
.sl-color-add:hover { border-color: #6b7280; color: #6b7280; }
.sl-color-remove {
    position: absolute; top: -6px; right: -6px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #ef4444; color: #fff; border: none;
    font-size: 0.55rem; display: none;
    align-items: center; justify-content: center;
    cursor: pointer; line-height: 1;
}
.sl-color-swatch:hover .sl-color-remove { display: flex; }

/* --- Dropzone upload --- */
.sl-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    transition: all 0.25s;
    cursor: pointer;
    background: #fafafa;
    position: relative;
}
.sl-dropzone:hover { border-color: #9ca3af; background: #f3f4f6; }
.sl-dropzone.sl-dragover {
    border-color: var(--sl-accent, #6366f1);
    background: color-mix(in srgb, var(--sl-accent, #6366f1) 5%, white);
}
.sl-dropzone-icon { font-size: 2rem; color: #9ca3af; margin-bottom: 0.5rem; }
.sl-dropzone-text { font-size: 0.85rem; color: #6b7280; }
.sl-dropzone-text strong { color: var(--sl-accent, #6366f1); }
.sl-dropzone input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

/* --- Aperçu image uploadée --- */
.sl-preview-wrap {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}
.sl-preview-wrap img {
    width: 100%; height: auto; display: block;
    max-height: 300px; object-fit: contain;
    background: repeating-conic-gradient(#f3f4f6 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}
.sl-preview-actions {
    position: absolute; top: 0.5rem; right: 0.5rem;
    display: flex; gap: 0.3rem;
}
.sl-preview-btn {
    width: 28px; height: 28px; border-radius: 6px;
    border: none; display: flex; align-items: center;
    justify-content: center; font-size: 0.75rem;
    cursor: pointer; backdrop-filter: blur(4px);
}
.sl-preview-btn.sl-btn-delete {
    background: rgba(239,68,68,0.85); color: #fff;
}
.sl-preview-btn.sl-btn-replace {
    background: rgba(255,255,255,0.85); color: #374151;
}

/* --- Inspirations gallery --- */
.sl-inspi-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.5rem;
}
.sl-inspi-item {
    position: relative; border-radius: 8px; overflow: hidden;
    border: 1px solid #e5e7eb; aspect-ratio: 1;
}
.sl-inspi-item img {
    width: 100%; height: 100%; object-fit: cover;
}
.sl-inspi-item .sl-inspi-remove {
    position: absolute; top: 4px; right: 4px;
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(239,68,68,0.85); color: #fff;
    border: none; font-size: 0.6rem;
    display: none; align-items: center; justify-content: center;
    cursor: pointer;
}
.sl-inspi-item:hover .sl-inspi-remove { display: flex; }
.sl-inspi-add {
    border: 2px dashed #d1d5db; border-radius: 8px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    cursor: pointer; color: #9ca3af;
    font-size: 0.75rem; gap: 0.25rem;
    aspect-ratio: 1; position: relative;
    transition: border-color 0.2s;
}
.sl-inspi-add:hover { border-color: #6b7280; }
.sl-inspi-add input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

/* --- Format dimensions visuels --- */
.sl-format-preview {
    display: flex; align-items: flex-end; justify-content: center;
    gap: 1rem; padding: 1rem; background: #f9fafb;
    border-radius: 10px; min-height: 140px;
}
.sl-format-book {
    border: 2px solid #6b7280; border-radius: 2px;
    background: #fff; position: relative;
    transition: all 0.3s; box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
}
.sl-format-dim {
    font-size: 0.7rem; color: #6b7280; text-align: center;
    margin-top: 0.3rem;
}

/* --- Brief textarea --- */
.sl-brief-textarea {
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
    width: 100%;
}
.sl-brief-textarea:focus {
    border-color: var(--sl-accent, #6366f1);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sl-accent, #6366f1) 12%, transparent);
    outline: none;
}

/* --- Help tips --- */
.sl-tip {
    display: flex; gap: 0.5rem; align-items: flex-start;
    background: #eff6ff; border-radius: 8px;
    padding: 0.6rem 0.75rem; margin-bottom: 0.75rem;
    font-size: 0.8rem; color: #1e40af;
}
.sl-tip i { margin-top: 2px; flex-shrink: 0; }

/* --- Save bar --- */
.sl-save-bar {
    position: sticky; bottom: 0;
    background: #fff; border-top: 1px solid #e5e7eb;
    padding: 0.75rem 1.25rem;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 10;
}
.sl-save-status { font-size: 0.8rem; color: #6b7280; }
.sl-save-status.sl-saved { color: #059669; }

/* --- Progress bar globale --- */
.sl-progress-bar {
    height: 6px; background: #e5e7eb; border-radius: 99px;
    overflow: hidden; margin-bottom: 1rem;
}
.sl-progress-fill {
    height: 100%; border-radius: 99px;
    background: var(--sl-accent, #6366f1);
    transition: width 0.4s ease;
}

/* --- Bouton Volt'R assistance IA --- */
.sl-voltr-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.25rem;
}
.sl-voltr-row .form-label { margin-bottom: 0; }
.sl-voltr-btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 3px 10px; border-radius: 6px; border: 1px solid #fbbf24;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #92400e; font-size: 0.72rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.sl-voltr-btn:hover {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    box-shadow: 0 1px 4px rgba(251,191,36,0.3);
    transform: translateY(-1px);
}
.sl-voltr-btn:disabled {
    opacity: 0.6; cursor: not-allowed; transform: none;
}
.sl-voltr-btn i { font-size: 0.75rem; }
.sl-voltr-btn .fa-spinner { color: #b45309; }

/* Volt'R result highlight */
@keyframes sl-voltr-flash {
    0% { box-shadow: 0 0 0 3px rgba(251,191,36,0.4); }
    100% { box-shadow: 0 0 0 0 rgba(251,191,36,0); }
}
.sl-voltr-filled { animation: sl-voltr-flash 1.5s ease-out; }

/* Volt'R plumes inline confirm panel */
.sl-voltr-confirm {
    background: #fffbeb; border: 1px solid #fde68a;
    border-radius: 8px; padding: 0.6rem 0.85rem;
    margin-top: 0.35rem; margin-bottom: 0.5rem;
    animation: sl-voltr-flash 0.4s ease;
}
.sl-voltr-confirm-inner {
    font-size: 0.8rem; color: #92400e; margin-bottom: 0.4rem;
    display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap;
}
.sl-voltr-confirm-inner .sl-plumes-cost {
    display: inline-flex; align-items: center; gap: 0.2rem;
    background: #fef3c7; color: #92400e; padding: 1px 8px;
    border-radius: 99px; font-weight: 700; font-size: 0.78rem;
}
.sl-voltr-confirm-actions {
    display: flex; gap: 0.4rem;
}
.sl-voltr-confirm-actions .btn { font-size: 0.78rem; padding: 0.25rem 0.75rem; border-radius: 6px; }
.sl-voltr-confirm-btn:hover { filter: brightness(1.1); }

/* --- Responsive --- */
@media (max-width: 860px) {
    .sl-layout { flex-direction: column; }
    .sl-preview-col { width: 100%; order: -1; }
    .sl-preview-sticky { position: static; }
    .sl-mockup { min-height: 160px; }
}
@media (max-width: 576px) {
    .sl-choices { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .sl-section-body { padding: 1rem; }
    .sl-inspi-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
    .sl-preview-col { display: none; }
}
