/* Cati — pàgina de l'app per a familiars i cuidadors. Va a sobre de vendor + cati.css + funcions.css.
   Els components dibuixats copien l'app real (Flowbite / Tailwind: gray-50 #f9fafb, gray-200 #e5e7eb,
   gray-500 #6b7280, gray-900 #111827, blue-700 #1d4ed8, ...). */

/* ---------- hero ---------- */
.fm-hero { padding: 140px 0 40px; text-align: center; }
@media (min-width: 768px) { .fm-hero { padding: 190px 0 64px; } }
.fm-hero-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.fm-hero-title { font-size: min(38px, calc((100vw - 40px) / 10)); line-height: 1.1; font-weight: 600; letter-spacing: -0.025em; text-wrap: balance; }
@media (min-width: 768px) { .fm-hero-title { font-size: 56px; } }
@media (min-width: 1200px) { .fm-hero-title { font-size: 64px; } }
.fm-hero .fx-lead { max-width: 520px; text-wrap: balance; }

/* ---------- bento ---------- */
.fm-bento-sec { padding: 24px 0 72px; }
@media (min-width: 992px) { .fm-bento-sec { padding: 24px 0 120px; } }
.fm-bento { display: grid; gap: 16px; }
@media (min-width: 992px) {
  .fm-bento { gap: 20px; grid-template-columns: repeat(24, minmax(0, 1fr)); }
  .fm-card { grid-column: span 10; }
  .fm-card.is-wide { grid-column: span 14; }
}

/* each card: text + a drawn canvas, scaled with --k (design size: 675 or 465 px wide) */
.fm-card { --k: 1; --aw: 465px; --ah: 450px; --px: 24px;
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; padding: 30px var(--px) 0; border-radius: 28px; }
.fm-card.is-wide { --aw: 675px; --ah: 450px; }
.fm-card.is-wide.is-bottom { --ah: 450px; }
@media (min-width: 992px) { .fm-card.is-bottom .fm-card-sub { max-width: 560px; } }
.fm-card.is-bottom { flex-direction: column-reverse; padding: 0 var(--px) 30px; }
.fm-card-text { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 8px; }
.fm-card-title { font-size: 26px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; }
.fm-card-sub { color: var(--fx-muted); max-width: 400px; }
.fm-art { position: relative; height: calc(var(--ah) * var(--k)); margin: 24px calc(-1 * var(--px)) 0; }
.fm-card.is-bottom .fm-art { margin: 0 calc(-1 * var(--px)) 24px; }
.fm-canvas { position: absolute; top: 0; left: 50%; width: var(--aw); height: var(--ah); transform: translateX(-50%) scale(var(--k)); transform-origin: top center; }
.fm-card.is-bottom .fm-canvas { top: auto; bottom: 0; transform-origin: bottom center; }

@media (max-width: 479.98px) { .fm-card { --k: 0.7; } .fm-card.is-wide { --k: 0.5; } }
@media (min-width: 480px) and (max-width: 767.98px) { .fm-card { --k: 0.9; } .fm-card.is-wide { --k: 0.72; } }
@media (min-width: 768px) { .fm-card { --px: 44px; padding-top: 40px; } .fm-card.is-bottom { padding: 0 var(--px) 40px; } .fm-card-title { font-size: 32px; } }
@media (min-width: 992px) {
  .fm-card { --px: 52px; height: 600px; padding-top: 48px; }
  .fm-card.is-bottom { padding: 0 var(--px) 48px; }
  .fm-art { flex: 1; height: auto; margin-top: 28px; }
  .fm-card.is-bottom .fm-art { margin-bottom: 28px; }
}
@media (min-width: 992px) and (max-width: 1239.98px) { .fm-card, .fm-card.is-wide { --k: 0.8; } }
@media (min-width: 992px) and (max-width: 1099.98px) { .fm-card, .fm-card.is-wide { --k: 0.72; } }

.fm-card.is-grey { background: radial-gradient(90% 70% at 85% 100%, #e9e3e1 0%, transparent 70%), linear-gradient(160deg, #f6f6f7 0%, #eeeef0 100%); }
.fm-card.is-lilac { background: linear-gradient(180deg, #f5f2fd 0%, #e6dcfb 100%); }
.fm-card.is-mint { background: linear-gradient(180deg, #ecf8f2 0%, #bfe9d5 100%); }
.fm-card.is-rose { background: linear-gradient(180deg, #fdf3f2 0%, #f8d9d5 100%); }

/* ---------- phone ---------- */
.fm-canvas { font-family: Poppins, sans-serif; color: #111827; text-align: left; }
.fm-phone { position: absolute; width: 286px; height: 600px; padding: 9px; border-radius: 48px; background: #121212;
  box-shadow: 0 0 0 1.5px #3a3a3a inset, 0 40px 70px -30px rgba(0, 0, 0, 0.35); }
.fm-screen { position: relative; display: flex; flex-direction: column; height: 100%; border-radius: 39px; overflow: hidden; background: #fff; }
.fm-status { display: flex; align-items: center; justify-content: space-between; height: 44px; flex-shrink: 0; padding: 2px 20px 0 28px; font-size: 13px; font-weight: 600; }
.fm-island { position: absolute; left: 50%; top: 11px; width: 72px; height: 22px; margin-left: -36px; border-radius: 20px; background: #000; }
.fm-sys { display: flex; align-items: center; gap: 4px; }
.fm-sys svg { transform: scale(0.85); transform-origin: right center; }
.fm-apphead { flex-shrink: 0; display: flex; justify-content: center; padding: 2px 0 10px; border-bottom: 1px solid #e5e7eb; }
.fm-logo { width: 56px; height: auto; display: block; }
.fm-body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 14px; padding: 18px 18px; }
.fm-body > * { flex-shrink: 0; }
.fm-screen.is-end .fm-body { justify-content: flex-end; }
.fm-tabbar { flex-shrink: 0; display: flex; justify-content: space-around; align-items: center; height: 58px; padding-bottom: 6px; border-top: 1px solid #e5e7eb; color: #4b5563; }
.fm-tabbar .is-on { color: #2ecc71; }

/* breadcrumb: "Configuració > 💊 Medicació" */
.fm-crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: #374151; }
.fm-crumb svg { color: #9ca3af; width: 11px; height: 11px; }
.fm-crumb em { font-style: normal; color: #6b7280; }

/* shared form bits */
.fm-set { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid #e5e7eb; border-radius: 8px; background: #f9fafb; }
.fm-set > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fm-set b { font-size: 14px; font-weight: 500; color: #111827; }
.fm-set > span { font-size: 12px; line-height: 1.45; color: #6b7280; }
.fm-switch { position: relative; flex-shrink: 0; width: 40px; height: 22px; border-radius: 999px; background: #e5e7eb; }
.fm-switch::after { content: ''; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; }
.fm-switch.is-on { background: #2563eb; }
.fm-switch.is-on::after { transform: translateX(18px); }
.fm-btn-white, .fm-btn-gray { display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.fm-btn-white { background: #fff; border: 1px solid #d1d5db; color: #111827; }
.fm-btn-gray { background: #f3f4f6; color: #4b5563; }

/* ---------- 1. conversation ---------- */
.fm-chat-head { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 2px; }
.fm-chat-av { width: 80px; height: 80px; border-radius: 50%; margin-bottom: 8px; }
.fm-chat-head b { font-size: 16px; font-weight: 600; }
.fm-chat-head > span { font-size: 12px; color: #6b7280; }
.fm-dial { display: flex; gap: 12px; margin: 14px 0 4px; }
.fm-dial i { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid #e5e7eb; background: #fff; color: #6b7280; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.fm-msg { display: flex; align-items: flex-start; gap: 10px; }
.fm-msg-av { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.fm-msg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.fm-msg-who { display: flex; gap: 8px; font-size: 13px; }
.fm-msg-who b { font-weight: 600; color: #111827; }
.fm-msg-who span { color: #6b7280; }
.fm-audio { display: flex; align-items: center; padding: 14px; border-radius: 8px; background: #F8F9F9; color: #6b7280; font-size: 13px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.fm-audio svg { width: 20px; height: 20px; flex-shrink: 0; }
.fm-audio-l { margin-left: 12px; padding-left: 12px; border-left: 1px solid #e5e7eb; white-space: nowrap; }
.fm-audio-t { margin-left: auto; padding-left: 12px; border-left: 1px solid #e5e7eb; }
.fm-msg-status { font-size: 13px; color: #6b7280; }

  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }

/* ---------- 2. incoming call ---------- */
.fm-tilt-back { position: absolute; border-radius: 26px; background: rgba(255, 255, 255, 0.45); border: 1px solid rgba(255, 255, 255, 0.7); transform: rotate(-11deg); transform-origin: bottom left; }
.fm-tilt { position: absolute; z-index: 2; border-radius: 26px; background: #fff; transform: rotate(-4deg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 30px 60px -24px rgba(60, 30, 120, 0.35); }
.fm-call { display: flex; flex-direction: column; align-items: center; padding: 30px 22px 34px; }
.fm-call-logo { width: 80px; height: auto; }
.fm-call-av { display: grid; place-items: center; width: 120px; height: 120px; margin: 36px 0 20px; border-radius: 50%; background: #e5e7eb; }
.fm-call-av img { width: 112px; height: 112px; border-radius: 50%; background: #f3f4f6; }
.fm-call-name { font-size: 24px; font-weight: 600; color: #111827; margin-bottom: 4px; }
.fm-call-sub { font-size: 15px; color: #6b7280; }
.fm-call-btns { display: flex; gap: 56px; margin-top: 46px; }
.fm-call-btns i { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; color: #fff; box-shadow: 0 8px 20px rgba(17, 24, 39, 0.18); }
.fm-call-btns .is-no { background: #e74c3c; }
.fm-call-btns .is-yes { background: #2ecc71; animation: fm-bounce 1.2s ease-in-out infinite; }
@keyframes fm-bounce { 50% { transform: scale(1.06); } }

/* ---------- 3. medication ---------- */

.fm-addmed-ic { width: 48px; height: 48px; margin: 4px auto 0; border-radius: 50%; object-fit: cover; }
.fm-addmed-t { font-size: 16px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-addmed-s { margin: -8px 0 4px; font-size: 12px; color: #6b7280; text-align: center; }
.fm-time { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; background: #f9fafb; font-size: 13px; }
.fm-time svg { color: #6b7280; }

/* ---------- 4. intake calendar (.ingest_cal, .ingest_sheet) ---------- */
.fm-ingest { padding: 18px; }
.fm-alert-ok { padding: 14px 16px; border-radius: 8px; background: #f0fdf4; color: #166534; font-size: 13px; }
.fm-alert-ok b { font-weight: 600; }
.fm-cal { margin-top: 14px; padding: 12px; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.fm-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 14px; font-weight: 500; color: #374151; }
.fm-cal-head i { display: grid; place-items: center; width: 32px; height: 32px; color: #9ca3af; }
.fm-cal-head b { font-weight: 500; }
.fm-cal-wd, .fm-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; text-align: center; }
.fm-cal-wd { margin-bottom: 6px; font-size: 11px; color: #9ca3af; }
.fm-day { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid transparent; border-radius: 10px; background: #f9fafb; color: #9ca3af; font-size: 13px; }
.fm-day.is-green { background: #dcfce7; color: #15803d; font-weight: 500; }
.fm-day.is-today { border-color: #9ca3af; }
.fm-day.is-sel { border-color: #374151; box-shadow: inset 0 0 0 1px #374151; }

/* ---------- 5. calendar (FullCalendar listWeek, as styled in appstyles.css) and alarms ---------- */
.fm-fc-nav { display: flex; gap: 12px; }
.fm-fc-nav span { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; height: 32px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; font-weight: 500; color: #6b7280; }
.fm-fc-bar { padding: 12px 20px; border: 1px solid #e5e7eb; border-radius: 8px; background: #f9fafb; text-align: center; font-size: 14px; font-weight: 500; color: #374151; }
.fm-fc-day { display: flex; justify-content: space-between; gap: 8px; padding: 12px 16px; border: 1px solid #e5e7eb; border-radius: 8px; background: #f9fafb; font-size: 12.5px; }
.fm-fc-day b { font-weight: 500; color: #374151; }
.fm-fc-day span { color: #6b7280; white-space: nowrap; }
.fm-fc-evs { margin: -4px 0 0; padding: 0 16px; list-style: none; }
.fm-fc-evs li { display: flex; align-items: center; gap: 12px; padding: 4px 0; font-size: 13px; font-weight: 500; color: gray; }
.fm-fc-evs i { width: 10px; height: 10px; border-radius: 50%; border: 5px solid #3788d8; flex-shrink: 0; }

/* ---------- 6. emergency ---------- */
.fm-ephone { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 10px 10px 8px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
.fm-ephone-l { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fm-ephone-l b { font-size: 13px; font-weight: 500; white-space: nowrap; }
.fm-drag { display: grid; color: #d1d5db; }
.fm-flag { display: inline-flex; width: 16px; height: 16px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.fm-flag svg { width: 100%; height: 100%; }
.fm-ephone-r { display: flex; gap: 2px; }
.fm-ephone-r i { display: grid; place-items: center; width: 28px; height: 28px; color: #6b7280; }
.fm-ephone-r i.is-red { color: #dc2626; }
.fm-ephone + .fm-ephone { margin-top: -2px; }
.fm-btn-gray svg { width: 14px; height: 14px; }

/* ---------- floating pieces ---------- */
.fm-float { position: absolute; z-index: 3; background: #fff; border-radius: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 22px 44px -18px rgba(30, 30, 60, 0.28); }

/* ---------- download ---------- */
.sky-leaf { --sky-top: #179a55; --sky-bottom: #5cc98d; --cloud: rgba(235, 255, 243, 0.5); }
.fm-end-icon { width: 88px; height: 88px; margin-bottom: 24px; border-radius: 22px; box-shadow: 0 18px 36px -12px rgba(0, 60, 30, 0.35); }
.fm-end-stores { margin-top: 32px; }
.fm-stores-light .cati-store { background: #fff; color: #111; box-shadow: 0 10px 24px rgba(0, 60, 30, 0.16); transition: transform 0.2s var(--fx-ease); }
.fm-stores-light a.cati-store:hover { background: #fff; transform: translateY(-1px); }
.fm-stores-light .cati-store.is-disabled { background: rgba(255, 255, 255, 0.55); box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .fm-call-btns .is-yes { animation: none; }
}


.fm-body .fm-addmed-ic { margin-top: 2px; }

/* titles and subtitles centred over the centred phones */
.fm-card-text { align-items: center; text-align: center; }
.fm-card-sub { text-wrap: balance; }

/* more room between the card text and the phone */
.fm-art { margin-top: 36px; }
.fm-card.is-bottom .fm-art { margin-bottom: 36px; }
@media (min-width: 992px) {
  .fm-art { margin-top: 52px; }
  .fm-card.is-bottom .fm-art { margin-bottom: 52px; }
}
