/* RécréaBook Creator — Wizard
 * Charte : Poppins, bleu --rb-primary (injecté en :root par le plugin),
 * coins arrondis, ton familial.
 */

.rb-wizard {
    font-family: 'Poppins', system-ui, -apple-system, Segoe UI, sans-serif;
    color: #1a2238;
    max-width: 880px;
    margin: 24px auto;
    padding: 0 16px;
    line-height: 1.5;
    /* Cree un contexte d'empilement au-dessus des sections Elementor en pied
       de page qui utilisent margin-top negatif et remontent par-dessus la fin
       du contenu (cas du template 'Pied de page #1194' : section avec
       margin-top:-84px qui couvrait les boutons d'action). */
    position: relative;
    z-index: 10;
}

.rb-header { text-align: center; margin-bottom: 24px; }
.rb-restart {
    display: inline-flex !important;
    align-items: center; justify-content: center;
    margin-top: 10px;
    background: transparent !important;
    border: 1px dashed #d4dbeb !important;
    color: #5a6680 !important;
    border-radius: 999px !important;
    padding: 6px 14px !important;
    font-size: .82rem !important;
    font-family: inherit;
    cursor: pointer !important;
    min-height: 0 !important;
}
.rb-restart:hover { background: #fbe9e7 !important; color: #b3261e !important; border-color: #f6c1bb !important; }
.rb-welcome {
    display: inline-block;
    background: #eef4ff;
    color: #2d3b58;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: .95rem;
    margin: 0 0 12px;
}
.rb-welcome strong { color: var(--rb-primary, #1E5BD8); }
.rb-title  { font-size: 2rem; font-weight: 700; margin: 0; color: var(--rb-primary, #1E5BD8); }
.rb-subtitle { color: #5a6680; margin-top: 4px; }

/* ---------- Stepper ---------- */
.rb-stepper ol {
    display: flex; flex-wrap: wrap; gap: 12px;
    list-style: none; padding: 0; margin: 0 0 28px;
    justify-content: center;
}
.rb-step {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: 999px;
    background: #eef2fb; color: #5a6680; font-weight: 600; font-size: .95rem;
    transition: all .2s ease;
}
.rb-step span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: #fff; color: #5a6680; font-size: .85rem; font-weight: 700;
}
.rb-step.is-active { background: var(--rb-primary, #1E5BD8); color: #fff; box-shadow: 0 4px 16px rgba(30,91,216,.25); }
.rb-step.is-active span { background: #fff; color: var(--rb-primary, #1E5BD8); }
.rb-step.is-done   { background: #e6f4ea; color: #137333; }
.rb-step.is-done span { background: #137333; color: #fff; }

/* ---------- Panels ---------- */
.rb-panel { display: none; background: #fff; border: 1px solid #e3e8f3; border-radius: 20px; padding: 28px; box-shadow: 0 6px 24px rgba(20,30,60,.04); }
.rb-panel.is-active { display: block; }
.rb-panel h2 { margin-top: 0; color: var(--rb-primary, #1E5BD8); }

/* ---------- Fields ---------- */
.rb-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.rb-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.rb-label { font-weight: 600; font-size: .9rem; color: #2d3b58; }
.rb-field input[type="text"],
.rb-field input[type="number"],
.rb-field input[type="file"],
.rb-field select,
.rb-field textarea {
    border: 1px solid #d4dbeb; border-radius: 12px; padding: 10px 12px;
    font: inherit; color: inherit; background: #fbfcff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.rb-field input:focus,
.rb-field select:focus,
.rb-field textarea:focus {
    border-color: var(--rb-primary, #1E5BD8);
    box-shadow: 0 0 0 3px rgba(30,91,216,.12);
    outline: none;
}
.rb-hint { font-size: .85rem; color: #5a6680; margin-top: 4px; }
.rb-hint.is-bad { color: #b3261e; font-weight: 600; }

/* ---------- Spinner réutilisable ---------- */
.rb-spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 3px solid rgba(30, 91, 216, .22);
    border-top-color: var(--rb-primary, #1E5BD8);
    border-radius: 50%;
    animation: rb-spin .8s linear infinite;
    vertical-align: -3px;
    margin-right: 8px;
}
.rb-spinner--lg {
    width: 48px; height: 48px; border-width: 5px;
    margin: 0 auto 12px; display: block;
}
@keyframes rb-spin { to { transform: rotate(360deg); } }

.rb-loading {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; padding: 28px 16px;
    color: #5a6680; font-weight: 600;
}

/* ---------- Étape 0 : choix nb personnages ---------- */
.rb-step0__hint {
    color: #5a6680;
    margin: 4px 0 18px;
}
.rb-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 14px;
}
.rb-tile {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 28px 18px;
    background: #f8faff;
    border: 2px solid #e3e8f3;
    border-radius: 18px;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: border-color .15s ease, background .15s ease, transform .1s ease;
    min-height: 160px;
}
.rb-tile:hover { border-color: var(--rb-primary, #1E5BD8); background: #eef4ff; }
.rb-tile:active { transform: scale(.98); }
.rb-tile.is-selected { border-color: var(--rb-primary, #1E5BD8); background: #eef4ff; }
.rb-tile__icon {
    font-size: 2.2rem;
    line-height: 1;
}
.rb-tile__num {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--rb-primary, #1E5BD8);
    line-height: 1;
}
.rb-tile__label {
    color: #2d3b58;
    font-weight: 600;
    font-size: 1rem;
}
.rb-tile * { pointer-events: none; }

/* ---------- Personnages (étape 1) ---------- */
.rb-characters { display: grid; gap: 18px; }
.rb-character {
    border: 1px solid #e3e8f3; border-radius: 18px; padding: 18px;
    background: #f8faff;
}
.rb-character legend {
    font-weight: 700; color: var(--rb-primary, #1E5BD8);
    padding: 0 8px; background: #fff; border-radius: 8px;
}
.rb-character__n { color: #5a6680; font-weight: 500; }
.rb-photo { display: flex; gap: 16px; align-items: flex-start; margin-top: 8px; }
.rb-avatar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }

/* Zone previews : photo originale (recadrée) à côté de l'avatar généré. */
.rb-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin-top: 16px;
    align-items: center;
    justify-content: flex-start;
}
.rb-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.rb-preview__label {
    font-size: .85rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .03em;
}
/* Si l'image enfant est hidden, on masque toute la figure (label + image). */
.rb-preview:has(> img[hidden]) { display: none; }

.rb-photo__preview {
    width: 140px;
    height: 140px;
    border-radius: 14px;
    object-fit: cover;
    border: 2px solid #d4dbeb;
    background: #fff;
}
.rb-avatar__img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 3px solid var(--rb-primary, #1E5BD8);
    background: #fff;
    object-fit: cover;
}
.rb-status { font-size: .85rem; color: #5a6680; }

/* ---------- Couvertures (étape 3) ---------- */
.rb-covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 18px; }
.rb-cover-card {
    position: relative; display: flex; flex-direction: column; gap: 10px;
    border: 2px solid transparent; border-radius: 16px; padding: 12px;
    background: #f8faff; text-align: center;
    transition: border-color .15s ease, transform .15s ease;
}
.rb-cover-card.is-chosen { border-color: var(--rb-primary, #1E5BD8); background: #eef4ff; }
.rb-cover-card img {
    width: 100%; aspect-ratio: 1 / 1; height: auto;
    object-fit: cover; border-radius: 10px;
    background: #eef2fb;
}
.rb-cover-card__cta {
    width: 100%; white-space: normal; word-break: break-word; line-height: 1.25;
    padding: 10px 12px; font-size: .9rem;
}
.rb-cover-card__tag {
    position: absolute; top: 14px; left: 14px;
    background: var(--rb-primary, #1E5BD8); color: #fff;
    border-radius: 999px; padding: 2px 10px; font-weight: 700; font-size: .8rem;
    z-index: 1;
}
.rb-cover-slot {
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 1 / 1; min-height: 220px; border: 2px dashed #d4dbeb;
    border-radius: 16px; background: #fbfcff;
}

/* ---------- Modal feedback ---------- */
.rb-modal {
    position: fixed; inset: 0; background: rgba(20,30,60,.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; padding: 16px;
}
.rb-modal[hidden] { display: none !important; }
.rb-modal__card {
    background: #fff; border-radius: 20px; padding: 24px;
    max-width: 480px; width: 100%;
    box-shadow: 0 20px 50px rgba(20,30,60,.25);
}
.rb-modal__card h3 { margin-top: 0; color: var(--rb-primary, #1E5BD8); }
.rb-modal__card textarea {
    width: 100%; box-sizing: border-box;
    border: 1px solid #d4dbeb; border-radius: 12px; padding: 10px 12px; font: inherit;
}

/* ---------- Lightbox couverture (zoom) ---------- */
.rb-modal--zoom { background: rgba(10,18,40,.88); padding: 16px; flex-direction: column; gap: 12px; }
.rb-modal--zoom img {
    max-width: min(92vw, 800px); max-height: 70vh; width: auto; height: auto;
    border-radius: 14px; box-shadow: 0 30px 60px rgba(0,0,0,.4);
    background: #fff; object-fit: contain;
}
/* Bouton × : très visible, position fixe en haut à droite, par-dessus tout */
.rb-modal__close {
    position: fixed; top: 18px; right: 22px;
    width: 48px; height: 48px; border-radius: 50%;
    background: #fff; color: #1a2238;
    border: 0; font-size: 32px; line-height: 1; font-weight: 300; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px rgba(0,0,0,.35);
    transition: transform .15s ease, background .15s ease;
    z-index: 10000;
}
.rb-modal__close:hover { background: #1E5BD8; color: #fff; transform: scale(1.08); }
.rb-modal__caption { color: #fff; font-weight: 600; opacity: .9; font-size: .95rem; }
.rb-modal__close-btn { margin-top: 4px; min-width: 160px; }

/* Carte cover : image cliquable pour le zoom (sans wrapper <button> pour éviter
   les styles globaux du thème qui dénaturent l'image en bouton coloré). */
.rb-cover-card__media {
    position: relative; border-radius: 12px; overflow: hidden;
}
.rb-cover-card__img {
    display: block; width: 100%; aspect-ratio: 1 / 1; height: auto;
    object-fit: cover; background: #eef2fb;
    cursor: zoom-in;
    transition: transform .25s ease;
}
.rb-cover-card__media:hover .rb-cover-card__img { transform: scale(1.03); }
.rb-cover-card__img:focus-visible { outline: 2px solid var(--rb-primary, #1E5BD8); outline-offset: 2px; }
.rb-cover-card__zoom-hint {
    position: absolute; top: 8px; right: 8px;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,.92); color: #1E5BD8;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.15);
    opacity: 0; transition: opacity .15s ease;
    pointer-events: none;
}
.rb-cover-card__media:hover .rb-cover-card__zoom-hint { opacity: 1; }

/* ---------- Pricing (étape 4) ---------- */
.rb-info {
    background: #eef4ff; border-radius: 14px; padding: 16px 18px;
    margin-bottom: 18px; font-size: .95rem; color: #2d3b58;
}
.rb-info p { margin: 0 0 8px; }
.rb-info p:last-child { margin-bottom: 0; }

.rb-pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 14px; margin: 18px 0; }
.rb-pricing__card {
    position: relative; display: flex; flex-direction: column; gap: 8px;
    padding: 20px; border: 2px solid #e3e8f3; border-radius: 16px;
    background: #fff; cursor: pointer; font: inherit; color: inherit;
    text-align: left;
    transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.rb-pricing__card:hover { border-color: var(--rb-primary, #1E5BD8); background: #f8faff; }
.rb-pricing__card.is-selected { border-color: var(--rb-primary, #1E5BD8); background: #eef4ff; }
.rb-pricing__desc { font-size: .85rem; color: #5a6680; line-height: 1.4; }
.rb-price {
    display: block !important;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--rb-primary, #1E5BD8);
    margin-top: 4px;
}
.rb-badge {
    position: absolute !important;
    top: 12px; right: 12px;
    background: #ffe9a8;
    color: #6b4f00;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.2;
    z-index: 1;
    max-width: 110px;
    white-space: nowrap;
}

/* ---------- Compte client (étape 4) — bande pleine largeur AU-DESSUS des cartes ---------- */
.rb-account-box {
    display: block !important;
    width: 100%;
    margin: 18px 0;
    clear: both;
    position: static !important;
}
.rb-account-box:empty { display: none !important; }
.rb-account-required {
    background: #fff7e6; border: 1px solid #ffd591; border-radius: 14px;
    padding: 18px 20px;
}
.rb-account-required h4 { margin: 0 0 6px; color: #6b4f00; }
.rb-account-required p  { margin: 0 0 12px; color: #6b4f00; font-size: .95rem; }
.rb-account-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.rb-account-actions .rb-btn { text-decoration: none; display: inline-flex; align-items: center; }

.rb-account-logged {
    display: flex !important;
    gap: 14px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    background: #eaf8ee;
    border: 1px solid #c6e8d2;
    border-radius: 14px;
    padding: 14px 18px;
    position: static !important;
}
.rb-account-logged__icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: #137333; color: #fff; font-weight: 800;
}
.rb-account-logged__title { margin: 0; color: #2d3b58; }
.rb-account-logged__email { margin: 2px 0 0; color: #5a6680; font-size: .9rem; }

/* ---------- Paiement / récap ---------- */
.rb-pay-card { max-width: 520px; }
.rb-summary { list-style: none; padding: 0; margin: 12px 0; }
.rb-summary li { padding: 8px 0; border-bottom: 1px solid #eef2fb; font-size: .95rem; }
.rb-summary li:last-child { border-bottom: none; }

.rb-success {
    background: linear-gradient(135deg, #eaf8ee 0%, #f8faff 100%);
    border: 2px solid #c6e8d2; border-radius: 18px; padding: 24px;
}
.rb-success h3 { color: #137333; margin-top: 0; }

.rb-recap__head { display: flex; gap: 18px; align-items: center; margin-top: 12px; }
.rb-recap__cover {
    width: 110px; height: 110px; aspect-ratio: 1/1;
    object-fit: cover; border-radius: 14px;
    border: 3px solid var(--rb-primary, #1E5BD8);
}
.rb-recap__ref { font-size: .8rem; color: #5a6680; text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.rb-recap__price { font-size: 1.3rem; font-weight: 700; color: var(--rb-primary, #1E5BD8); margin: 4px 0 0; }
.rb-recap__price span { font-size: .85rem; font-weight: 500; color: #5a6680; }
.rb-recap__next { padding-left: 0; list-style: none; }
.rb-recap__next li { padding: 8px 0; line-height: 1.5; }
@media (max-width: 480px) {
    .rb-recap__head { flex-direction: column; text-align: center; }
}

/* ---------- Buttons ---------- */
.rb-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; justify-content: flex-end; }

/* ============================================================
   BOUTONS — règle : l'élément cliquable PORTE tout le visuel.
   display:inline-flex + align/justify center pour que le bouton
   soit aussi grand que sa peinture (padding + min-height).
   ============================================================ */
html body .rb-wizard .rb-btn.rb-btn,
html body .rb-wizard a.rb-btn,
html body .rb-create-btn,
html body a.rb-create-btn {
    /* Le theme (Normalize) applique -webkit-appearance:button aux <button>,
       ce qui reduit la zone de hit-test a la hauteur native du controle :
       le bouton parait grand (padding/min-height peints) mais seul le haut
       est cliquable. On neutralise ici pour rendre TOUTE la boite CSS cliquable. */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 56px !important;       /* zone tactile/clic large */
    padding: 14px 28px !important;
    border: none;
    border-radius: 12px;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer !important;
    user-select: none;
}

/* Dans une rangée .rb-actions, les boutons s'étirent pour occuper la rangée :
   zone visible = zone cliquable, sur toute la largeur. */
html body .rb-wizard .rb-actions { gap: 12px; }
html body .rb-wizard .rb-actions > .rb-btn.rb-btn,
html body .rb-wizard .rb-actions > a.rb-btn {
    flex: 1 1 0 !important;
    min-width: 0;
}

/* Cartes formules (étape 4) : la carte ENTIÈRE est cliquable, plein largeur.
   Layout vertical strict — titre / prix / desc empilés, badge en haut-droite. */
html body .rb-wizard .rb-pricing__card.rb-pricing__card {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 24px 22px;
    cursor: pointer !important;
    text-align: left;
    overflow: visible !important;   /* rien ne doit être tronqué */
    position: relative !important;  /* ancre pour le badge absolu */
}
/* Forçage des enfants en flux normal — anti-superposition. */
html body .rb-wizard .rb-pricing__card > *:not(.rb-badge) {
    position: static !important;
    display: block;
    width: auto;
    max-width: 100%;
    overflow: visible !important;
}
.rb-pricing__head {
    display: block !important;
    margin: 0;
}
.rb-pricing__title {
    display: block !important;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1a2238;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: visible !important;
    white-space: normal !important;
}
.rb-pricing__desc {
    display: block !important;
    color: #5a6680;
    font-size: .9rem;
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
/* ---------- Sélecteur de quantité (étape 4, formule "Numérique + papier") ---------- */
.rb-qty-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
    margin: 12px 0 18px;
    background: #eef4ff;
    border: 1px solid #cfddf7;
    border-radius: 14px;
}
.rb-qty-box[hidden] { display: none !important; }
.rb-qty-label {
    font-weight: 600;
    color: #2d3b58;
    font-size: .95rem;
}
.rb-qty {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #cfddf7;
    border-radius: 12px;
    background: #fff;
    width: max-content;
    overflow: hidden;
}
.rb-qty__btn {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
    font-weight: 700;
    background: #fff;
    color: var(--rb-primary, #1E5BD8);
    border: none;
    cursor: pointer;
    line-height: 1;
}
.rb-qty__btn:hover:not(:disabled) { background: #eef4ff; }
.rb-qty__btn:disabled { color: #b6becf; cursor: not-allowed; }
.rb-qty__input {
    width: 64px;
    height: 44px;
    text-align: center;
    border: none;
    border-left: 1px solid #cfddf7;
    border-right: 1px solid #cfddf7;
    background: #fff;
    font: inherit;
    font-weight: 700;
    color: #1a2238;
    -moz-appearance: textfield;
}
.rb-qty__input::-webkit-inner-spin-button,
.rb-qty__input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.rb-qty__input:focus { outline: none; box-shadow: 0 0 0 3px rgba(30,91,216,.18) inset; }
.rb-qty__breakdown {
    margin: 0;
    color: #2d3b58;
    font-size: .95rem;
    line-height: 1.5;
}
.rb-qty__breakdown strong {
    color: var(--rb-primary, #1E5BD8);
    font-size: 1.1rem;
}
.rb-qty__breakdown small { color: #5a6680; }

.rb-formula-label {
    margin: 20px 0 10px;
    color: #2d3b58;
    font-weight: 600;
}

/* Bouton "Choisir cette version" sous les couvertures : plein largeur, centré. */
html body .rb-wizard .rb-cover-card__cta.rb-cover-card__cta {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    white-space: normal;
    word-break: break-word;
    cursor: pointer !important;
}

/* Input file (upload photo) : curseur pointer sur tout le contrôle + son bouton natif. */
html body .rb-wizard input[type="file"],
html body .rb-wizard input[type="file"]::file-selector-button {
    cursor: pointer !important;
}

/* Les enfants des boutons ne capturent ni le curseur ni les clics :
   le hover/click est porté par le PARENT cliquable.
   Exception : la carte verticale (--vertical) n'est PAS cliquable elle-même —
   ses enfants (CTA "Commander", stepper qty) doivent recevoir les clics. */
.rb-wizard .rb-btn *,
.rb-wizard a.rb-btn *,
.rb-wizard .rb-pricing__card:not(.rb-pricing__card--vertical) *,
.rb-wizard .rb-cover-card__cta *,
.rb-create-btn * {
    pointer-events: none;
    cursor: inherit !important;
}

/* Disabled : not-allowed sans ambiguïté. */
html body .rb-wizard .rb-btn.rb-btn:disabled,
html body .rb-wizard a.rb-btn[aria-disabled="true"] {
    cursor: not-allowed !important;
}

/* Couleurs — la géométrie est définie dans la règle principale plus haut.
   Pas de box-shadow ni transform : sinon l'ombre extérieure trompe sur la zone clic. */
.rb-btn { transition: background .15s ease, opacity .15s ease, filter .15s ease; }
.rb-btn:disabled { opacity: .45; }
.rb-btn,
.rb-btn:hover,
.rb-btn:focus {
    box-shadow: none !important;
    transform: none !important;
}
.rb-btn--primary { background: var(--rb-primary, #1E5BD8) !important; color: #fff !important; }
.rb-btn--primary:hover:not(:disabled) { background: #1947a8 !important; }
.rb-btn--ghost   { background: #eef2fb !important; color: #2d3b58 !important; }
.rb-btn--ghost:hover:not(:disabled)   { background: #dde4f5 !important; }

/* ===== Étape 4 refonte : fiches produit verticales (anti-bug "boutons absolute") ===== */
html body .rb-wizard .rb-pricing--cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin: 18px 0;
    align-items: stretch;
}
@media (max-width: 720px) {
    html body .rb-wizard .rb-pricing--cards { grid-template-columns: 1fr; }
}

html body .rb-wizard .rb-pricing__card--vertical {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 24px 22px;
    text-align: center;
    cursor: default;
    background: #fff;
    border: 2px solid #e3e8f3;
    border-radius: 16px;
    position: relative;
    overflow: visible;
    transition: border-color .15s ease, box-shadow .15s ease;
}
html body .rb-wizard .rb-pricing__card--vertical:hover { border-color: var(--rb-primary, #1E5BD8); }
html body .rb-wizard .rb-pricing__card--featured {
    border-color: var(--rb-primary, #1E5BD8);
    box-shadow: 0 4px 14px rgba(30,91,216,0.12);
}

/* Couverture portrait + fallback */
.rb-pricing__cover {
    position: relative;
    width: 150px; height: 212px;
    margin: 0 auto 6px;
    border-radius: 12px;
    overflow: hidden;
    background: #eef4ff;
    box-shadow: 0 8px 20px rgba(30,91,216,0.18);
    display: flex; align-items: center; justify-content: center;
}
.rb-pricing__cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    position: relative; z-index: 1;
}
.rb-pricing__cover img:not([src]),
.rb-pricing__cover img[src=""] { display: none; }

/* Centrage + hiérarchie typo dans la carte verticale */
html body .rb-wizard .rb-pricing__card--vertical .rb-pricing__title { text-align: center; font-size: 1.1rem; margin: 4px 0 0; }
html body .rb-wizard .rb-pricing__card--vertical .rb-price          { text-align: center; font-size: 1.8rem; margin: 2px 0 6px; }
html body .rb-wizard .rb-pricing__card--vertical .rb-pricing__desc  { text-align: center; flex: 1 1 auto; margin: 0; }

/* qty-box inline dans la carte book_digital */
.rb-qty-box.rb-qty-box--inline { margin: 6px 0 0; padding: 12px 14px; }
.rb-qty-box.rb-qty-box--inline .rb-qty { align-self: center; }

/* CTA pleine largeur calé en bas, avec affordance "cliquable" marquée */
html body .rb-wizard .rb-pricing__cta {
    width: 100%;
    margin-top: auto;
    cursor: pointer !important;
    min-height: 48px;
    font-weight: 700 !important;
    letter-spacing: .01em;
    border: 2px solid transparent !important;
    box-shadow: 0 2px 0 rgba(30,91,216,0.15) !important;
    transition: background .15s ease, box-shadow .15s ease, transform .08s ease !important;
}
html body .rb-wizard .rb-pricing__cta:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(30,91,216,0.22) !important;
    transform: translateY(-1px) !important;
}
html body .rb-wizard .rb-pricing__cta:active:not(:disabled) {
    transform: translateY(0) !important;
    box-shadow: 0 1px 0 rgba(30,91,216,0.15) !important;
}

/* Lien "Retour" discret sous les blocs */
.rb-back-row  { text-align: center; margin: 10px 0 0; }
.rb-back-link { color: #5a6680; font-size: .9rem; text-decoration: underline; background: transparent; border: 0; cursor: pointer; }
.rb-back-link:hover { color: var(--rb-primary, #1E5BD8); }

/* ---------- Re-commande (page /recommander/) ---------- */
.rb-reorder-card {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: center;
    padding: 22px;
    background: #fff;
    border: 1px solid #e3e8f3;
    border-radius: 16px;
    margin: 18px 0;
}
.rb-reorder-cover img {
    width: 100%;
    max-width: 220px;
    border-radius: 14px;
    border: 1px solid #e3e8f3;
    display: block;
}
.rb-reorder-info .rb-pricing__title { font-size: 1.4rem; margin: 6px 0 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .rb-panel { padding: 18px; }
    .rb-grid  { grid-template-columns: 1fr; }
    .rb-stepper ol { gap: 6px; }
    .rb-step  { padding: 8px 12px; font-size: .85rem; }
    .rb-photo { flex-direction: column; }
    .rb-reorder-card { grid-template-columns: 1fr; }
}

/* === Modal de cadrage photo (impl. native, étape 1) === */
.rb-crop-card {
    max-width: 520px;
    width: 95vw;
    text-align: center;
}
.rb-modal__title { margin: 0 0 4px; color: var(--rb-primary, #1E5BD8); }
.rb-modal__desc { margin: 0 0 16px; color: #475569; font-size: .92rem; }

/* Carré fixe 400×400 : l'image est positionnée en absolute et plus grande
   que le stage, overflow:hidden la "découpe" → c'est ce qu'on voit qui sera
   sauvegardé après crop. */
.rb-crop-stage {
    position: relative;
    width: 400px;
    height: 400px;
    max-width: 90vw;
    margin: 0 auto;
    background: #f1f5f9;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--rb-primary, #1E5BD8);
    box-shadow: 0 0 0 9999px rgba(255,255,255,0); /* placeholder */
}
.rb-crop-stage > img {
    display: block;
    position: absolute;
    user-select: none;
    -webkit-user-drag: none;
}
/* Grille de guidage pour aider le cadrage (règle des tiers) */
.rb-crop-stage::before,
.rb-crop-stage::after {
    content: '';
    position: absolute;
    pointer-events: none;
    z-index: 10;
}
.rb-crop-stage::before {
    inset: 0;
    background:
        linear-gradient(to right, transparent calc(33.333% - .5px), rgba(255,255,255,.4) calc(33.333% - .5px) calc(33.333% + .5px), transparent calc(33.333% + .5px)),
        linear-gradient(to right, transparent calc(66.666% - .5px), rgba(255,255,255,.4) calc(66.666% - .5px) calc(66.666% + .5px), transparent calc(66.666% + .5px)),
        linear-gradient(to bottom, transparent calc(33.333% - .5px), rgba(255,255,255,.4) calc(33.333% - .5px) calc(33.333% + .5px), transparent calc(33.333% + .5px)),
        linear-gradient(to bottom, transparent calc(66.666% - .5px), rgba(255,255,255,.4) calc(66.666% - .5px) calc(66.666% + .5px), transparent calc(66.666% + .5px));
}

.rb-crop-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 400px;
    margin: 14px auto 0;
}
.rb-crop-controls input[type=range] {
    flex: 1;
    accent-color: var(--rb-primary, #1E5BD8);
}
.rb-crop-zoom-label {
    width: 16px;
    text-align: center;
    color: #475569;
    font-weight: 700;
    user-select: none;
}

.rb-modal__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}
