/* Mimi Beauty — feuille de style principale (mobile d'abord) */
@font-face { font-family: "Lora"; src: url("/static/fonts/Lora.ttf") format("truetype"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("/static/fonts/Lora-Italic.ttf") format("truetype"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/static/fonts/DMSans.ttf") format("truetype"); font-weight: 300 700; font-style: normal; font-display: swap; }

:root {
  --rose: #F5D3E3;
  --rose-soft: #FBEAF1;
  --rose-deep: #C98BA8;
  --nude: #E9D6C9;
  --nude-deep: #CFAE9B;
  --cream: #FBF6F0;
  --paper: #FFFDFB;
  --ink: #3E2F2B;
  --ink-soft: #7A6760;
  --line: #EADFD6;
  --ok: #6E8F72;
  --warn: #B7794F;
  --danger: #A9545B;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px -18px rgba(62, 47, 43, .35);
  --serif: "Lora", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --header-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; font-family: var(--sans); font-size: 17px; line-height: 1.6; color: var(--ink); background: var(--cream); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: var(--rose-deep); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; letter-spacing: -.005em; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 8vw, 48px); }
h2 { font-size: clamp(24px, 6vw, 32px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }
.center { text-align: center; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--rose-deep); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.pad-y { padding-top: 36px; padding-bottom: 36px; }
.kicker { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--rose-deep); font-weight: 600; margin-bottom: .6em; }
.lead { font-size: 19px; color: var(--ink-soft); }
.section-title { position: relative; padding-bottom: .4em; margin-top: .4em; }
.section-title::after { content: ""; display: block; width: 44px; height: 2px; background: var(--rose-deep); margin-top: .45em; border-radius: 2px; }
.center .section-title::after { margin-left: auto; margin-right: auto; }

/* En-tête */
.site-header { position: sticky; top: 0; z-index: 30; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; padding-top: env(safe-area-inset-top); background: rgba(251, 246, 240, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.logo { font-family: var(--serif); font-size: 22px; letter-spacing: .02em; text-decoration: none; white-space: nowrap; }
.logo span { font-style: italic; color: var(--rose-deep); }
.site-nav { display: flex; align-items: center; gap: 10px; }
.site-nav .btn { white-space: nowrap; padding: 8px 14px; }
.nav-link { font-size: 15px; text-decoration: none; padding: 8px 6px; }
.nav-link:hover { text-decoration: underline; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 1px solid var(--ink); background: transparent; color: var(--ink); font: 500 16px/1.2 var(--sans); text-decoration: none; cursor: pointer; transition: transform .15s ease, background .2s ease, color .2s ease; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.98); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2c201d; }
.btn-ghost { border-color: var(--nude-deep); background: var(--paper); }
.btn-ghost:hover { background: var(--rose-soft); }
.btn-done { background: var(--rose); border-color: var(--rose); color: var(--ink); }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.btn-lg { min-height: 56px; font-size: 17px; }
.btn-block { display: flex; width: 100%; }
.link-btn { background: none; border: 0; padding: 6px 2px; font: inherit; color: var(--ink); text-decoration: underline; text-decoration-color: var(--rose-deep); text-underline-offset: 3px; cursor: pointer; }
.link-btn.danger, .danger { color: var(--danger); }

/* Messages */
.flash { margin: 12px 16px 0; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--rose-soft); border: 1px solid var(--rose); font-size: 15px; }
.flash-ok { background: #EEF4EE; border-color: #CFE0D0; }
.flash-error { background: #FBECEC; border-color: #EFCACA; }
.notice { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--rose-soft); font-size: 15px; }
.notice-error { background: #FBECEC; color: #7d3036; }
.hint { font-size: 13px; color: var(--ink-soft); margin: -6px 0 14px; }

/* Formulaires */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=search], input[type=number], input[type=password], input:not([type]), textarea, select {
  width: 100%; font: 16px/1.4 var(--sans); color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; -webkit-appearance: none; appearance: none; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--rose-deep); box-shadow: 0 0 0 3px var(--rose-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 4px 0 18px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--ink); }
.code-input { font-size: 28px !important; letter-spacing: .4em; text-align: center; font-family: var(--serif) !important; }

.card { background: var(--paper); border-radius: var(--radius); padding: 26px 22px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.auth .card { max-width: 480px; margin: 0 auto; }

/* Accueil */
.hero { background: radial-gradient(120% 90% at 100% 0%, var(--rose) 0%, rgba(245, 211, 227, 0) 60%), radial-gradient(90% 80% at 0% 100%, var(--nude) 0%, rgba(233, 214, 201, 0) 65%), var(--cream); padding: 56px 0 48px; }
.hero h1 { max-width: 14ch; }
.hero .lead { max-width: 36ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.points li { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 14px 46px; position: relative; font-size: 16px; }
.points li::before { content: "✦"; position: absolute; left: 18px; top: 13px; color: var(--rose-deep); }
.about { background: var(--rose-soft); padding: 44px 0; }

/* Cartes de formation */
.course-grid { display: grid; gap: 20px; }
.course-card { display: block; background: var(--paper); border-radius: var(--radius); overflow: hidden; text-decoration: none; border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .2s ease; }
.course-card:hover { transform: translateY(-2px); }
.course-card-body { padding: 18px 20px 20px; }
.course-card-body h3 { font-size: 24px; margin-bottom: .3em; }
.course-card-foot { display: flex; justify-content: space-between; align-items: center; margin: 0; }
.link-arrow { font-size: 15px; font-weight: 500; }
.link-arrow::after { content: " →"; }
.price { font-family: var(--serif); font-size: 22px; }
.cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--nude); }
.cover-placeholder { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--rose) 0%, var(--nude) 100%); }
.cover-placeholder span { font-family: var(--serif); font-style: italic; font-size: 28px; color: var(--ink); opacity: .75; padding: 0 20px; text-align: center; }
.cover-lg { border-radius: var(--radius); margin-bottom: 20px; }

/* Page de vente */
.sales-hero { background: linear-gradient(180deg, var(--rose-soft) 0%, var(--cream) 100%); padding: 28px 0 12px; }
.sales-hero-grid { display: grid; gap: 8px; }
.price-line { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.price-line .price { font-size: 30px; }
.sales-visual { border-radius: var(--radius); margin-top: 20px; }
.program { counter-reset: p; list-style: none; padding: 0; margin: 0; }
.program li { counter-increment: p; position: relative; padding: 14px 0 14px 52px; border-bottom: 1px solid var(--line); }
.program li::before { content: counter(p, decimal-leading-zero); position: absolute; left: 0; top: 12px; font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--rose-deep); }
.format { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.format li { padding-left: 28px; position: relative; }
.format li::before { content: "✓"; position: absolute; left: 0; color: var(--rose-deep); font-weight: 700; }
.buy-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow); }
.buy-price { font-family: var(--serif); font-size: 32px; margin-bottom: 14px; }
.buy-price .muted { font-family: var(--sans); }
.buy-owned { font-weight: 500; }
.secure { text-align: center; margin: 12px 0 0; }
.sticky-buy { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 253, 251, .96); border-top: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.has-sticky .site-footer { padding-bottom: 96px; }
.test-checkout { text-align: center; }
.badge-test { display: inline-block; background: var(--nude); border-radius: 999px; padding: 4px 12px; font-size: 13px; }

/* Pied de page */
.site-footer { background: var(--ink); color: #f3e9e3; padding: 36px 20px 40px; text-align: center; margin-top: 40px; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 14px 0; font-size: 14px; }
.site-footer a { color: #f3e9e3; }
.site-footer .muted { color: #bfaea6; }
.logo-footer { font-size: 24px; }

/* Espace élève */
.my-courses { display: grid; gap: 20px; }
.my-course { background: var(--paper); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.my-course-body { padding: 18px 20px 20px; display: grid; gap: 10px; }
.my-course-body h2 { font-size: 26px; margin: 0; }
.my-course-body h2 a { text-decoration: none; }
.my-course-body p { margin: 0; }
.progress { height: 8px; background: var(--nude); border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--rose-deep), #d9a3bd); border-radius: 99px; }
.course-head { background: linear-gradient(180deg, var(--rose-soft), var(--cream)); padding: 24px 0 8px; }
.course-head .btn { margin-top: 10px; }
.toc-chapter { margin-bottom: 22px; }
.toc-chapter h3 { display: flex; align-items: baseline; gap: 10px; font-size: 20px; }
.toc-num { font-family: var(--serif); font-style: italic; color: var(--rose-deep); font-size: 16px; }
.toc-lessons { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.toc-lessons li a { display: flex; gap: 12px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; min-height: 52px; }
.toc-lessons .check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--nude-deep); flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.toc-lessons li.done .check { background: var(--rose-deep); border-color: var(--rose-deep); color: #fff; }
.toc-lessons li.done .check::after { content: "✓"; }
.toc-lessons li.current a { font-weight: 600; background: var(--rose-soft); border-radius: 8px; }
.ebook-list { list-style: none; padding: 0; display: grid; gap: 10px; }

/* Leçon */
.reading main { background: var(--cream); }
.lesson-top { position: sticky; top: var(--header-h); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; background: rgba(251, 246, 240, .95); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.lesson-top .back { font-size: 14px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader { max-width: 820px; }
.lesson { padding-top: 22px; padding-bottom: 20px; }
.lesson h1 { font-size: clamp(28px, 7vw, 40px); }
.lesson-blocks { display: grid; gap: 18px; margin: 18px 0 28px; }
.block { margin: 0; }
.block-page, .block-image { margin: 0 -20px; }
.page-zoom { display: block; position: relative; width: 100%; padding: 0; border: 0; background: #fff; cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
.page-zoom img { width: 100%; height: auto; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.zoom-hint { position: absolute; right: 10px; bottom: 10px; background: rgba(62, 47, 43, .72); color: #fff; font-size: 12px; padding: 5px 10px; border-radius: 99px; pointer-events: none; }
.block-video video, .block-video .embed { width: 100%; border-radius: var(--radius-sm); background: #000; aspect-ratio: 16 / 9; }
.block-video .embed { position: relative; overflow: hidden; }
.block-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
figcaption { font-size: 14px; color: var(--ink-soft); padding: 8px 4px 0; }
.block-image figcaption { padding: 8px 20px 0; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .3em; }
.prose h3 { margin-top: 1em; }
.block-text { background: var(--paper); border-radius: var(--radius-sm); padding: 18px 18px 4px; border: 1px solid var(--line); }
.done-form { margin: 8px 0 14px; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 30px; }
.lesson-nav .btn { flex: 1; }

/* Tiroir du sommaire */
.toc-drawer { position: fixed; inset: 0; z-index: 50; background: rgba(62, 47, 43, .35); }
.toc-drawer[hidden] { display: none; }
.toc-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(420px, 92vw); background: var(--cream); overflow-y: auto; padding: 18px 18px calc(30px + env(safe-area-inset-bottom)); box-shadow: -10px 0 30px rgba(0,0,0,.12); }
.toc-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

/* Visionneuse avec zoom */
.zoom-viewer { position: fixed; inset: 0; z-index: 60; background: #1f1816; display: flex; flex-direction: column; touch-action: none; }
.zoom-viewer[hidden] { display: none; }
.zoom-stage { flex: 1; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; }
.zoom-stage img { max-width: none; max-height: none; transform-origin: 0 0; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; will-change: transform; position: absolute; left: 0; top: 0; }
.zoom-controls { display: flex; justify-content: center; gap: 10px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); background: #1f1816; }
.zoom-controls button { min-width: 52px; min-height: 48px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; font: 500 16px var(--sans); padding: 0 16px; }
.zoom-controls [data-zoom-in], .zoom-controls [data-zoom-out] { font-size: 24px; }

/* Commentaires */
.comments { border-top: 1px solid var(--line); padding-top: 26px; }
.comment-form { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 22px; }
.comment-form textarea { border: 0; padding: 4px; min-height: 80px; box-shadow: none !important; }
.comment-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; flex-wrap: wrap; }
.thread { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 4px; font-size: 15px; }
.comment-body { font-size: 16px; overflow-wrap: anywhere; }
.replies { margin: 12px 0 0 14px; padding-left: 14px; border-left: 2px solid var(--rose); display: grid; gap: 12px; }
.comment-admin { background: var(--rose-soft); border-radius: 12px; padding: 12px 14px; }
.badge-mimi { display: inline-block; background: var(--ink); color: #fff; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; }
.comment-admin .comment-meta strong { display: none; }
.badge-hidden { background: #eee; color: #666; font-size: 11px; padding: 3px 8px; border-radius: 99px; }
.comment-hidden { opacity: .55; }
.comment-tools { margin-top: 4px; }
.reply-form { display: grid; gap: 8px; margin-top: 12px; }
.reply-form .btn { justify-self: end; }
.empty-comments { padding: 10px 0; }
.admin-bar { background: var(--ink); color: #fff; font-size: 14px; padding: 8px 16px; text-align: center; }
.admin-bar a { color: var(--rose); }

/* Écrans plus larges */
@media (min-width: 720px) {
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .my-courses { grid-template-columns: repeat(2, 1fr); }
  .points { grid-template-columns: repeat(2, 1fr); }
  .sales-hero-grid { grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center; }
  .sales-hero { padding: 48px 0 24px; }
  .block-page, .block-image { margin: 0; }
  .page-zoom { border-radius: 6px; overflow: hidden; box-shadow: var(--shadow); }
  .sticky-buy { display: none; }
  .has-sticky .site-footer { padding-bottom: 40px; }
  .hero { padding: 96px 0 80px; }
  .card { padding: 34px 32px; }
}
@media (max-width: 380px) {
  .nav-link { display: none; }
  .logo { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
