/* ZukoMail : composants propres à l'application, chargés après la charte ZUKO. */

/* ── Marque ──────────────────────────────────────────────────────────── */
.zm-brand-name { font-weight: 800; white-space: nowrap; }
.zm-brand-name small { font-weight: 700; font-size: .72em; color: var(--ph-muted); margin-left: 2px; }
.ph-brand { color: var(--ph-heading); }

/* ── Typographie et liens ────────────────────────────────────────────── */
.h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 800; }
.main-content a:not(.btn):not(.kpi-tile):not(.zm-filter), .zm-public main a:not(.btn) { text-decoration: none; }
.main-content a:not(.btn):not(.kpi-tile):not(.zm-filter):hover { text-decoration: underline; }
.kpi-tile.is-warning::before { background: #e5780b; }
body.dark-mode { --bs-link-color: #93c5fd; --bs-link-color-rgb: 147, 197, 253; --bs-link-hover-color: #ffd700; --bs-link-hover-color-rgb: 255, 215, 0; }
body.dark-mode .text-muted { color: #8a94ad !important; }
body.dark-mode .card-footer { background: #0f111a; border-top-color: #262b3a; }
body.dark-mode .input-group-text { background: #1c2130; border-color: #373e53; color: #9fa6bc; }

/* ── Barre du haut : recherche en champ ──────────────────────────────── */
.ph-search { margin: 0; }
.ph-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ph-heading); font-size: .85rem; }
.ph-search input::placeholder { color: var(--ph-faint); }
.ph-search:focus-within { border-color: var(--ph-primary); background: #fff; }
body.dark-mode .ph-search:focus-within { background: #0f111a; border-color: var(--ph-accent); }
.ph-menu form { margin: 0; }
.ph-menu button.dropdown-item { width: 100%; }

/* ── Menu latéral ────────────────────────────────────────────────────── */
.sidebar form { margin: 0; }

/* ── En-têtes de page ────────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head > div:first-child { min-width: 0; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
.page-head .page-intro { margin: 4px 0 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.card-title-sm { font-size: .95rem; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card-title-sm i { color: var(--ph-primary); }
body.dark-mode .card-title-sm i { color: var(--ph-accent); }

/* ── Barre de quota ──────────────────────────────────────────────────── */
.zm-quota { min-width: 140px; }
.zm-quota .progress { height: 8px; }
.zm-quota-label { display: flex; justify-content: space-between; gap: 8px; font-size: .76rem; color: var(--ph-muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.zm-quota-lg .progress { height: 12px; }
.zm-quota-lg .zm-quota-label { font-size: .85rem; }

/* ── Listes de détails ───────────────────────────────────────────────── */
.zm-dl { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 8px 16px; margin: 0; font-size: .88rem; }
.zm-dl dt { color: var(--ph-muted); font-weight: 700; }
.zm-dl dd { margin: 0; color: var(--ph-heading); overflow-wrap: anywhere; }
.zm-mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .9em; }

/* ── Journal ─────────────────────────────────────────────────────────── */
.zm-log { list-style: none; margin: 0; padding: 0; }
.zm-log li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ph-border); }
.zm-log li:last-child { border-bottom: 0; }
.zm-log-icon { width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; display: grid; place-items: center; font-size: .8rem; background: var(--ph-primary-soft); color: var(--ph-primary); }
.zm-log-icon.is-danger { background: #ffe0db; color: #b81800; }
.zm-log-icon.is-warning { background: #fff6e0; color: #bc3803; }
.zm-log-icon.is-success { background: #d9fbd0; color: #1c6c09; }
body.dark-mode .zm-log-icon { background: rgba(255, 255, 255, .06); color: var(--ph-accent); }
.zm-log-body { min-width: 0; flex: 1; }
.zm-log-title { font-weight: 700; font-size: .86rem; color: var(--ph-heading); }
.zm-log-text { font-size: .84rem; overflow-wrap: anywhere; }
.zm-log-meta { font-size: .74rem; color: var(--ph-faint); margin-top: 2px; }

/* ── Onglets de filtre ───────────────────────────────────────────────── */
.zm-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.zm-filters::-webkit-scrollbar { display: none; }
.zm-filter {
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    padding: 6px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700; text-decoration: none;
    color: var(--ph-text); background: var(--ph-card); border: 1px solid var(--ph-border);
}
.zm-filter:hover { border-color: var(--ph-border-strong); color: var(--ph-heading); }
.zm-filter.active { background: var(--ph-primary); border-color: var(--ph-primary); color: #fff; }
.zm-filter .zm-count { font-size: .72rem; opacity: .75; }
body.dark-mode .zm-filter.active { background: var(--ph-accent); border-color: var(--ph-accent); color: #0f111a; }

/* ── Mot de passe affiché une seule fois ─────────────────────────────── */
.zm-secret {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 14px 16px; border-radius: 10px; border: 1px dashed var(--ph-border-strong); background: var(--ph-bg);
}
.zm-secret code { font-size: 1.1rem; font-weight: 700; color: var(--ph-heading); letter-spacing: .03em; overflow-wrap: anywhere; flex: 1; min-width: 0; }

/* ── Vérificateur d'adresse ──────────────────────────────────────────── */
.zm-check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--ph-border); background: var(--ph-bg); }
.zm-check > i { font-size: 1.15rem; margin-top: 2px; }
.zm-check strong { display: block; color: var(--ph-heading); overflow-wrap: anywhere; }
.zm-check span { font-size: .85rem; color: var(--ph-muted); }
.zm-check.is-idle > i { color: var(--ph-faint); }
.zm-check.is-ok { background: #effbea; border-color: #a6f095; }
.zm-check.is-ok > i { color: #1c6c09; }
.zm-check.is-ko { background: #fff3f1; border-color: #fabcb3; }
.zm-check.is-ko > i { color: #b81800; }
body.dark-mode .zm-check.is-ok { background: rgba(37, 176, 3, .1); border-color: rgba(37, 176, 3, .3); }
body.dark-mode .zm-check.is-ko { background: rgba(237, 32, 0, .1); border-color: rgba(237, 32, 0, .3); }
.zm-suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: .8rem; color: var(--ph-muted); }
.zm-chip {
    border: 1px solid var(--ph-border-strong); background: var(--ph-card); color: var(--ph-primary);
    border-radius: 999px; padding: 4px 10px; font-size: .8rem; font-weight: 700;
}
.zm-chip:hover { background: var(--ph-primary-soft); }
body.dark-mode .zm-chip { color: var(--ph-accent); }

/* ── Choix segmenté ──────────────────────────────────────────────────── */
.zm-segment { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--ph-bg); border: 1px solid var(--ph-border); flex-wrap: wrap; }
.zm-segment input { position: absolute; opacity: 0; pointer-events: none; }
.zm-segment label { padding: 6px 14px; border-radius: 6px; font-weight: 700; font-size: .84rem; color: var(--ph-muted); }
.zm-segment input:checked + label { background: var(--ph-card); color: var(--ph-heading); box-shadow: 0 1px 3px rgba(20, 24, 36, .12); }
.zm-segment input:focus-visible + label { outline: 2px solid var(--ph-primary); outline-offset: 1px; }

/* ── Mots réservés ───────────────────────────────────────────────────── */
.zm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.zm-tag { font-size: .78rem; padding: 3px 8px; border-radius: 6px; background: var(--ph-bg); border: 1px solid var(--ph-border); color: var(--ph-text); }

/* ── Encart « à brancher » ───────────────────────────────────────────── */
.zm-todo { border: 1px dashed var(--ph-border-strong) !important; background: var(--ph-bg) !important; }

/* ═══ Page d'accueil ═══════════════════════════════════════════════════ */
.zm-nav { background: #fff; border-bottom: 1px solid var(--ph-border); position: sticky; top: 0; z-index: 1030; }
.zm-nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.zm-nav-brand { display: flex; align-items: center; gap: 10px; color: var(--ph-heading); font-size: 1.05rem; }
.zm-nav-actions { display: flex; align-items: center; gap: 8px; }
body.dark-mode .zm-nav { background: #141824; border-bottom-color: #262b3a; }
body.dark-mode .zm-nav-brand { color: #eff2f6; }

.zm-hero { background: #003366; color: #dbe6f3; padding: 56px 0 64px; box-shadow: inset 0 -4px 0 var(--nj-accent); }
body.dark-mode .zm-hero { background: #141824; box-shadow: inset 0 -1px 0 #262b3a; }
.zm-eyebrow { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--nj-accent); margin-bottom: 10px; }
.zm-offer .zm-eyebrow { color: var(--ph-muted); }
body:not(.dark-mode) .zm-hero h1, .zm-hero-title { color: #fff; font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.12; margin-bottom: 16px; }
.zm-hero-title span { color: var(--nj-accent); overflow-wrap: anywhere; }
.zm-hero-lead { font-size: 1.05rem; line-height: 1.55; max-width: 56ch; margin-bottom: 24px; }
.zm-btn-accent { --bs-btn-bg: var(--nj-accent); --bs-btn-border-color: var(--nj-accent); --bs-btn-color: #003366; --bs-btn-hover-bg: #ffe14d; --bs-btn-hover-border-color: #ffe14d; --bs-btn-hover-color: #003366; }
.zm-btn-ghost { --bs-btn-color: #fff; --bs-btn-border-color: rgba(255, 255, 255, .45); --bs-btn-hover-color: #003366; --bs-btn-hover-bg: #fff; --bs-btn-hover-border-color: #fff; }
.zm-checker { box-shadow: 0 18px 40px rgba(0, 0, 0, .25); }
.zm-checker .card-body { padding: 24px; }

.zm-section { padding: 56px 0; }
.zm-section-soft { background: #fff; border-top: 1px solid var(--ph-border); border-bottom: 1px solid var(--ph-border); }
body.dark-mode .zm-section-soft { background: #141824; border-color: #262b3a; }
.zm-section-title { font-size: 1.6rem; margin-bottom: 6px; }
.zm-section-intro { color: var(--ph-muted); margin-bottom: 24px; }
.zm-feature-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--ph-primary-soft); color: var(--ph-primary); font-size: 1.1rem; }
body.dark-mode .zm-feature-icon { color: var(--ph-accent); }
.zm-feature .card-body { padding: 20px; }

.zm-steps { list-style: none; counter-reset: step; padding: 0; margin: 20px 0 0; }
.zm-steps li { counter-increment: step; position: relative; padding: 0 0 20px 52px; line-height: 1.5; }
.zm-steps li::before {
    content: counter(step); position: absolute; left: 0; top: -2px; width: 36px; height: 36px; border-radius: 10px;
    display: grid; place-items: center; background: #003366; color: var(--nj-accent); font-weight: 900;
}
.zm-steps strong { color: var(--ph-heading); }
.zm-checklist { list-style: none; padding: 0; margin: 0 0 16px; }
.zm-checklist li { position: relative; padding: 6px 0 6px 28px; border-bottom: 1px solid var(--ph-border); }
.zm-checklist li:last-child { border-bottom: 0; }
.zm-checklist li::before { content: "\f00c"; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; left: 0; top: 7px; color: #1c6c09; }
.zm-offer { border-top: 4px solid var(--nj-accent) !important; }

.zm-footer { padding: 24px 0 32px; font-size: .82rem; color: var(--ph-muted); }

/* ── Connexion ───────────────────────────────────────────────────────── */
.zm-login { min-height: calc(100vh - 64px - 80px); display: grid; place-items: center; padding: 32px 16px; }
.zm-login .card { width: 100%; max-width: 420px; }
.zm-login .card-body { padding: 28px; }

@media (max-width: 768px) {
    .zm-hero { padding: 32px 0 40px; }
    .zm-section { padding: 36px 0; }
    .zm-checker .card-body { padding: 18px; }
    .zm-dl { grid-template-columns: 1fr; gap: 2px; }
    .zm-dl dd { margin-bottom: 8px; }
    .page-head .page-actions { width: 100%; }
    .zm-public .btn { min-height: 44px; }
}

/* ═══ Webmail (espace utilisateur) ═════════════════════════════════════ */
.zm-demo-note {
    display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 4px 10px;
    font-size: .74rem; font-weight: 700; color: var(--ph-muted);
    border: 1px dashed var(--ph-border-strong); border-radius: 999px; background: var(--ph-bg);
}
.zm-compose-btn { margin: 4px 0 6px; justify-content: center; }
.zm-nav-count {
    margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; text-align: center;
    font-size: .72rem; font-weight: 800; background: var(--ph-primary); color: #fff;
}
body.dark-mode .zm-nav-count { background: var(--ph-accent); color: #0f111a; }

.zm-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.zm-mobile-search { display: none; }

.zm-mail-card { overflow: hidden; }
.zm-mail-list { list-style: none; margin: 0; padding: 0; }
.zm-mail-list li + li { border-top: 1px solid var(--ph-border); }
.zm-mail-row { display: flex; gap: 12px; padding: 12px 16px; color: var(--ph-text); text-decoration: none !important; }
.zm-mail-row:hover { background: var(--ph-bg); color: var(--ph-text); }
.zm-avatar {
    width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
    background: var(--ph-primary-soft); color: var(--ph-primary); font-weight: 800; font-size: .95rem;
}
body.dark-mode .zm-avatar { background: rgba(255, 255, 255, .06); color: var(--ph-accent); }
.zm-mail-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.zm-mail-top { display: flex; align-items: baseline; gap: 8px; }
.zm-mail-from { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; color: var(--ph-heading); }
.zm-mail-date { flex-shrink: 0; font-size: .76rem; color: var(--ph-muted); font-variant-numeric: tabular-nums; }
.zm-mail-subject { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: .86rem; color: var(--ph-heading); }
.zm-mail-subject i { flex-shrink: 0; font-size: .78rem; color: var(--ph-muted); }
.zm-mail-preview { font-size: .8rem; color: var(--ph-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zm-mail-list li.is-unread .zm-mail-from, .zm-mail-list li.is-unread .zm-mail-subject { font-weight: 800; }
.zm-mail-list li.is-unread .zm-mail-date { color: var(--ph-primary); font-weight: 800; }
.zm-mail-list li.is-unread .zm-mail-row { box-shadow: inset 3px 0 0 var(--ph-accent); }
body.dark-mode .zm-mail-list li + li { border-top-color: #262b3a; }
body.dark-mode .zm-mail-row { color: #c4cad8; }
body.dark-mode .zm-mail-row:hover { background: rgba(255, 255, 255, .03); }
body.dark-mode .zm-mail-from, body.dark-mode .zm-mail-subject { color: #eff2f6; }
body.dark-mode .zm-mail-list li.is-unread .zm-mail-date { color: var(--ph-accent); }

.zm-read-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.zm-read-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.zm-read-actions form { margin: 0; }
.zm-message .card-body { padding: 24px; }
.zm-message-subject { font-size: 1.3rem; margin-bottom: 16px; overflow-wrap: anywhere; }
.zm-message-meta { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 16px; border-bottom: 1px solid var(--ph-border); }
.zm-message-people { flex: 1; min-width: 0; }
.zm-message-from { font-size: .92rem; overflow-wrap: anywhere; color: var(--ph-heading); }
.zm-message-from .text-muted { font-size: .84rem; margin-left: 4px; }
.zm-message-to { font-size: .8rem; color: var(--ph-muted); overflow-wrap: anywhere; }
.zm-message-date { font-size: .8rem; color: var(--ph-muted); white-space: nowrap; }
.zm-attachments { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; }
.zm-attachments li {
    display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 12px; font-size: .82rem;
    border: 1px solid var(--ph-border); border-radius: 8px; background: var(--ph-bg); color: var(--ph-heading);
}
.zm-attachments i { color: var(--ph-primary); }
body.dark-mode .zm-attachments li { background: #0f111a; border-color: #262b3a; color: #eff2f6; }
body.dark-mode .zm-attachments i { color: var(--ph-accent); }
.zm-message-body { white-space: pre-wrap; overflow-wrap: anywhere; padding-top: 20px; font-size: .95rem; line-height: 1.6; color: var(--ph-heading); }
body.dark-mode .zm-message-body, body.dark-mode .zm-message-from { color: #eff2f6; }
body.dark-mode .zm-message-meta { border-bottom-color: #262b3a; }

.zm-compose { max-width: 900px; }
.zm-compose-field { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.zm-compose-label { width: 56px; flex-shrink: 0; margin: 0; font-weight: 700; font-size: .85rem; color: var(--ph-muted); }
.zm-compose-static { font-size: .88rem; color: var(--ph-heading); min-width: 0; }
.zm-compose-body { margin-top: 6px; min-height: 280px; line-height: 1.55; }
.zm-compose-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

@media (max-width: 768px) {
    .zm-webmail .main-content { padding-left: calc(10px + var(--m-sal)); padding-right: calc(10px + var(--m-sar)); }
    .zm-demo-note { margin-bottom: 10px; }
    .zm-mobile-search {
        display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; margin-bottom: 12px;
        background: var(--ph-card); border: 1px solid var(--ph-border); border-radius: 999px; color: var(--ph-faint);
    }
    .zm-mobile-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ph-heading); font-size: 16px; }
    body.dark-mode .zm-mobile-search { background: #141824; border-color: #262b3a; }
    .zm-mail-row { padding: 12px; }
    .zm-read-actions .zm-label { display: none; }
    .zm-read-actions .btn, .zm-read-bar > .btn { min-height: 40px; min-width: 40px; justify-content: center; }
    .zm-message .card-body { padding: 16px; }
    .zm-message-subject { font-size: 1.12rem; }
    .zm-message-meta { flex-wrap: wrap; }
    .zm-message-date { width: 100%; padding-left: 50px; margin-top: -4px; }
    .zm-compose-field { flex-direction: column; align-items: stretch; gap: 4px; }
    .zm-compose-label { width: auto; }
    .zm-compose-actions .btn { flex: 1 1 auto; }
}
