/* ============================================
   EDITOR STYLES — creer-faire-part.fr
   ============================================ */

.body-editor { background: var(--gray-100); overflow: hidden; }

/* Editor Header */
.editor-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
}

.editor-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: var(--gray-900);
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
}

.editor-header-actions { display: flex; align-items: center; gap: var(--space-4); }

.editor-autosave {
    font-size: var(--text-xs);
    color: var(--gray-500);
    padding: var(--space-1) var(--space-3);
    background: var(--gray-100);
    border-radius: var(--radius-full);
}

/* Editor Container */
.editor-container {
    display: flex;
    height: calc(100vh - 56px);
}

/* Left Panel */
.editor-panel {
    width: 420px;
    min-width: 420px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Wizard Steps */
.wizard-steps {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    flex-shrink: 0;
}

.wizard-step {
    flex: 1;
    padding: var(--space-3) var(--space-2);
    border: none;
    background: none;
    font-size: var(--text-xs);
    font-family: var(--font-body);
    color: var(--gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
}

.wizard-step:hover { color: var(--gray-600); }

.wizard-step.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: var(--font-semibold);
}

.wizard-step.completed { color: var(--success); }

.wizard-step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: var(--font-bold);
}

.wizard-step.active .wizard-step-num { background: var(--primary); color: var(--white); }
.wizard-step.completed .wizard-step-num { background: var(--success); color: var(--white); }

/* Wizard Panels */
.wizard-panel {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: var(--space-6);
}

.wizard-panel.active { display: block; }

.panel-title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-1);
}

.panel-subtitle {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-bottom: var(--space-6);
}

/* Wizard Navigation */
.wizard-nav {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--gray-200);
}

.wizard-nav .wizard-next { flex: 1; }

/* Type Selector */
.type-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.type-option input { display: none; }

.type-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.type-option-card:hover { border-color: var(--primary-light); }
.type-option input:checked + .type-option-card { border-color: var(--primary); background: rgba(212, 165, 116, 0.05); box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15); }

.type-option-icon { font-size: 28px; }
.type-option-label { font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--gray-700); }

/* Template Selector */
.template-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.template-option input { display: none; }

.template-option-card {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-3);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.template-option-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.template-option input:checked + .template-option-card { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2); }

.toc-circle { width: 36px; height: 36px; border-radius: 50%; margin-bottom: var(--space-2); }
.toc-title { font-size: var(--text-sm); font-weight: var(--font-semibold); }
.toc-sub { font-size: var(--text-xs); opacity: 0.7; }

/* Photo Upload */
.photo-upload { text-align: center; }

.photo-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px dashed var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-3);
    cursor: pointer;
    overflow: hidden;
    transition: border-color var(--transition-fast);
    background: var(--gray-50);
}

.photo-preview:hover { border-color: var(--primary); }

.photo-placeholder {
    font-size: var(--text-xs);
    color: var(--gray-400);
    padding: var(--space-3);
    text-align: center;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content form birth/wedding fields */
.birth-field { display: none; }
body[data-type="naissance"] .birth-field,
body[data-type="bapteme"] .birth-field { display: block; }

/* Style form */
.style-form { margin-bottom: var(--space-4); }

/* Export Section */
.export-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.export-card {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    position: relative;
}

.export-card--featured { border-color: var(--primary); background: rgba(212, 165, 116, 0.03); }

.export-card-badge {
    position: absolute;
    top: -10px;
    right: var(--space-4);
    background: var(--primary);
    color: var(--white);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
}

.export-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-3); }
.export-card-header h3 { font-family: var(--font-body); font-size: var(--text-base); font-weight: var(--font-semibold); margin: 0; }
.export-price { font-size: var(--text-xl); font-weight: var(--font-bold); color: var(--primary); }
.export-desc { font-size: var(--text-sm); color: var(--gray-500); margin-bottom: var(--space-4); }

.export-features { list-style: none; margin-bottom: var(--space-4); }
.export-features li { font-size: var(--text-sm); padding: var(--space-1) 0; color: var(--gray-600); }
.export-features li::before { content: '\2713'; color: var(--success); margin-right: var(--space-2); font-weight: bold; }

.save-draft-section { text-align: center; padding-top: var(--space-4); border-top: 1px solid var(--gray-200); }
.save-draft-text { font-size: var(--text-sm); color: var(--gray-500); margin-bottom: var(--space-3); }

/* Right Panel: Preview */
.editor-preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--gray-100);
    overflow: hidden;
}

.preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-6);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.preview-label { font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--gray-500); }
.preview-zoom-controls { display: flex; align-items: center; gap: var(--space-2); }
#zoomLevel { font-size: var(--text-xs); color: var(--gray-500); min-width: 40px; text-align: center; }

.preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: var(--space-8);
}

.preview-wrapper {
    transition: transform 0.2s ease;
}

/* Faire-Part Preview */
.fp-preview {
    width: 559px;
    height: 793px;
    background: var(--fp-bg, #faf8f5);
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
    font-family: var(--fp-font, 'Playfair Display', serif);
}

.fp-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    text-align: center;
    position: relative;
}

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.toast {
    background: var(--gray-900);
    color: var(--white);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.toast--success { background: #166534; }
.toast--error { background: #991b1b; }

.toast-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    font-size: 16px;
}

@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* Bannière faire-part payé (téléchargement HD débloqué) */
.export-paid-banner {
    background: linear-gradient(135deg, #f0f9f1, #e6f5ea);
    border: 1px solid #b7e0c0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}
.export-paid-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.export-paid-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2e9e54;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.export-paid-header h3 { margin: 0 0 2px; font-size: 17px; }
.export-paid-header p { margin: 0; font-size: 14px; color: #4a6b53; }
