/* ==========================================================
   BookMaster - Dark glass theme (inspire de Quizzier)
   Violet / cyan / magenta - Glass cards - Neon glow - Mesh BG
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --c-primary: #a78bfa;
    --c-primary-dark: #8b5cf6;
    --c-primary-deep: #7c3aed;
    --c-accent: #22d3ee;
    --c-accent-2: #f472b6;
    --c-bg: #0a0a1a;
    --c-bg-elev: #11112a;
    --c-card: rgba(30, 30, 60, 0.55);
    --c-card-solid: #1a1a35;
    --c-text: #f0f4ff;
    --c-text-strong: #ffffff;
    --c-muted: #9ca3b5;
    --c-border: rgba(167, 139, 250, 0.18);
    --c-border-strong: rgba(167, 139, 250, 0.35);
    --c-success: #4ade80;
    --c-error: #f87171;
    --c-info: #60a5fa;
    --c-warn: #fbbf24;
    --font-heading: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --radius: 18px;
    --radius-lg: 24px;
    --radius-sm: 12px;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.5);
    --blur: blur(22px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; min-height: 100vh; }
body {
    font-family: var(--font-body);
    background: var(--c-bg);
    color: var(--c-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

/* Mesh gradient anime en fond */
body::before {
    content: '';
    position: fixed; inset: -20%; z-index: -2;
    background:
        radial-gradient(circle at 15% 20%, rgba(167, 139, 250, 0.30) 0%, transparent 35%),
        radial-gradient(circle at 85% 30%, rgba(244, 114, 182, 0.25) 0%, transparent 35%),
        radial-gradient(circle at 50% 80%, rgba(34, 211, 238, 0.22) 0%, transparent 40%),
        radial-gradient(circle at 20% 70%, rgba(139, 92, 246, 0.22) 0%, transparent 35%);
    animation: meshDrift 28s ease-in-out infinite alternate;
    pointer-events: none;
    filter: blur(40px);
}
body::after {
    content: '';
    position: fixed; inset: 0; z-index: -1;
    background:
        linear-gradient(rgba(167,139,250,.04) 1px, transparent 1px) 0 0 / 60px 60px,
        linear-gradient(90deg, rgba(167,139,250,.04) 1px, transparent 1px) 0 0 / 60px 60px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}
@keyframes meshDrift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(-3%, 2%) scale(1.08); }
    100% { transform: translate(2%, -3%) scale(1); }
}

a { color: var(--c-primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--c-accent); }

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.15;
    margin-top: 0;
    letter-spacing: -0.02em;
    color: var(--c-text-strong);
}
h1 { font-size: 2.2rem; margin-bottom: 1.2rem; }
h2 { font-size: 1.5rem; margin-bottom: .8rem; }
h3 { font-size: 1.2rem; }

/* ---------- Header ---------- */
.bm-header {
    background: rgba(10, 10, 26, 0.75);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--c-border);
    position: sticky; top: 0; z-index: 50;
}
.bm-header .bm-container {
    max-width: 1200px; margin: 0 auto; padding: .9rem 1.4rem;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.bm-brand {
    font-family: var(--font-heading); font-weight: 700; font-size: 1.4rem;
    color: var(--c-text-strong); display: flex; align-items: center; gap: .55rem;
    text-decoration: none;
}
.bm-brand::after {
    content: ''; display: inline-block; width: 10px; height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent-2));
    box-shadow: 0 0 14px var(--c-primary), 0 0 28px var(--c-accent-2);
    animation: brandPulse 2.2s ease-in-out infinite;
}
@keyframes brandPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.65; transform: scale(0.85); }
}
.bm-header nav { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.bm-header nav a {
    color: var(--c-text); font-weight: 500; font-size: .95rem;
    padding: .35rem .2rem; position: relative; text-decoration: none;
}
.bm-header nav a::after {
    content: ''; position: absolute; bottom: -4px; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--c-primary), var(--c-accent-2));
    transform: scaleX(0); transform-origin: left; transition: transform .25s;
    border-radius: 2px;
}
.bm-header nav a:hover { color: var(--c-text-strong); }
.bm-header nav a:hover::after { transform: scaleX(1); }
.bm-user { color: var(--c-muted); }

/* ---------- Layout ---------- */
.bm-container { max-width: 1200px; margin: 0 auto; padding: 1.5em 1.4rem 4rem; }
main.bm-container { padding-top: 2.2em; }

/* ---------- Footer ---------- */
.bm-footer {
    border-top: 1px solid var(--c-border);
    margin-top: 4rem;
    padding: 1.5rem 0;
    text-align: center;
    color: var(--c-muted);
    background: rgba(10, 10, 26, 0.5);
}

/* ---------- Cards (glass) ---------- */
.bm-card {
    background: var(--c-card);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1.6rem;
    margin-bottom: 1.2rem;
    box-shadow: var(--shadow);
    transition: border-color .2s, transform .15s;
}
.bm-card:hover { border-color: var(--c-border-strong); }

.bm-grid { display: grid; gap: 1.2rem; }
.bm-grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.bm-grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.bm-grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.bm-muted { color: var(--c-muted); font-size: .9em; }

/* ---------- Flash ---------- */
.bm-flash {
    padding: .9rem 1.2rem;
    border-radius: var(--radius-sm);
    margin: .8rem 0;
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border: 1px solid;
    animation: slideDown .4s ease-out;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.bm-flash-ok   { background: rgba(74, 222, 128, 0.15); color: #86efac; border-color: rgba(74, 222, 128, 0.3); }
.bm-flash-info { background: rgba(96, 165, 250, 0.15); color: #93c5fd; border-color: rgba(96, 165, 250, 0.3); }
.bm-flash-err  { background: rgba(248, 113, 113, 0.15); color: #fca5a5; border-color: rgba(248, 113, 113, 0.3); }

/* ---------- Forms ---------- */
label {
    display: block;
    margin: .9rem 0 .35rem;
    font-weight: 600;
    font-size: .92rem;
    color: var(--c-text);
}
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=url], input[type=datetime-local], input[type=date], input[type=file],
select, textarea {
    width: 100%;
    padding: .65rem .85rem;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: rgba(10, 10, 26, 0.5);
    color: var(--c-text);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}
textarea { resize: vertical; min-height: 80px; }
input[disabled] { opacity: .5; cursor: not-allowed; }
select option { background: var(--c-card-solid); color: var(--c-text); }

/* ---------- Buttons ---------- */
.bm-btn, button[type=submit], button[type=button] {
    display: inline-block;
    padding: .65rem 1.4rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent-2));
    color: #fff;
    cursor: pointer;
    font-size: .95rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s, opacity .15s;
    box-shadow: 0 8px 24px rgba(167,139,250,.35), inset 0 1px 0 rgba(255,255,255,.15);
}
.bm-btn:hover, button:hover { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(167,139,250,.5); color: #fff; }
.bm-btn:disabled, button:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.bm-btn-ghost {
    background: transparent;
    color: var(--c-primary);
    border: 1px solid var(--c-border-strong);
    box-shadow: none;
}
.bm-btn-ghost:hover { background: rgba(167, 139, 250, 0.1); color: var(--c-text-strong); }
.bm-btn-danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
    box-shadow: 0 8px 24px rgba(248, 113, 113, .35);
}
.bm-btn-danger:hover { box-shadow: 0 12px 32px rgba(248, 113, 113, .5); }
.bm-btn-sm { padding: .35rem .9rem; font-size: .85rem; }

/* ---------- Tables ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}
th, td { padding: .75rem .9rem; text-align: left; border-bottom: 1px solid var(--c-border); }
th { background: rgba(167, 139, 250, 0.08); font-weight: 600; color: var(--c-text-strong); }
tr:hover td { background: rgba(167, 139, 250, 0.05); }
small { color: var(--c-muted); }

/* ---------- Pills ---------- */
.bm-pill {
    display: inline-block;
    padding: .25rem .8rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    border: 1px solid;
}
.bm-pill-ok   { background: rgba(74, 222, 128, .15); color: #86efac; border-color: rgba(74, 222, 128, .35); }
.bm-pill-warn { background: rgba(251, 191, 36, .15); color: #fcd34d; border-color: rgba(251, 191, 36, .35); }
.bm-pill-err  { background: rgba(248, 113, 113, .15); color: #fca5a5; border-color: rgba(248, 113, 113, .35); }
.bm-pill-info { background: rgba(96, 165, 250, .15); color: #93c5fd; border-color: rgba(96, 165, 250, .35); }

/* ---------- Stats ---------- */
.bm-stat {
    background: var(--c-card);
    backdrop-filter: var(--blur);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1.4rem 1rem;
    text-align: center;
    transition: transform .15s, border-color .15s;
}
.bm-stat:hover { transform: translateY(-2px); border-color: var(--c-border-strong); }
.bm-stat-value {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}
.bm-stat-label { color: var(--c-muted); font-size: .88rem; margin-top: .3rem; }

/* ---------- Quote ---------- */
.bm-quote {
    background: linear-gradient(135deg, rgba(167, 139, 250, .2), rgba(34, 211, 238, .15));
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
    margin: 1rem 0;
}
.bm-quote-detail-title {
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--c-muted);
    margin-bottom: .5rem;
}
.bm-quote-lines {
    list-style: none;
    padding: 0;
    margin: 0 0 .8rem;
    border-bottom: 1px dashed var(--c-border);
    padding-bottom: .6rem;
}
.bm-quote-lines li {
    padding: .3rem 0;
    font-size: .95rem;
    color: var(--c-text);
}
.bm-quote-lines li + li { border-top: 1px dotted rgba(167, 139, 250, .15); }
.bm-quote-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: .4rem;
}
.bm-quote-total-row > span:first-child {
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: .85rem;
    color: var(--c-muted);
    margin-right: .6rem;
}
.bm-quote-total-row > .bm-quote-total { margin-left: auto; }
.bm-quote-total {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.bm-quote-offer {
    margin-top: .8rem;
    padding: .8rem 1rem;
    background: rgba(251, 191, 36, .15);
    border: 1px solid rgba(251, 191, 36, .45);
    border-radius: var(--radius-sm);
    color: #fcd34d;
    font-size: .92rem;
    line-height: 1.4;
}
.bm-quote-offer strong { color: #fde68a; display: block; margin-bottom: .4rem; }
.bm-offer-lines {
    list-style: disc;
    margin: .3rem 0 .6rem 1.2rem;
    padding: 0;
    font-size: .85rem;
    color: rgba(253, 230, 138, .85);
}
.bm-offer-lines li { padding: .15rem 0; }
.bm-quote-offer .bm-btn { margin-top: .3rem; }

/* ---------- CTA login ---------- */
.bm-cta-login {
    text-align: center;
    padding: 1rem;
}

/* ---------- Photos ---------- */
.bm-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .8rem;
}
.bm-photo {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--c-border);
}
.bm-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bm-photo form {
    position: absolute; top: .3rem; right: .3rem; margin: 0;
}

/* Gallery (public) */
.bm-gallery { padding: 1rem; }
.bm-gallery-main {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--c-bg-elev);
    margin-bottom: .8rem;
}
.bm-gallery-main img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bm-gallery-thumbs { display: flex; gap: .5rem; flex-wrap: wrap; }
.bm-thumb {
    width: 80px; height: 60px; object-fit: cover;
    border-radius: 8px; cursor: pointer; opacity: .6;
    border: 2px solid transparent;
    transition: opacity .15s, border-color .15s;
}
.bm-thumb:hover { opacity: .9; }
.bm-thumb.active { opacity: 1; border-color: var(--c-primary); }

/* ---------- Booking rules ---------- */
.bm-rule-card {
    background: rgba(10, 10, 26, .4);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: .8rem;
}
.bm-rule-label { margin-bottom: .6rem !important; font-weight: 600; }
.bm-rule-row { display: flex; flex-wrap: wrap; gap: .9rem; align-items: flex-end; margin: .5rem 0; }
.bm-rule-row label { margin: 0; display: flex; flex-direction: column; font-size: .85rem; color: var(--c-muted); font-weight: 500; }
.bm-rule-row input, .bm-rule-row select { width: auto; margin-top: .25rem; }
.bm-rule-checkbox { flex-direction: row !important; align-items: center; gap: .35rem; padding-bottom: .55rem; }
.bm-rule-checkbox input { margin-top: 0 !important; }
.bm-rules-list { list-style: none; padding: 0; margin: .5rem 0; }
.bm-rules-list li { padding: .35rem .6rem; margin: .3rem 0; border-left: 3px solid var(--c-accent-2); background: rgba(244, 114, 182, .08); border-radius: 0 6px 6px 0; font-size: .92rem; }

/* ---------- Open hours edit + display ---------- */
.bm-avail-table th, .bm-avail-table td { padding: .4rem .6rem; }
.bm-slot-row { display: flex; gap: .4rem; align-items: center; margin-bottom: .35rem; }
.bm-slot-row input[type=time] { width: 110px; margin: 0; }
.bm-slot-row span { color: var(--c-muted); }
.bm-open-hours { list-style: none; padding: 0; margin: .5rem 0; }
.bm-open-hours li { padding: .25rem 0; border-bottom: 1px dotted var(--c-border); font-size: .92rem; }
.bm-open-hours li:last-child { border-bottom: 0; }

/* ---------- Busy list (page publique) ---------- */
.bm-busy-list { list-style: none; padding: 0; margin: 0; }
.bm-busy-list li { padding: .5rem 0; border-bottom: 1px solid var(--c-border); }
.bm-busy-list li:last-child { border-bottom: 0; }

/* ---------- Google btn ---------- */
.bm-btn-google {
    background: #fff;
    color: #444;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-weight: 500;
}
.bm-btn-google:hover { color: #222; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.bm-btn-google svg { width: 18px; height: 18px; }

/* ---------- Hero (landing) ---------- */
.bm-hero {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    margin-bottom: 2.5rem;
    text-align: center;
    overflow: hidden;
    background: rgba(30, 30, 60, 0.45);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--c-border-strong);
    box-shadow: var(--shadow-lg), 0 0 80px rgba(167,139,250,.2);
}
.bm-hero::before {
    content: ''; position: absolute; inset: 0; z-index: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(167,139,250,.4), transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(244,114,182,.35), transparent 50%);
    animation: heroDrift 14s ease-in-out infinite alternate;
}
@keyframes heroDrift {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.2) rotate(10deg); }
}
.bm-hero > * { position: relative; z-index: 1; }
.bm-hero h1 {
    font-size: 2.6rem;
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent), var(--c-accent-2));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}
.bm-hero p { color: var(--c-text); max-width: 640px; margin: 0 auto 1.2rem; font-size: 1.05rem; }

/* ---------- Search bar (landing) ---------- */
.bm-search {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    align-items: center;
    background: var(--c-card);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
}
.bm-search input[type=text] {
    flex: 1;
    min-width: 240px;
    margin: 0;
}
.bm-search select { width: auto; margin: 0; }
.bm-search label { margin: 0; }

@media (max-width: 600px) {
    .bm-search { flex-direction: column; align-items: stretch; }
    .bm-search input[type=text], .bm-search select, .bm-search button, .bm-search a { width: 100%; }
}

/* ---------- Item cards (landing) ---------- */
.bm-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.2rem;
}
.bm-item-card {
    background: var(--c-card);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--c-text);
    display: flex;
    flex-direction: column;
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
.bm-item-card:hover {
    transform: translateY(-3px);
    border-color: var(--c-border-strong);
    box-shadow: var(--shadow), 0 0 40px rgba(167,139,250,.25);
    color: var(--c-text);
}
.bm-item-cover {
    aspect-ratio: 4 / 3;
    background: var(--c-bg-elev);
    overflow: hidden;
}
.bm-item-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bm-item-cover-empty {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--c-muted); font-size: .9rem;
    background: linear-gradient(135deg, rgba(167,139,250,.12), rgba(34,211,238,.08));
}
.bm-item-body { padding: 1rem 1.1rem 1.2rem; }
.bm-item-body h3 { margin: 0 0 .3rem; font-size: 1.15rem; }
.bm-item-body p { margin: .3rem 0; }

/* ---------- Flatpickr overrides (theme dark) ---------- */
.flatpickr-input { display: none !important; } /* le vrai input est cache, on garde altInput */
.flatpickr-input.form-control.input { display: block !important; }
input.bm-fp, input[class*="flatpickr-alt-input"], .form-control.flatpickr-input.active {
    /* altInput cree par flatpickr herite des styles classiques */
}
.flatpickr-calendar {
    background: var(--c-card-solid) !important;
    border: 1px solid var(--c-border-strong) !important;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(167, 139, 250, .25) !important;
    border-radius: var(--radius) !important;
    color: var(--c-text) !important;
}
.flatpickr-calendar.arrowTop:before, .flatpickr-calendar.arrowTop:after { border-bottom-color: var(--c-border-strong) !important; }
.flatpickr-months, .flatpickr-current-month, .flatpickr-weekdays, .flatpickr-weekday {
    color: var(--c-text-strong) !important;
}
.flatpickr-weekday { background: transparent !important; color: var(--c-muted) !important; font-weight: 600; }
.flatpickr-day {
    color: var(--c-text) !important;
    border-radius: 8px !important;
}
.flatpickr-day:hover { background: rgba(167, 139, 250, .2) !important; }
.flatpickr-day.selected, .flatpickr-day.selected:hover {
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent-2)) !important;
    border-color: transparent !important;
    color: #fff !important;
}
.flatpickr-day.today { border-color: var(--c-accent) !important; }
.flatpickr-day.disabled, .flatpickr-day.flatpickr-disabled { color: rgba(255,255,255,.18) !important; }
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: rgba(255,255,255,.3) !important; }
.flatpickr-time input,
.flatpickr-time .flatpickr-am-pm {
    background: rgba(10, 10, 26, .5) !important;
    color: var(--c-text) !important;
}
.numInputWrapper:hover { background: rgba(167, 139, 250, .1) !important; }
.flatpickr-prev-month, .flatpickr-next-month { fill: var(--c-text) !important; color: var(--c-text) !important; }
.flatpickr-prev-month:hover, .flatpickr-next-month:hover svg { fill: var(--c-primary) !important; }
.flatpickr-confirm {
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent-2)) !important;
    color: #fff !important;
    font-weight: 600 !important;
    border-radius: 0 0 var(--radius) var(--radius) !important;
    padding: .75rem !important;
    margin-top: .3rem !important;
    cursor: pointer;
    transition: filter .15s;
}
.flatpickr-confirm:hover { filter: brightness(1.1); }

/* ---------- Contact card / messages ---------- */
.bm-contact-card {
    background: linear-gradient(135deg, rgba(244, 114, 182, .1), rgba(167, 139, 250, .08));
    border-color: rgba(244, 114, 182, .35);
}
.bm-contact-card textarea { font-family: inherit; }
.bm-contact-row { transition: border-color .15s; }
.bm-contact-row.new { border-color: rgba(248, 113, 113, .4); box-shadow: 0 0 24px rgba(248, 113, 113, .1); }
.bm-contact-message {
    background: rgba(10, 10, 26, 0.4);
    border-left: 3px solid var(--c-primary);
    padding: .8em 1em;
    margin-top: .8em;
    border-radius: 0 8px 8px 0;
    white-space: pre-wrap;
}

/* ---------- Calendar widget ---------- */
.bm-cal {
    background: var(--c-card);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}
.bm-cal-toolbar {
    display: flex; flex-wrap: wrap; gap: .8rem;
    align-items: center; justify-content: space-between;
    margin-bottom: 1rem;
}
.bm-cal-nav { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.bm-cal-nav input[type=date] { width: auto; padding: .35rem .5rem; }
.bm-cal-title { font-family: var(--font-heading); font-weight: 600; font-size: 1.15rem; color: var(--c-text-strong); text-transform: capitalize; }
.bm-cal-views { display: flex; gap: 0; background: rgba(10, 10, 26, 0.4); padding: 3px; border-radius: 999px; border: 1px solid var(--c-border); }
.bm-cal-view-btn { background: transparent; color: var(--c-muted); padding: .4rem 1rem; border-radius: 999px; font-size: .85rem; box-shadow: none; }
.bm-cal-view-btn:hover { color: var(--c-text); transform: none; box-shadow: none; }
.bm-cal-view-btn.active { background: linear-gradient(135deg, var(--c-primary), var(--c-accent-2)); color: #fff; }

.bm-cal-legend {
    display: flex; flex-wrap: wrap; gap: 1.4rem;
    margin-top: 1rem; padding-top: 1rem;
    border-top: 1px solid var(--c-border);
    color: var(--c-muted); font-size: .88rem;
}
.bm-cal-dot {
    display: inline-block; width: 14px; height: 14px; border-radius: 4px;
    vertical-align: middle; margin-right: .3rem;
    border: 1px solid;
}
.bm-cal-dot.free    { background: rgba(74, 222, 128, .2);  border-color: rgba(74, 222, 128, .5); }
.bm-cal-dot.partial { background: rgba(251, 191, 36, .2);  border-color: rgba(251, 191, 36, .5); }
.bm-cal-dot.full    { background: rgba(248, 113, 113, .2); border-color: rgba(248, 113, 113, .5); }
.bm-cal-dot.closed  { background: rgba(150, 150, 180, .2); border-color: rgba(150, 150, 180, .4); }

/* Day view : grille heures */
.bm-cal-hour-grid {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 3px 8px;
    margin-bottom: 1.2rem;
}
.bm-cal-hour-label {
    font-family: var(--font-heading);
    color: var(--c-muted);
    font-size: .82rem;
    align-self: center;
    text-align: right;
}
.bm-cal-hour-cell {
    padding: .55rem .8rem;
    border-radius: 8px;
    min-height: 38px;
    font-size: .9rem;
    border: 1px solid;
    display: flex; align-items: center;
}
.bm-cal-hour-cell.free    { background: rgba(74, 222, 128, .08); border-color: rgba(74, 222, 128, .3); color: #86efac; }
.bm-cal-hour-cell.partial { background: rgba(251, 191, 36, .15); border-color: rgba(251, 191, 36, .4); color: #fcd34d; }
.bm-cal-hour-cell.full    { background: rgba(248, 113, 113, .15); border-color: rgba(248, 113, 113, .4); color: #fca5a5; }
.bm-cal-hour-cell.closed  { background: repeating-linear-gradient(135deg, rgba(150,150,180,.06) 0 8px, rgba(150,150,180,.14) 8px 16px); border-color: rgba(150, 150, 180, .25); color: rgba(255,255,255,.4); font-style: italic; }
.bm-cal-hour-cell.clickable { cursor: pointer; transition: background .15s; }
.bm-cal-hour-cell.clickable:hover { background: rgba(167, 139, 250, .2); border-color: var(--c-primary); color: var(--c-text); }

/* Suggestions de creneaux libres (jour partiellement occupe) */
.bm-cal-suggestions {
    background: linear-gradient(135deg, rgba(167, 139, 250, .12), rgba(34, 211, 238, .08));
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
    margin-bottom: 1.2rem;
}
.bm-cal-suggestions-title {
    font-weight: 600;
    color: var(--c-text-strong);
    margin-bottom: .7rem;
    font-size: .95rem;
}
.bm-cal-suggestion {
    display: inline-block;
    background: rgba(10, 10, 26, 0.5);
    color: var(--c-text);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    padding: .6rem .9rem;
    margin: .2rem .35rem .2rem 0;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: transform .12s, border-color .12s, background .12s;
    box-shadow: none;
    line-height: 1.4;
}
.bm-cal-suggestion:hover {
    border-color: var(--c-primary);
    background: rgba(167, 139, 250, .12);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.bm-cal-suggestion strong { color: var(--c-text-strong); }
.bm-cal-suggestion-time {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: .92rem;
    color: var(--c-accent);
}

.bm-cal-day-bigtile {
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
}
.bm-cal-day-bigtile.free    { background: rgba(74, 222, 128, .12); border-color: rgba(74, 222, 128, .4); color: #86efac; }
.bm-cal-day-bigtile.partial { background: rgba(251, 191, 36, .15); border-color: rgba(251, 191, 36, .4); color: #fcd34d; }
.bm-cal-day-bigtile.full    { background: rgba(248, 113, 113, .15); border-color: rgba(248, 113, 113, .4); color: #fca5a5; }

.bm-cal-busylist { margin-top: 1rem; }
.bm-cal-busylist h4 { margin: 0 0 .5rem; font-size: 1rem; }
.bm-cal-busylist ul { list-style: none; padding: 0; margin: 0; }
.bm-cal-busylist li { padding: .35rem 0; border-bottom: 1px solid var(--c-border); }

/* Week view */
.bm-cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.bm-cal-week-col { display: flex; flex-direction: column; gap: 4px; }
.bm-cal-week-header {
    text-align: center; padding: .5rem .3rem;
    background: rgba(10, 10, 26, 0.4);
    border-radius: 8px; cursor: pointer;
    border: 1px solid var(--c-border);
    transition: border-color .15s;
}
.bm-cal-week-header:hover { border-color: var(--c-primary); }
.bm-cal-week-header .dow { font-size: .8rem; color: var(--c-muted); text-transform: capitalize; }
.bm-cal-week-header .num { font-family: var(--font-heading); font-size: 1.3rem; color: var(--c-text-strong); font-weight: 600; }
.bm-cal-week-header.today { border-color: var(--c-accent); box-shadow: 0 0 16px rgba(34, 211, 238, .25); }
.bm-cal-week-header.today .num { color: var(--c-accent); }

.bm-cal-week.days-mode .bm-cal-day-tile {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1px solid;
}
.bm-cal-day-tile.free    { background: rgba(74, 222, 128, .15);  border-color: rgba(74, 222, 128, .4); }
.bm-cal-day-tile.partial { background: rgba(251, 191, 36, .2);   border-color: rgba(251, 191, 36, .5); }
.bm-cal-day-tile.full    { background: rgba(248, 113, 113, .2);  border-color: rgba(248, 113, 113, .5); }

.bm-cal-week-hours {
    display: grid;
    grid-template-rows: repeat(auto-fill, 16px);
    gap: 2px;
}
.bm-cal-week-hcell {
    height: 16px;
    border-radius: 3px;
    border: 1px solid;
}
.bm-cal-week-hcell.free    { background: rgba(74, 222, 128, .12);  border-color: rgba(74, 222, 128, .25); }
.bm-cal-week-hcell.partial { background: rgba(251, 191, 36, .2);   border-color: rgba(251, 191, 36, .4); }
.bm-cal-week-hcell.full    { background: rgba(248, 113, 113, .25); border-color: rgba(248, 113, 113, .5); }
.bm-cal-week-hcell.closed  { background: repeating-linear-gradient(135deg, rgba(150,150,180,.05) 0 4px, rgba(150,150,180,.12) 4px 8px); border-color: rgba(150, 150, 180, .25); }

/* Month view */
.bm-cal-month {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.bm-cal-month-dow {
    text-align: center; padding: .4rem 0;
    font-size: .8rem; color: var(--c-muted);
    text-transform: uppercase; letter-spacing: .05em;
}
.bm-cal-month-cell {
    aspect-ratio: 1.2;
    padding: .35rem .5rem;
    border-radius: 8px;
    border: 1px solid;
    cursor: pointer;
    position: relative;
    transition: transform .12s, box-shadow .12s;
}
.bm-cal-month-cell:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.bm-cal-month-cell .day-num { font-family: var(--font-heading); font-weight: 600; font-size: 1rem; }
.bm-cal-month-cell.other { opacity: .35; }
.bm-cal-month-cell.today { box-shadow: 0 0 0 2px var(--c-accent), 0 0 16px rgba(34, 211, 238, .25); }
.bm-cal-month-cell.free    { background: rgba(74, 222, 128, .08);  border-color: rgba(74, 222, 128, .3); }
.bm-cal-month-cell.partial { background: rgba(251, 191, 36, .15); border-color: rgba(251, 191, 36, .4); }
.bm-cal-month-cell.full    { background: rgba(248, 113, 113, .18); border-color: rgba(248, 113, 113, .45); }
.bm-cal-month-cell.closed  { background: repeating-linear-gradient(135deg, rgba(150,150,180,.05) 0 6px, rgba(150,150,180,.14) 6px 12px); border-color: rgba(150, 150, 180, .25); opacity: .7; }

@media (max-width: 600px) {
    .bm-cal-toolbar { flex-direction: column; align-items: stretch; }
    .bm-cal-title { text-align: center; }
    .bm-cal-month-cell { aspect-ratio: 1; padding: .2rem; }
    .bm-cal-month-cell .day-num { font-size: .85rem; }
}

/* ---------- Modal (<dialog>) ---------- */
.bm-modal {
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius);
    padding: 1.8rem;
    background: var(--c-card-solid);
    color: var(--c-text);
    max-width: 560px;
    width: calc(100% - 2rem);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(167, 139, 250, .35);
}
.bm-modal::backdrop {
    background: rgba(10, 10, 26, 0.7);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.bm-modal h2 { margin-top: 0; }
.bm-modal[open] { animation: bmModalIn .2s ease-out; }
@keyframes bmModalIn {
    from { opacity: 0; transform: translateY(-12px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.bm-link-box {
    display: flex;
    gap: .4rem;
    align-items: stretch;
    margin: 1rem 0;
}
.bm-link-box input {
    flex: 1;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: .9rem;
    padding: .55rem .75rem;
}

/* ---------- Misc ---------- */
hr { border: 0; border-top: 1px solid var(--c-border); margin: 2rem 0; }
code {
    background: rgba(167, 139, 250, .15);
    color: var(--c-accent);
    padding: .15rem .4rem;
    border-radius: 4px;
    font-size: .9em;
}
.bm-sep { text-align: center; margin: 1.5rem 0; color: var(--c-muted); position: relative; }
.bm-sep::before, .bm-sep::after {
    content: ''; position: absolute; top: 50%; width: 35%;
    border-top: 1px solid var(--c-border);
}
.bm-sep::before { left: 0; } .bm-sep::after { right: 0; }

@media (max-width: 700px) {
    .bm-header .bm-container { flex-direction: column; align-items: flex-start; gap: .5rem; }
    .bm-header nav { width: 100%; flex-wrap: wrap; }
    h1 { font-size: 1.7rem; }
    .bm-stat-value { font-size: 1.9rem; }
}
