/* ==========================================================================
   P12 : CARNET DE SANTÉ NUMÉRIQUE (mobile)
   Préfixe : phlt-
   ========================================================================== */

/* ---------- STRIP IDENTITÉ (compact, remplace le hero) ---------- */

.phlt-strip {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-gray-border);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  opacity: 0;
  animation: pat-fade-in 350ms var(--ease-out) 60ms forwards;
}

.phlt-strip__avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--color-primary-soft);
  flex-shrink: 0;
}

.phlt-strip__info {
  flex: 1;
  min-width: 0;
}

.phlt-strip__name {
  font-family: var(--font-heading);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--color-gray-dark);
  margin-bottom: 2px;
}

.phlt-strip__meta {
  font-size: var(--fs-xs);
  color: var(--color-gray);
}

.phlt-strip__chips {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}

.phlt-strip__chip {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.phlt-strip__chip--blood {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.phlt-strip__chip--allergy {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border: 1px solid rgba(187, 58, 10, 0.15);
}

/* ---------- CONTENU SCROLLABLE ---------- */

.phlt-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ---------- TUILES MÉTRIQUES 2x2 ---------- */

.phlt-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  flex-shrink: 0;
  opacity: 0;
  animation: pat-slide-up 360ms var(--ease-out) 120ms forwards;
}

.phlt-metric {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-gray-border);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.phlt-metric__icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.phlt-metric__icon--primary { background: var(--color-primary-soft); color: var(--color-primary); }
.phlt-metric__icon--success { background: var(--color-success-soft); color: var(--color-success); }

.phlt-metric__value {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--color-gray-dark);
  line-height: 1;
}

.phlt-metric__unit {
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  color: var(--color-gray);
  margin-left: 1px;
}

.phlt-metric__label {
  font-size: var(--fs-xs);
  color: var(--color-gray);
  line-height: 1.3;
}

.phlt-metric__badge {
  display: inline-block;
  font-size: 10px;
  font-weight: var(--fw-semibold);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--color-success-soft);
  color: var(--color-success);
}

/* ---------- SECTIONS ---------- */

.phlt-section {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-gray-border);
  overflow: hidden;
  flex-shrink: 0;
  opacity: 0;
  animation: pat-slide-up 360ms var(--ease-out) forwards;
}

.phlt-section__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-gray-border);
}

.phlt-section__icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.phlt-section__title {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-gray-dark);
  flex: 1;
}

.phlt-section__count {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--color-gray);
  background: var(--color-bg);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-gray-border);
}

/* ---------- TRAITEMENT ---------- */

.phlt-treatment {
  padding: var(--space-3) var(--space-4);
}

.phlt-treatment__top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.phlt-treatment__pill-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--color-success-soft);
  color: var(--color-success);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.phlt-treatment__name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-gray-dark);
  margin-bottom: 2px;
}

.phlt-treatment__posology {
  font-size: var(--fs-xs);
  color: var(--color-gray);
}

.phlt-treatment__status {
  margin-left: auto;
  font-size: 10px;
  font-weight: var(--fw-semibold);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--color-success-soft);
  color: var(--color-success);
  flex-shrink: 0;
}

.phlt-progress {
  height: 5px;
  background: var(--color-gray-lighter);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.phlt-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-success) 100%);
  border-radius: var(--radius-full);
  animation: phlt-progress-in 900ms var(--ease-out) 500ms both;
}

@keyframes phlt-progress-in {
  from { width: 0%; }
  to   { width: 25%; }
}

.phlt-progress-meta {
  display: flex;
  justify-content: space-between;
}

.phlt-progress-label {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--color-primary);
}

.phlt-progress-next {
  font-size: 10px;
  color: var(--color-gray);
}

/* ---------- TIMELINE CONSULTATIONS ---------- */

.phlt-timeline {
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
}

.phlt-tl-item {
  display: flex;
  gap: var(--space-3);
}

.phlt-tl-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 5px;
  width: 10px;
  flex-shrink: 0;
}

.phlt-tl-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.phlt-tl-dot--recent { background: var(--color-primary); }
.phlt-tl-dot--past   { background: var(--color-gray-lighter); }

.phlt-tl-line {
  width: 1.5px;
  flex: 1;
  min-height: 12px;
  background: var(--color-gray-border);
  margin-top: 4px;
}

.phlt-tl-item:last-child .phlt-tl-line {
  display: none;
}

.phlt-tl-card {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
}

.phlt-tl-date {
  width: 36px;
  height: 40px;
  background: var(--color-primary-soft);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.phlt-tl-date--past { background: var(--color-bg); }

.phlt-tl-day {
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--color-primary);
  line-height: 1;
}

.phlt-tl-date--past .phlt-tl-day { color: var(--color-gray); }

.phlt-tl-month {
  font-size: 9px;
  font-weight: var(--fw-semibold);
  color: var(--color-primary);
  text-transform: uppercase;
}

.phlt-tl-date--past .phlt-tl-month { color: var(--color-gray-light); }

.phlt-tl-info {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.phlt-tl-doctor {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-gray-dark);
  margin-bottom: 3px;
}

.phlt-tl-motif {
  font-size: var(--fs-xs);
  color: var(--color-gray);
  line-height: 1.4;
}
