/* ═══════════════════════════════════════════════════════════════════
   Moteur Flipbook — client.css
   ═══════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg-light); color: var(--text-dark); line-height: 1.6; }

/* ── HERO ─────────────────────────────────────────────────────── */
.hero { position: relative; min-height: 420px; display: flex; flex-direction: column; background-size: cover; background-position: center; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(13,26,46,.92) 0%, rgba(200,60,14,.7) 100%); }
.topbar { position: relative; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 16px 40px; border-bottom: 1px solid rgba(255,255,255,.08); }
.topbar-brand { color: rgba(255,255,255,.7); text-decoration: none; font-size: .85rem; font-weight: 500; transition: opacity .2s; }
.topbar-brand:hover { opacity: 1; color: white; }
.btn-contact-trigger { display: flex; align-items: center; gap: 7px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: white; padding: 9px 18px; border-radius: 30px; font-size: .85rem; font-weight: 500; cursor: pointer; transition: all .2s; }
.btn-contact-trigger:hover { background: var(--primary); border-color: var(--primary); }
.hero-content { position: relative; z-index: 5; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 40px 56px; gap: 14px; }
.hero-logo-wrap { background: white; border-radius: 14px; padding: 14px 24px; box-shadow: 0 8px 40px rgba(0,0,0,.3); margin-bottom: 4px; }
.hero-logo { height: 55px; max-width: 200px; object-fit: contain; display: block; }
.hero-title { font-size: clamp(1.3rem,2.8vw,1.9rem); font-weight: 700; color: white; max-width: 680px; text-shadow: 0 2px 12px rgba(0,0,0,.4); line-height: 1.3; }
.hero-slogan { font-size: .95rem; color: rgba(255,255,255,.8); max-width: 560px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; }
.badge { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: rgba(255,255,255,.9); padding: 5px 14px; border-radius: 20px; font-size: .73rem; font-weight: 500; }

/* ── MAIN ─────────────────────────────────────────────────────── */
.main-content { max-width: 1280px; margin: 0 auto; padding: 56px 40px 80px; }
.section-header { margin-bottom: 36px; }
.section-header h2 { font-size: 1.7rem; font-weight: 700; color: var(--secondary); }
.section-header h2::after { content: ''; display: block; width: 48px; height: 4px; background: var(--primary); border-radius: 2px; margin-top: 8px; }
.section-header p { color: #666; font-size: .9rem; margin-top: 10px; }

/* ── PDF GRID ─────────────────────────────────────────────────── */
.pdf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }

/* ── PDF CARD — style Livret 3D ──────────────────────────────── */
.pdf-card { background: var(--bg-card); border-radius: 14px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.07); border: 1px solid var(--border); cursor: pointer; transition: transform .28s cubic-bezier(.34,1.56,.64,1), box-shadow .28s; }
.pdf-card:hover { transform: translateY(-6px) scale(1.01); box-shadow: 0 18px 50px rgba(0,0,0,.13); }

/* Vignette */
.pdf-card-thumb { background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%); height: 190px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }

/* Lignes de pages (décor droite) */
.page-lines { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 5px; }
.page-lines span { display: block; width: 3px; height: 22px; background: rgba(255,255,255,.18); border-radius: 2px; }
.page-lines span:nth-child(2) { height: 30px; }
.page-lines span:nth-child(3) { height: 26px; }

/* Icône livre */
.book-icon { font-size: 3.2rem; filter: drop-shadow(0 4px 12px rgba(0,0,0,.35)); transition: transform .3s; }
.pdf-card:hover .book-icon { transform: scale(0.85); }

/* Badge taille */
.pdf-size-badge { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.45); color: white; font-size: .68rem; font-weight: 600; padding: 3px 9px; border-radius: 20px; backdrop-filter: blur(4px); }

/* Overlay hover "Feuilleter" */
.pdf-thumb-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; opacity: 0; transition: opacity .25s; }
.pdf-card:hover .pdf-thumb-overlay { opacity: 1; }
.btn-feuilleter { background: var(--accent); color: var(--secondary-dark); border: none; padding: 9px 22px; border-radius: 30px; font-size: .85rem; font-weight: 700; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,.3); transform: scale(.9); transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.pdf-card:hover .btn-feuilleter { transform: scale(1); }

/* Titre dans la vignette */
.pdf-thumb-title { position: absolute; bottom: 0; left: 0; right: 0; padding: 10px 14px; background: linear-gradient(transparent, rgba(0,0,0,.55)); color: white; font-size: .82rem; font-weight: 600; text-align: center; }

/* Footer de la card */
.pdf-card-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); }
.pdf-card-date { font-size: .75rem; color: #888; display: flex; align-items: center; gap: 4px; }
.btn-download { display: flex; align-items: center; gap: 5px; background: none; border: 1px solid var(--border); color: var(--secondary); font-size: .75rem; font-weight: 500; padding: 6px 12px; border-radius: 8px; cursor: pointer; transition: all .2s; }
.btn-download:hover { background: var(--primary); border-color: var(--primary); color: white; }

/* ── EMPTY STATE ──────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 80px 20px; color: #aaa; }
.empty-icon { font-size: 4rem; margin-bottom: 12px; }

/* ── FOOTER ───────────────────────────────────────────────────── */
.site-footer { background: var(--secondary-dark); color: rgba(255,255,255,.7); padding: 36px 40px; }
.footer-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.footer-logo { height: 42px; object-fit: contain; background: white; border-radius: 8px; padding: 4px 12px; }
.footer-contact { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-contact a { color: rgba(255,255,255,.7); text-decoration: none; font-size: .83rem; transition: color .2s; }
.footer-contact a:hover { color: var(--primary-light); }
.footer-copy { margin-left: auto; font-size: .76rem; opacity: .45; }

/* ── FAB ──────────────────────────────────────────────────────── */
.fab-contact { position: fixed; bottom: 30px; right: 30px; z-index: 800; width: 54px; height: 54px; border-radius: 50%; background: var(--primary); color: white; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(0,0,0,.3); transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.fab-contact:hover { transform: scale(1.12); }

/* ── MODAL CONTACT ────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .3s; }
.modal-backdrop.active { opacity: 1; pointer-events: all; }
.modal-box { background: white; border-radius: 20px; width: 100%; max-width: 540px; box-shadow: 0 24px 80px rgba(0,0,0,.25); overflow: hidden; transform: translateY(20px) scale(.97); transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.modal-backdrop.active .modal-box { transform: translateY(0) scale(1); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 26px 18px; background: linear-gradient(135deg, var(--secondary), var(--secondary-dark)); color: white; }
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-header p { font-size: .8rem; opacity: .7; margin-top: 2px; }
.modal-close { background: rgba(255,255,255,.15); border: none; color: white; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: .85rem; display: flex; align-items: center; justify-content: center; transition: background .2s; flex-shrink: 0; }
.modal-close:hover { background: rgba(255,255,255,.3); }
#contactForm, .contact-success { padding: 22px 26px 26px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-group label { font-size: .75rem; font-weight: 600; color: #555; text-transform: uppercase; letter-spacing: .04em; }
.form-group input, .form-group textarea { border: 1.5px solid #e5e7eb; border-radius: 10px; padding: 9px 13px; font-size: .88rem; font-family: inherit; color: var(--text-dark); transition: border-color .2s, box-shadow .2s; background: #fafafa; outline: none; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); background: white; }
.form-group textarea { resize: vertical; min-height: 90px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.btn-cancel { background: #f3f4f6; border: none; color: #555; padding: 10px 20px; border-radius: 10px; font-size: .86rem; font-weight: 500; cursor: pointer; transition: background .2s; }
.btn-cancel:hover { background: #e5e7eb; }
.btn-send { display: flex; align-items: center; gap: 7px; background: var(--primary); border: none; color: white; padding: 10px 22px; border-radius: 10px; font-size: .86rem; font-weight: 600; cursor: pointer; transition: background .2s, transform .15s; }
.btn-send:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-send:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.contact-success { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 26px; }
.success-icon { font-size: 2.8rem; }
.contact-success h4 { font-size: 1.15rem; font-weight: 700; color: var(--secondary); }
.contact-success p { color: #666; font-size: .88rem; }

/* ── FLIPBOOK OVERLAY ─────────────────────────────────────────── */
.flipbook-overlay { position: fixed; inset: 0; z-index: 1000; background: #111827; display: flex; flex-direction: column; opacity: 0; pointer-events: none; transition: opacity .3s; }
.flipbook-overlay.active { opacity: 1; pointer-events: all; }

.flipbook-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.08); flex-shrink: 0; gap: 12px; }
.flipbook-title-area { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.flipbook-logo { height: 30px; object-fit: contain; border-radius: 6px; background: white; padding: 3px 8px; flex-shrink: 0; }
#flipbookTitle { color: rgba(255,255,255,.9); font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flipbook-controls { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.flipbook-controls button { width: 34px; height: 34px; border-radius: 8px; border: none; background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.flipbook-controls button:hover:not(:disabled) { background: var(--primary); color: white; }
.flipbook-controls button:disabled { opacity: .3; cursor: not-allowed; }
.btn-close-flip { background: rgba(220,50,50,.15) !important; color: #f87171 !important; margin-left: 6px; }
.btn-close-flip:hover { background: #dc3545 !important; color: white !important; }
.controls-sep { width: 1px; height: 22px; background: rgba(255,255,255,.12); margin: 0 4px; }

/* Stage + spinner */
.flipbook-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; background: radial-gradient(ellipse at center, #1e2d40 0%, #0d1520 100%); position: relative; }
.flipbook-loading { display: flex; flex-direction: column; align-items: center; gap: 14px; color: rgba(255,255,255,.6); font-size: .88rem; }
.loading-bar-wrap { width: 220px; height: 4px; background: rgba(255,255,255,.1); border-radius: 2px; overflow: hidden; }
.loading-bar { height: 100%; background: var(--primary); border-radius: 2px; width: 0%; transition: width .3s; }
.loading-spinner { width: 38px; height: 38px; border: 3px solid rgba(255,255,255,.1); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* StPageFlip container */
#flipContainer { display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; }
.stf__parent { user-select: none; }

/* Navigation bas */
.flipbook-nav { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 10px 20px; background: rgba(0,0,0,.35); border-top: 1px solid rgba(255,255,255,.06); flex-shrink: 0; }
.flipbook-nav button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.flipbook-nav button:hover:not(:disabled) { background: var(--primary); border-color: var(--primary); }
.flipbook-nav button:disabled { opacity: .3; cursor: not-allowed; }
.page-indicator { color: rgba(255,255,255,.7); font-size: .82rem; font-weight: 500; min-width: 80px; text-align: center; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero { min-height: 340px; }
    .topbar, .hero-content, .main-content { padding-left: 20px; padding-right: 20px; }
    .pdf-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
    .form-row { grid-template-columns: 1fr; }
    .site-footer { padding: 28px 20px; }
    .footer-copy { margin-left: 0; width: 100%; }
}

/* ── VISIONNEUSE DE DEFILEMENT VERTICAL (PREVIEW) ─────────────────── */
:root {
    --preview-zoom: 1;
}

#previewContainer {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 30px 15px;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

#previewContainer canvas {
    max-width: 95%;
    width: calc(820px * var(--preview-zoom));
    height: auto !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    border-radius: 6px;
    background-color: white;
    transition: width 0.15s ease-out;
}

/* Styles spécifiques pour Flyers & Affiches */
.flyer-thumb {
    background: linear-gradient(135deg, #1E1B4B 0%, #311042 100%) !important;
}

.flyer-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.35));
    transition: transform 0.3s;
}
.pdf-card:hover .flyer-icon {
    transform: scale(0.9) rotate(2deg);
}

/* Styles spécifiques pour Prospectus */
.prospectus-thumb {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%) !important;
}

.prospectus-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.35));
    transition: transform 0.3s;
}
.pdf-card:hover .prospectus-icon {
    transform: scale(0.9) translateY(-2px);
}

