/* ==========================================================================
   demo-engage.css — Carnet de Vie v2, Lot 7 : engagement long terme.
   Bulletin mensuel, check-in hebdo, suivis de symptôme + bottom sheets.
   Variables héritées de demo-core.css (chargé en critique) → pas de fallback.
   ========================================================================== */

/* --- Conteneur du hub --- */
.engage-slot {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 4px 0 8px;
}

/* --- Cartes bulletin / check-in --- */
.engage-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.engage-bulletin { border-left: 3px solid var(--c-accent-vivid); }
.engage-checkin { border-left: 3px solid var(--c-primary-soft); }
.engage-ico { font-size: 22px; line-height: 1; flex-shrink: 0; }
.engage-body { flex: 1; min-width: 0; }
.engage-title {
    font-weight: 600;
    color: var(--c-text);
    font-size: 15px;
    line-height: 1.3;
}
.engage-sub {
    font-size: 13px;
    color: var(--c-text-muted);
    margin-top: 2px;
}
.engage-cta {
    flex-shrink: 0;
    background: var(--c-primary);
    color: var(--c-text-inverse);
    border: none;
    border-radius: 9999px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    min-height: 40px;
    cursor: pointer;
    transition: background 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
.engage-cta:hover { background: var(--c-primary-hover); }
.engage-cta--soft {
    background: var(--c-bg-warm);
    color: var(--c-primary);
}
.engage-cta--soft:hover { background: var(--c-primary-light); }

/* --- Section suivis de symptôme --- */
.engage-symptoms {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.engage-section-title {
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--c-text-secondary);
}
.symptom-track {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: 16px;
    padding: 14px 16px;
}
.symptom-track-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}
.symptom-track-label { font-weight: 600; color: var(--c-text); }
.symptom-track-day { font-size: 13px; color: var(--c-text-muted); flex-shrink: 0; }

.symptom-spark {
    width: 100%;
    height: 44px;
    margin: 10px 0 4px;
    display: block;
}
.symptom-spark polyline {
    fill: none;
    stroke: var(--c-primary-soft);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}
.symptom-spark circle { fill: var(--c-primary); }
.symptom-spark--empty {
    font-size: 13px;
    color: var(--c-text-muted);
    padding: 10px 0;
}
.symptom-track-trend { font-size: 13px; font-weight: 600; }
.symptom-trend--worsening { color: var(--c-danger); }
.symptom-trend--improving { color: var(--c-success); }
.symptom-trend--stable { color: var(--c-text-muted); }

.symptom-consult {
    background: var(--c-accent-light);
    border: 1px solid var(--c-accent-soft);
    border-radius: 12px;
    padding: 12px;
    margin: 10px 0;
}
.symptom-consult-title { font-weight: 700; color: var(--c-accent-hover); font-size: 14px; }
.symptom-consult-body { font-size: 13px; color: var(--c-text-secondary); margin: 4px 0 10px; }
.symptom-consult-cta {
    background: var(--c-accent-vivid);
    color: var(--c-text-inverse);
    border: none;
    border-radius: 9999px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    min-height: 40px;
    cursor: pointer;
}
.symptom-consult-cta:hover { background: var(--c-accent-vivid-hover); }

.symptom-track-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.symptom-log-btn {
    flex: 1;
    background: var(--c-primary);
    color: var(--c-text-inverse);
    border: none;
    border-radius: 12px;
    padding: 11px;
    font-weight: 600;
    font-size: 14px;
    min-height: 44px;
    cursor: pointer;
}
.symptom-log-btn:hover { background: var(--c-primary-hover); }
.symptom-resolve-btn {
    background: var(--c-bg-warm);
    color: var(--c-text-secondary);
    border: none;
    border-radius: 12px;
    padding: 11px 16px;
    font-weight: 600;
    font-size: 14px;
    min-height: 44px;
    cursor: pointer;
}
.symptom-disclaimer {
    font-size: 11px;
    color: var(--c-text-muted);
    margin-top: 10px;
    line-height: 1.4;
}

/* ==========================================================================
   Card in-chat « démarrer un suivi de symptôme » (proposée par l'agent)
   ========================================================================== */
.symptom-tracker-card {
    width: min(720px, calc(100vw - 48px));
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: 16px;
    padding: 14px 16px;
    contain: layout paint style;
    animation: symptom-card-in 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes symptom-card-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Anti-scintillement : pas d'animation d'entrée tant que le bubble streame. */
.chat-bubble.agent.streaming .symptom-tracker-card { animation: none !important; }
.symptom-tracker-head { display: flex; align-items: center; gap: 10px; }
.symptom-tracker-ico { font-size: 22px; }
.symptom-tracker-q { font-weight: 600; color: var(--c-text); }
.symptom-tracker-hint {
    font-size: 12px;
    color: var(--c-text-muted);
    margin: 8px 0 12px;
    line-height: 1.4;
}
.symptom-tracker-btn {
    width: 100%;
    background: var(--c-primary);
    color: var(--c-text-inverse);
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-weight: 600;
    font-size: 15px;
    min-height: 46px;
    cursor: pointer;
}
.symptom-tracker-btn:hover { background: var(--c-primary-hover); }
.symptom-card--done { opacity: 0.75; }

/* ==========================================================================
   Bottom sheet (own overlay, hors registre modal)
   ========================================================================== */
.engage-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 9650;
    background: rgba(19, 21, 22, 0.45);
    display: flex;
    align-items: center;      /* modale centrée (cohérent avec la sheet de partage) */
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
}
.engage-sheet-overlay--open { opacity: 1; pointer-events: auto; }
.engage-sheet {
    position: relative;
    background: var(--c-bg-warm);
    width: 100%;
    max-width: 480px;
    max-height: min(88vh, 720px);
    border-radius: 20px;
    padding: 20px 20px 22px;
    overflow-y: auto;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 12px 40px rgba(19, 21, 22, 0.25);
    -webkit-overflow-scrolling: touch;
}
.engage-sheet-overlay--open .engage-sheet { transform: translateY(0) scale(1); }
/* Poignée de bottom-sheet : masquée en modale centrée. */
.engage-sheet-handle { display: none; }
.engage-sheet-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--c-text-muted);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    border-radius: 9999px;
}
.engage-sheet-title {
    font-weight: 700;
    font-size: 19px;
    color: var(--c-text);
    padding-right: 40px;
}
.engage-sheet-sub {
    font-size: 14px;
    color: var(--c-text-muted);
    margin: 4px 0 12px;
}

/* --- Formulaire check-in --- */
.checkin-form { display: flex; flex-direction: column; }
.checkin-q { margin: 10px 0; }
.checkin-q-label { font-weight: 600; color: var(--c-text); margin-bottom: 8px; font-size: 15px; }
.checkin-opts { display: flex; gap: 8px; }
.checkin-opt {
    flex: 1;
    padding: 12px 8px;
    border: 1.5px solid var(--c-border);
    border-radius: 12px;
    background: var(--c-bg-card);
    color: var(--c-text-secondary);
    font-size: 14px;
    font-weight: 500;
    min-height: 46px;
    cursor: pointer;
    transition: all 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}
.checkin-opt--sel {
    background: var(--c-primary);
    color: var(--c-text-inverse);
    border-color: var(--c-primary);
}
.checkin-note, .symptom-note {
    width: 100%;
    border: 1.5px solid var(--c-border);
    border-radius: 12px;
    padding: 12px;
    font-size: 16px; /* ≥16px : anti-zoom iOS */
    font-family: inherit;
    color: var(--c-text);
    background: var(--c-bg-card);
    resize: vertical;
    margin-top: 8px;
    box-sizing: border-box;
}
.engage-submit {
    width: 100%;
    background: var(--c-accent-vivid);
    color: var(--c-text-inverse);
    border: none;
    border-radius: 14px;
    padding: 15px;
    font-weight: 700;
    font-size: 16px;
    min-height: 50px;
    cursor: pointer;
    margin-top: 14px;
    transition: background 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
.engage-submit:hover { background: var(--c-accent-vivid-hover); }
.engage-submit:disabled { opacity: 0.6; cursor: default; }

/* --- Sélecteur d'intensité (symptôme) --- */
.symptom-sev-row { display: flex; gap: 6px; margin: 6px 0; }
.symptom-sev {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 2px;
    border: 1.5px solid var(--c-border);
    border-radius: 12px;
    background: var(--c-bg-card);
    color: var(--c-text-secondary);
    cursor: pointer;
    min-height: 60px;
    transition: all 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}
.symptom-sev--sel { border-color: var(--c-primary); background: var(--c-primary-light); color: var(--c-primary); }
.symptom-sev-n { font-weight: 800; font-size: 18px; }
.symptom-sev-lbl { font-size: 10px; text-align: center; line-height: 1.1; }
.symptom-photo-btn {
    width: 100%;
    background: var(--c-bg-card);
    border: 1.5px dashed var(--c-border);
    border-radius: 12px;
    padding: 12px;
    color: var(--c-text-secondary);
    font-size: 14px;
    font-weight: 600;
    min-height: 46px;
    cursor: pointer;
    margin-top: 10px;
}
.symptom-photo-status { font-size: 13px; color: var(--c-success); text-align: center; margin-top: 6px; }

/* --- Lecteur de bulletin --- */
.bulletin-reader { padding: 4px 0 8px; }
.bulletin-reader-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.bulletin-reader-ico { font-size: 26px; }
.bulletin-reader-title { font-size: 20px; font-weight: 800; color: var(--c-text); margin: 0; }
.bulletin-reader-badge {
    display: inline-block;
    background: var(--c-primary-light);
    color: var(--c-primary);
    border-radius: 9999px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    margin: 8px 0;
}
.bulletin-reader-body { color: var(--c-text); font-size: 15.5px; line-height: 1.65; }
.bulletin-reader-body p { margin: 0 0 12px; }
.bulletin-reader-note {
    font-size: 11px;
    color: var(--c-text-muted);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--c-border-light);
}
.bulletin-loading { text-align: center; color: var(--c-text-muted); padding: 24px; }

/* --- Tactile : cibles ≥ 44px déjà respectées ; désactivation des transitions --- */
@media (prefers-reduced-motion: reduce) {
    .engage-sheet, .engage-sheet-overlay, .symptom-tracker-card,
    .engage-cta, .checkin-opt, .symptom-sev, .engage-submit {
        transition: none !important;
        animation: none !important;
    }
}

@media (max-width: 480px) {
    .engage-card { padding: 12px 14px; }
    .engage-title { font-size: 14px; }
    .checkin-opt { font-size: 13px; padding: 11px 6px; }
}
