/* ============================================================
   SHEMA — Elegant Liturgical Theme
   Brand primary: #3D0066  Gold: #C9A84C  Surface: #FFFFFF
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,700;1,400&family=Inter:wght@300;400;500;600&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap');

/* ── FONT KASTROO (fichier local requis : /fonts/Kastroo.woff2 + /fonts/Kastroo.woff) ── */
@font-face {
    font-family: 'Kastroo';
    src: url('/fonts/Kastroo.woff2') format('woff2'),
         url('/fonts/Kastroo.woff')  format('woff'),
         url('/fonts/Kastroo.ttf')   format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ── LOGO PNG ── */
.app-bar-logo {
    height: 34px;
    width: auto;
    display: block;
    /* Filtre pour adapter le logo à un fond clair si nécessaire */
    /* filter: brightness(0) saturate(100%) invert(18%) sepia(63%) saturate(800%) hue-rotate(250deg); */
}
.hero-logo-img {
    height: 90px;
    width: auto;
    display: inline-block;
}

/* ── TOKENS ── */
:root {
    --md-primary:           #3D0066;
    --md-primary-dark:      #2D0055;
    --md-primary-container: #F3E8FF;
    --md-on-primary:        #FFFFFF;
    --md-secondary:         #6B21A8;
    --md-secondary-container: #F3E8FF;
    --md-gold:              #C9A84C;
    --md-gold-light:        #FDF6DC;
    --md-surface:           #FFFFFF;
    --md-surface-1:         #F3E8FF;
    --md-surface-2:         #EDE8FF;
    --md-surface-variant:   #EDE8FF;
    --md-background:        #F7F4FF;
    --md-on-surface:        #1a1a2e;
    --md-on-surface-var:    #6B6B8A;
    --md-outline:           rgba(61,0,102,0.25);
    --md-outline-var:       rgba(61,0,102,0.13);
    --md-error:             #B3261E;
    --md-success:           #1B6B3A;
    --md-success-container: #C2EFAB;

    --elev-1: 0 1px 3px rgba(61,0,102,.08), 0 1px 2px rgba(61,0,102,.06);
    --elev-2: 0 2px 8px rgba(61,0,102,.10), 0 1px 3px rgba(61,0,102,.08);
    --elev-3: 0 4px 16px rgba(61,0,102,.14), 0 2px 6px rgba(61,0,102,.10);

    --md-app-bar-height: 64px;
    --md-bottom-nav-height: 80px;
    --md-radius-sm:   8px;
    --md-radius-md:   12px;
    --md-radius-lg:   16px;
    --md-radius-xl:   28px;
    --md-radius-full: 50px;
}

/* ── BASE ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--md-background);
    color: var(--md-on-surface);
    margin: 0;
    padding-top: var(--md-app-bar-height);
    -webkit-font-smoothing: antialiased;
}

@media (max-width: 768px) {
    body { padding-bottom: var(--md-bottom-nav-height); }
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', 'Kastroo', serif;
    font-weight: 700;
    color: var(--md-on-surface);
}

/* ── COMPAT COLORS ── */
.text-shema  { color: var(--md-primary) !important; }
.bg-shema    { background-color: var(--md-primary) !important; }
.bg-shema-light { background-color: var(--md-surface-1) !important; }
.border-shema   { border-color: var(--md-primary) !important; }

/* ── APP BAR ── */
.md-app-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--md-app-bar-height);
    background: #3D0066;
    z-index: 1000;
    box-shadow: 0 1px 6px rgba(0,0,0,.28);
    display: flex;
    align-items: center;
}

.md-app-bar-inner {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 16px;
    gap: 8px;
}

.md-app-bar-brand {
    text-decoration: none;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Desktop top nav */
.md-top-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 16px;
    flex: 1;
}

.md-nav-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--md-radius-full);
    text-decoration: none;
    color: rgba(255,255,255,.7);
    font-size: .875rem;
    font-weight: 500;
    transition: background .2s, color .2s;
    position: relative;
    white-space: nowrap;
}

.md-nav-pill:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.md-nav-pill.active {
    background: rgba(255,255,255,.18);
    color: #fff;
    font-weight: 600;
}

.md-app-bar-spacer { flex: 1; }

/* App bar actions */
.md-app-bar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.md-icon-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: none;
    color: rgba(255,255,255,.85);
    cursor: pointer;
    font-size: 1.1rem;
    transition: background .2s, color .2s;
    text-decoration: none;
}
.md-icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }

/* App bar specific elements */
.app-bar-person-icon { font-size: 1.4rem; color: rgba(255,255,255,.9); }
.app-bar-user-name {
    font-size: .85rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255,255,255,.9);
}

/* ── BOTTOM NAVIGATION ── */
.md-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--md-bottom-nav-height);
    background: var(--md-surface);
    display: flex;
    z-index: 1000;
    box-shadow: 0 -.5px 0 rgba(61,0,102,.13), 0 -2px 8px rgba(61,0,102,.07);
}

.md-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--md-on-surface-var);
    font-size: .7rem;
    font-weight: 500;
    padding: 12px 0 16px;
    position: relative;
    transition: color .2s;
}

.md-bottom-nav-item .md-nav-indicator {
    width: 64px; height: 32px;
    border-radius: var(--md-radius-full);
    background: transparent;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
    font-size: 1.25rem;
}

.md-bottom-nav-item.active { color: var(--md-primary); }
.md-bottom-nav-item.active .md-nav-indicator { background: var(--md-secondary-container); }
.md-bottom-nav-item:hover { color: var(--md-primary); }

/* ── MAIN CONTENT ── */
.md-main {
    min-height: calc(100vh - var(--md-app-bar-height));
    padding: 24px 0 40px;
}

/* ── MATERIAL BUTTONS ── */
.btn-shema, .btn-md-filled {
    background: var(--md-primary);
    color: var(--md-on-primary);
    border: none;
    border-radius: var(--md-radius-full);
    padding: 10px 24px;
    font-family: 'Inter', sans-serif;
    font-size: .875rem;
    font-weight: 500;
    letter-spacing: .025em;
    transition: background .2s, box-shadow .2s;
    box-shadow: var(--elev-1);
    line-height: 1.4;
}
.btn-shema:hover, .btn-md-filled:hover {
    background: var(--md-primary-dark);
    color: white;
    box-shadow: var(--elev-2);
}
.btn-shema:active, .btn-md-filled:active {
    background: var(--md-primary-dark);
    box-shadow: none;
    color: white;
}

.btn-outline-shema, .btn-md-outlined {
    background: transparent;
    color: var(--md-primary);
    border: 1px solid rgba(61,0,102,.35);
    border-radius: var(--md-radius-full);
    padding: 10px 24px;
    font-family: 'Inter', sans-serif;
    font-size: .875rem;
    font-weight: 500;
    letter-spacing: .025em;
    transition: background .2s, border-color .2s;
}
.btn-outline-shema:hover, .btn-md-outlined:hover {
    background: var(--md-secondary-container);
    border-color: var(--md-primary);
    color: var(--md-primary);
}

.btn-md-tonal {
    background: var(--md-secondary-container);
    color: var(--md-primary-dark);
    border: none;
    border-radius: var(--md-radius-full);
    padding: 10px 24px;
    font-size: .875rem;
    font-weight: 500;
}
.btn-md-tonal:hover { filter: brightness(.95); color: var(--md-primary-dark); }

/* FAB */
.md-fab {
    position: fixed;
    bottom: calc(var(--md-bottom-nav-height) + 16px);
    right: 16px;
    width: 56px; height: 56px;
    border-radius: var(--md-radius-lg);
    background: var(--md-primary-container);
    color: var(--md-primary-dark);
    border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    box-shadow: var(--elev-3);
    cursor: pointer;
    z-index: 900;
    transition: box-shadow .2s, transform .15s;
}
.md-fab:hover { box-shadow: var(--elev-3); transform: scale(1.05); }

@media (min-width: 769px) {
    .md-fab { bottom: 24px; }
}

/* ── CARDS ── */
.card {
    border: .5px solid var(--md-outline-var) !important;
    border-radius: var(--md-radius-lg) !important;
    background: var(--md-surface) !important;
    box-shadow: var(--elev-1) !important;
}
.card-header {
    border-radius: var(--md-radius-lg) var(--md-radius-lg) 0 0 !important;
    border-bottom: .5px solid var(--md-outline-var) !important;
    background: var(--md-surface) !important;
    font-weight: 600;
    font-size: .875rem;
    font-family: 'Inter', sans-serif;
}
.card-header.bg-shema, .card-header.bg-danger {
    background: var(--md-primary) !important;
    border-bottom: none !important;
    color: white !important;
}

/* ── FORM CONTROLS ── */
.form-control, .form-select {
    border: .5px solid rgba(61,0,102,.25) !important;
    border-radius: var(--md-radius-sm) !important;
    background: #fff !important;
    font-family: 'Inter', sans-serif;
    font-size: .875rem;
    color: var(--md-on-surface);
    padding: 12px 16px;
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--md-primary) !important;
    box-shadow: 0 0 0 2px rgba(61,0,102,.14) !important;
    outline: none;
}

/* ── BADGES / CHIPS ── */
.badge {
    border-radius: var(--md-radius-full) !important;
    font-weight: 500;
    font-size: .72rem;
    padding: 4px 10px !important;
    letter-spacing: .02em;
}
.bg-primary { background: var(--md-primary) !important; }
.bg-secondary { background: var(--md-on-surface-var) !important; }

/* ── BOOK COVER (magazine style) ── */
.book-cover {
    border-radius: var(--md-radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    box-shadow: var(--elev-2);
    display: flex;
    flex-direction: column;
    background: var(--bk-color, #3D1A4B);
    height: 100%;
}
.book-cover:hover { transform: translateY(-5px) scale(1.02); box-shadow: 0 12px 28px rgba(0,0,0,.22); }
.book-cover-img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}
.book-cover-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    background: var(--bk-color, #3D1A4B);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    flex-shrink: 0;
}
.book-cover-abbr {
    color: rgba(255,255,255,.95);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1;
    font-family: 'Playfair Display', serif;
}
.book-cover-fullname {
    color: rgba(255,255,255,.7);
    font-size: .62rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-family: 'Inter', sans-serif;
}
.book-cover-label {
    padding: 6px 8px 7px;
    font-size: .71rem;
    font-weight: 600;
    color: var(--md-on-surface);
    line-height: 1.25;
    background: var(--md-surface);
    text-align: center;
    flex: 1;
    font-family: 'Inter', sans-serif;
}

/* ── BIBLE BOOK SEARCH ── */
.book-search-group .form-control,
.book-search-group .input-group-text {
    border-color: var(--md-outline-var);
    background: var(--md-surface);
}
.book-search-group .form-control:focus {
    border-color: var(--md-primary);
    box-shadow: none;
}
.book-search-group .input-group-text { border-right: none; }
.book-search-group .form-control     { border-left: none; }
.book-search-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.book-search-grid .book-carousel-item { flex: 0 0 120px; }

/* ── BIBLE CATEGORY TABS ── */
.bible-tabs-wrapper {
    border-bottom: 2px solid var(--md-outline-var);
    overflow-x: auto;
    scrollbar-width: none;
}
.bible-tabs-wrapper::-webkit-scrollbar { display: none; }
.bible-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    min-width: max-content;
}
.bible-tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: .55rem 1.1rem;
    font-size: .82rem;
    font-weight: 500;
    color: var(--md-on-surface-var);
    white-space: nowrap;
    cursor: pointer;
    transition: color .15s, border-color .15s;
    border-radius: 0;
    font-family: 'Inter', sans-serif;
}
.bible-tab-btn:hover { color: var(--md-primary); }
.bible-tab-btn.active {
    color: var(--md-primary);
    border-bottom-color: var(--md-gold);
    font-weight: 700;
}

/* ── BOOK CAROUSEL ── */
.book-carousel-wrapper { position: relative; padding: 0 36px; }
.book-carousel {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 8px 4px 20px;
    scroll-snap-type: x mandatory;
}
.book-carousel::-webkit-scrollbar { display: none; }
.book-carousel-item {
    flex: 0 0 120px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
}
.book-carousel-arrow {
    position: absolute;
    top: 50%; transform: translateY(-60%);
    z-index: 5;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--md-surface);
    color: var(--md-primary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: var(--elev-2);
    transition: background .15s, color .15s;
    padding: 0;
    font-size: 1rem;
}
.book-carousel-arrow:hover { background: var(--md-secondary-container); }
.book-carousel-arrow-prev { left: 0; }
.book-carousel-arrow-next { right: 0; }

/* ── CHAPTER BUTTONS ── */
.chapter-btn {
    min-width: 44px;
    height: 44px;
    border-radius: var(--md-radius-sm) !important;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

/* ── VERSES ── */
.verse-block {
    border-left: 3px solid transparent;
    border-radius: 0 var(--md-radius-sm) var(--md-radius-sm) 0;
    transition: background .15s, border-color .15s;
    background: var(--md-surface);
    padding: 8px 12px;
    margin-bottom: 4px;
    border-bottom: .5px solid var(--md-outline-var);
}
.verse-block:hover { border-left-color: var(--md-gold); background: var(--md-gold-light); }
.verse-block.verse-has-note { border-left-color: var(--md-gold); background: var(--md-gold-light); }
.verse-number { font-size: .75rem; font-weight: 600; min-width: 28px; color: #A855F7; padding-top: 3px; font-family: 'Inter', sans-serif; }
.verse-text   { line-height: 1.7; font-size: 1.1rem; color: var(--md-on-surface); font-family: 'Cormorant Garamond', serif; font-style: italic; }

/* Glossaire inline */
.glossary-word {
    border-bottom: 2px dotted var(--md-secondary);
    cursor: help;
    color: var(--md-primary);
    text-decoration: none;
}

/* ── FAVORIS ── */
.btn-fav-toggle {
    background: transparent;
    border: 1px solid var(--md-outline-var);
    color: var(--md-outline);
    border-radius: var(--md-radius-sm);
    line-height: 1;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.btn-fav-toggle:hover { border-color: var(--md-gold); color: var(--md-gold); background: var(--md-gold-light); }
.btn-fav-toggle.active { border-color: var(--md-gold); color: var(--md-gold); background: var(--md-gold-light); }

/* ── NOTES ── */
.btn-note-toggle {
    background: transparent;
    border: 1px solid var(--md-outline-var);
    color: var(--md-outline);
    border-radius: var(--md-radius-sm);
    line-height: 1;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.btn-note-toggle.active, .btn-note-toggle:hover {
    border-color: var(--md-primary);
    color: var(--md-primary);
    background: var(--md-secondary-container);
}
.bg-note {
    background-color: var(--md-gold-light);
    border-left: 3px solid var(--md-gold);
    border-radius: 0 var(--md-radius-sm) var(--md-radius-sm) 0;
}
.note-card .card-header { background: var(--md-surface-1) !important; }

/* ── GLOSSAIRE ── */
.glossary-card {
    background: var(--md-surface) !important;
    border-radius: var(--md-radius-lg) !important;
    transition: transform .15s, box-shadow .15s;
    color: inherit;
    text-decoration: none;
    display: block;
    box-shadow: var(--elev-1) !important;
}
.glossary-card:hover { transform: translateY(-3px); box-shadow: var(--elev-3) !important; color: inherit; }

/* Tooltip */
.shema-tooltip {
    position: fixed;
    background: var(--md-primary-dark);
    color: white;
    padding: 10px 14px;
    border-radius: var(--md-radius-md);
    max-width: 320px;
    font-size: .85rem;
    line-height: 1.5;
    z-index: 9999;
    box-shadow: var(--elev-3);
    pointer-events: none;
}
.shema-tooltip::before {
    content: '';
    position: absolute;
    bottom: -6px; left: 16px;
    width: 12px; height: 12px;
    background: var(--md-primary-dark);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* ── CHAT ── */
.chat-messages { background: var(--md-surface-1); border-radius: var(--md-radius-md); }
.chat-bubble {
    max-width: 80%;
    padding: 10px 16px;
    border-radius: var(--md-radius-xl);
    font-size: .9rem;
    line-height: 1.5;
}
.chat-bubble-user {
    background: var(--md-surface-variant);
    color: var(--md-on-surface);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.chat-bubble-admin {
    background: var(--md-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.bubble-meta { font-size: .72rem; opacity: .7; margin-bottom: 3px; }

/* Carte session dans la liste historique */
.chat-session-card {
    background: var(--md-surface);
    border-color: var(--md-outline-var) !important;
    transition: box-shadow .15s;
}
.chat-session-card:hover { box-shadow: var(--elev-2); }

/* Bouton flottant nouveau chat */
.chat-fab {
    position: fixed;
    bottom: 84px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--md-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,.28);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    z-index: 1040;
}
.chat-fab:hover { transform: scale(1.1); box-shadow: 0 6px 22px rgba(0,0,0,.35); }

/* ── ÉVÉNEMENTS ── */
.event-card { border-radius: var(--md-radius-lg) !important; transition: transform .15s, box-shadow .15s; }
.event-card:hover { transform: translateY(-3px); box-shadow: var(--elev-3) !important; }
.shema-events-preview { background: var(--md-surface-1); }
.event-messages { background: var(--md-surface-1); border-bottom: 1px solid var(--md-outline-var); }
.event-message { background: var(--md-surface); border: 1px solid var(--md-outline-var); border-radius: var(--md-radius-sm); }

/* ── ADMIN ── */
.stat-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--md-surface);
    border: 1px solid var(--md-outline-var);
    border-radius: var(--md-radius-full);
    padding: 8px 16px;
    flex: 1 1 auto;
    white-space: nowrap;
    box-shadow: var(--elev-1);
    font-size: .9rem;
}
.stat-chip strong { font-size: 1.05rem; }
.stat-chip-warn { border-color: #f6c343; background: #fffde7; }

.admin-module-card {
    border-radius: var(--md-radius-lg) !important;
    transition: transform .15s, box-shadow .15s;
    cursor: pointer;
    background: var(--md-surface) !important;
}
.admin-module-card:hover { transform: translateY(-4px); box-shadow: var(--elev-3) !important; }

/* ── AVATAR ── */
.avatar-circle {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--md-primary);
    display: flex; align-items: center; justify-content: center;
}
.avatar-initial { color: white; font-size: 2rem; font-weight: 600; }

/* ── ALERTS ── */
.alert {
    border: none !important;
    border-radius: var(--md-radius-md) !important;
}
.alert-success { background: var(--md-success-container) !important; color: var(--md-success) !important; }
.alert-danger   { background: #FFDAD6 !important; color: var(--md-error) !important; }
.alert-info     { background: var(--md-secondary-container) !important; color: var(--md-primary-dark) !important; }

/* ── TABLES ── */
.table { border-radius: var(--md-radius-md); overflow: hidden; }
.table thead th { background: var(--md-surface-1) !important; font-weight: 600; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--md-on-surface-var); border-bottom: 1px solid var(--md-outline-var) !important; }
.table tbody tr:hover td { background: var(--md-surface-1); }
.table td, .table th { border-color: var(--md-outline-var) !important; vertical-align: middle; }

/* ── MODAL ── */
.modal-content {
    border: .5px solid var(--md-outline-var) !important;
    border-radius: var(--md-radius-xl) !important;
    box-shadow: var(--elev-3) !important;
}
.modal-header { border-bottom: .5px solid var(--md-outline-var) !important; }
.modal-footer { border-top: .5px solid var(--md-outline-var) !important; }

/* ── DROPDOWN ── */
.dropdown-menu {
    border: .5px solid var(--md-outline-var) !important;
    border-radius: var(--md-radius-md) !important;
    box-shadow: var(--elev-3) !important;
    background: var(--md-surface) !important;
    padding: 8px !important;
}
.dropdown-item {
    border-radius: var(--md-radius-sm) !important;
    font-size: .875rem;
    padding: 10px 16px !important;
    transition: background .15s;
    color: var(--md-on-surface) !important;
}
.dropdown-item:hover { background: var(--md-surface-1) !important; }
.dropdown-divider { border-color: var(--md-outline-var) !important; }

/* ── PROGRESS ── */
.progress { border-radius: var(--md-radius-full) !important; background: var(--md-surface-variant) !important; }
.progress-bar.bg-shema { background: var(--md-primary) !important; }

/* ── HERO ── */
.shema-hero {
    background: linear-gradient(135deg, #3D0066 0%, #2D0055 100%);
    border-radius: 0 0 var(--md-radius-xl) var(--md-radius-xl);
    color: #fff;
}

/* ── FOOTER ── */
.md-footer {
    background: var(--md-surface);
    border-top: 1px solid var(--md-outline-var);
    padding: 24px 0;
    font-size: .8rem;
    color: var(--md-on-surface-var);
}
@media (max-width: 768px) { .md-footer { display: none; } }

/* ── SURFACE TINT UTILITY ── */
.surface-1 { background: var(--md-surface-1) !important; }
.surface-2 { background: var(--md-surface-2) !important; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--md-outline-var); border-radius: 3px; }

/* ── RESPONSIVE ── */
@media (max-width: 576px) {
    .verse-text { font-size: .95rem; }
    .book-carousel-item { flex: 0 0 96px; }
    .book-carousel-wrapper { padding: 0 28px; }
    .container { padding-left: 16px; padding-right: 16px; }
}

/* ══════════════════════════════════════════════
   PAIN DE VIE — nouveau design citation + liturgie
══════════════════════════════════════════════ */
.pdv-logo {
    height: 64px;
    width: auto;
    display: inline-block;
}
.pdv-section {
    padding: 28px 0 28px;
    transition: background .4s;
}

/* Fonds liturgiques */
.pdv-bg-blanc  { background: linear-gradient(135deg, #f7f2e2 0%, #ede8d0 100%); }
.pdv-bg-vert   { background: linear-gradient(135deg, #e3f2e5 0%, #c8e6cc 100%); }
.pdv-bg-rouge  { background: linear-gradient(135deg, #fce8e8 0%, #f5cccc 100%); }
.pdv-bg-violet { background: linear-gradient(135deg, #f0e6f8 0%, #dfc9f2 100%); }
.pdv-bg-rose   { background: linear-gradient(135deg, #fce4ef 0%, #f8c8de 100%); }
.pdv-bg-noir   { background: linear-gradient(135deg, #e8e8e8 0%, #d4d4d4 100%); }

/* Layout : étiquettes à gauche, citation à droite */
.pdv-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
@media (max-width: 600px) {
    .pdv-layout { flex-direction: column; gap: 14px; }
}

/* ── Étiquettes ── */
.pdv-tags {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    padding-top: 4px;
}
@media (max-width: 600px) {
    .pdv-tags { flex-direction: row; flex-wrap: wrap; }
}

.pdv-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1.5px solid rgba(0,0,0,.12);
}
.pdv-tag-primary {
    background: rgba(255,255,255,.75);
    color: var(--md-primary);
    border-color: var(--md-primary);
}

/* Étiquette liturgique — couleur dynamique via dot */
.pdv-tag-liturgy { background: rgba(255,255,255,.6); color: #333; }
.pdv-dot-blanc  { border-color: #c9a030; color: #6b5000; }
.pdv-dot-vert   { border-color: #388e3c; color: #1b5e20; }
.pdv-dot-rouge  { border-color: #c62828; color: #7f0000; }
.pdv-dot-violet { border-color: #7b1fa2; color: #4a148c; }
.pdv-dot-rose   { border-color: #d81b60; color: #880e4f; }
.pdv-dot-noir   { border-color: #424242; color: #212121; }

/* ── Citation ── */
.pdv-quote {
    flex: 1;
    margin: 0;
    padding: 0;
    border: none;
    position: relative;
    padding-left: 28px;
}
.pdv-quote::before {
    content: '\201C';
    position: absolute;
    left: -6px;
    top: -16px;
    font-size: 5rem;
    line-height: 1;
    font-family: Georgia, 'Times New Roman', serif;
    color: rgba(0,0,0,.15);
    pointer-events: none;
}
.pdv-quote-text {
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(0,0,0,.75);
    margin: 0 0 14px;
}
.pdv-quote-ref { display: block; text-align: right; }
.pdv-ref-link {
    font-size: .82rem;
    font-weight: 600;
    color: rgba(0,0,0,.55);
    text-decoration: none;
    border-bottom: 1px solid rgba(0,0,0,.2);
    transition: color .15s;
}
.pdv-ref-link:hover { color: var(--md-primary); border-color: var(--md-primary); }

/* ══════════════════════════════════════════════
   TUILES MINIMALISTES — Navigation accueil
══════════════════════════════════════════════ */
.nav-tiles-section {
    padding: 28px 0 36px;
    background: var(--md-surface);
}
.nav-tiles-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}
@media (max-width: 768px) {
    .nav-tiles-grid { grid-template-columns: repeat(5, 1fr); gap: 10px; }
}
@media (max-width: 480px) {
    .nav-tiles-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

.nav-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 8px 16px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--md-outline-var, #e0e0e0);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: transform .16s ease, box-shadow .16s ease;
    cursor: pointer;
}
.nav-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.10);
}
.nav-tile-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--tile-bg, #F3E8FF);
    color: var(--tile-color, #3D0066);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.nav-tile-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--md-on-surface, #1c1b1f);
    text-align: center;
    letter-spacing: .01em;
}

@media (max-width: 480px) {
    .nav-tile { padding: 16px 6px 12px; gap: 8px; border-radius: 14px; }
    .nav-tile-icon { width: 44px; height: 44px; font-size: 1.25rem; border-radius: 12px; }
    .nav-tile-label { font-size: .72rem; }
}


/* ── Pain de vie quote text — Cormorant ─────────────────────────────────── */
.pdv-quote-text {
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(0,0,0,.75);
    margin: 0 0 14px;
    font-family: 'Cormorant Garamond', serif;
}

/* ── Verse comment badge (chat-quote icon) ───────────────────────────────── */
.verse-comment-btn {
    background: #3D0066 !important;
}

/* ── Table headers ─────────────────────────────────────────────────────────── */
.table thead th {
    font-family: 'Inter', sans-serif !important;
    letter-spacing: .05em !important;
    text-transform: uppercase !important;
    font-size: .75rem !important;
    font-weight: 600 !important;
    color: var(--md-on-surface-var) !important;
}

/* ── Bible read page — book/chapter heading ──────────────────────────────── */
.text-shema.fw-bold { font-family: 'Playfair Display', serif; }

/* ── Profile avatar ─────────────────────────────────────────────────────── */
.profile-avatar-wrap {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border-radius: 50%;
}
.profile-avatar-wrap:focus { outline: 2px solid var(--md-primary); outline-offset: 3px; }
.profile-avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--md-primary, #5B2A8C);
    display: block;
}
.avatar-upload-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    opacity: 0;
    transition: opacity .2s;
}
.profile-avatar-wrap:hover .avatar-upload-overlay { opacity: 1; }

/* ── Layout avatar (app bar) ─────────────────────────────────────────────── */
.layout-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--md-primary, #5B2A8C);
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   MENU LATÉRAL (Sidebar)
══════════════════════════════════════════════ */

/* Overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(61,0,102,.22);
    z-index: 1099;
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s cubic-bezier(.4,0,.2,1);
}
.sidebar-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* Tiroir */
.sidebar {
    position: fixed;
    top: 0;
    left: -270px;
    bottom: 0;
    width: 260px;
    background: #fff;
    border-right: .5px solid rgba(61,0,102,.13);
    display: flex;
    flex-direction: column;
    z-index: 1100;
    transition: left .28s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}
.sidebar.open { left: 0; }

/* Empêche le scroll du body quand le sidebar est ouvert */
body.sidebar-open { overflow: hidden; }

/* ── En-tête profil ── */
.sidebar-profile {
    padding: 28px 18px 18px;
    background: #3D0066;
    flex-shrink: 0;
}
.sidebar-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #C9A84C;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 11px;
}
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-avatar-initials {
    background: rgba(255,255,255,.12);
    color: #C9A84C;
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 500;
}
.sidebar-avatar-initials i { font-size: 1.25rem; color: #C9A84C; }
.sidebar-profile-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    line-height: 1.3;
}
.sidebar-profile-role {
    font-size: .72rem;
    color: rgba(255,255,255,.55);
    margin-top: 2px;
    font-family: 'Inter', sans-serif;
}

/* ── Items de navigation ── */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 18px;
    text-decoration: none;
    color: #3D0066;
    font-size: .82rem;
    font-family: 'Inter', sans-serif;
    transition: background .15s;
    border-right: 3px solid transparent;
    white-space: nowrap;
}
.sidebar-item i {
    font-size: 1.1rem;
    color: #9B8BC4;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar-item:hover { background: #F3E8FF; color: #3D0066; text-decoration: none; }
.sidebar-item:hover i { color: #3D0066; }
.sidebar-item.active {
    background: #F3E8FF;
    border-right-color: #3D0066;
    font-weight: 600;
    color: #3D0066;
}
.sidebar-item.active i { color: #3D0066; }

.sidebar-sep {
    height: .5px;
    background: rgba(61,0,102,.08);
    margin: 6px 18px;
}
.sidebar-section-label {
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #C9A84C;
    padding: 6px 18px 2px;
    font-family: 'Inter', sans-serif;
}

/* ── Pied du menu ── */
.sidebar-footer {
    padding: 10px 0;
    border-top: .5px solid rgba(61,0,102,.10);
    flex-shrink: 0;
}
.sidebar-footer-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 18px;
    font-size: .82rem;
    color: #6B6B8A;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: 'Inter', sans-serif;
    transition: background .15s;
}
.sidebar-footer-item i { font-size: 1rem; color: #9B8BC4; width: 22px; text-align: center; flex-shrink: 0; }
.sidebar-footer-item:hover { background: #F3E8FF; color: #3D0066; }
.sidebar-footer-item:hover i { color: #3D0066; }
.sidebar-footer-logout { color: #B3261E; }
.sidebar-footer-logout i { color: #B3261E; }
.sidebar-footer-logout:hover { background: #FFDAD6; color: #B3261E; }

/* ── Hamburger dans l'app bar ── */
.sidebar-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 6px;
    border-radius: 8px;
    flex-shrink: 0;
    transition: background .15s;
    margin-right: 4px;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.12); }
.sidebar-toggle span {
    width: 20px;
    height: 1.5px;
    border-radius: 1px;
    background: rgba(255,255,255,.8);
    display: block;
    transition: transform .2s, opacity .2s;
}

/* ══════════════════════════════════════════════════════════
   AUTH PAGES (Login / Register)
   ══════════════════════════════════════════════════════════ */
.auth-page {
    min-height: calc(100vh - var(--app-bar-h, 56px));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2.5rem 1.25rem 5rem;
    background: var(--md-background, #F7F4FF);
}
.auth-inner {
    width: 100%;
    max-width: 400px;
}

/* Brand */
.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-brand-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto .75rem;
    background: var(--md-primary);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(61,0,102,.25);
}
.auth-brand-logo img { width: 42px; filter: brightness(0) invert(1); }
.auth-brand-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--md-primary);
    margin-bottom: .2rem;
}
.auth-brand-subtitle { font-size: .82rem; color: #888; }

/* Error */
.auth-error {
    background: #fff1f1;
    border: 1px solid #fcc;
    border-radius: 12px;
    padding: .7rem 1rem;
    font-size: .85rem;
    color: #c0392b;
    margin-bottom: 1rem;
}

/* Fields */
.auth-field {
    display: flex;
    align-items: center;
    background: rgba(61,0,102,.06);
    border-radius: 14px;
    padding: 0 1rem;
    margin-bottom: .75rem;
    border: 1.5px solid transparent;
    transition: border-color .15s, background .15s;
}
.auth-field:focus-within {
    border-color: var(--md-primary);
    background: rgba(61,0,102,.03);
}
.auth-field-icon {
    color: var(--md-primary);
    opacity: .4;
    font-size: 1rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}
.auth-field-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: .9rem .6rem;
    font-family: 'Inter', sans-serif;
    font-size: .95rem;
    color: #1a1a1a;
}
.auth-field-input::placeholder { color: #aaa; }
.auth-field-action {
    background: none;
    border: none;
    padding: 0;
    color: #aaa;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color .15s;
}
.auth-field-action:hover { color: var(--md-primary); }

/* Remember me */
.auth-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.25rem;
    font-size: .85rem;
    color: #555;
    cursor: pointer;
}
.auth-check input[type="checkbox"] { accent-color: var(--md-primary); width: 16px; height: 16px; cursor: pointer; }

/* Helper text */
.auth-hint { font-size: .75rem; color: #999; margin: -.3rem 0 .75rem .25rem; }

/* CTA */
.auth-cta {
    width: 100%;
    padding: .9rem;
    border: none;
    border-radius: 14px;
    background: var(--md-primary);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    margin-bottom: 1.25rem;
}
.auth-cta:hover { opacity: .9; }
.auth-cta:active { transform: scale(.98); }

/* Divider "ou" */
.auth-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
    color: #bbb;
    font-size: .78rem;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: #e0e0e0; }

/* Social buttons */
.auth-social {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1.5rem;
}
.auth-social-btn {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1rem;
    border: 1.5px solid #e8e8e8;
    border-radius: 12px;
    background: white;
    font-size: .88rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: border-color .15s, background .1s;
    width: 100%;
    text-align: left;
}
.auth-social-btn:hover { border-color: #ccc; background: #fafafa; }
.auth-social-btn svg { flex-shrink: 0; }

/* Footer link */
.auth-footer {
    text-align: center;
    font-size: .85rem;
    color: #888;
}
.auth-footer a {
    color: var(--md-primary);
    font-weight: 600;
    text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }
