/* ============================================================
   App shell pages — signin.html + dashboard.html
   A clean care-portal UI in the site palette. Builds on style.css.
   Front-end illustration only; no live data, no medical data.
   ============================================================ */

/* ============================================================
   SIGN-IN  (signin.html)
   ============================================================ */
.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(circle at 50% -10%, #ffffff, #e7eef6 72%);
}
.auth__card {
  width: 100%;
  max-width: 424px;
  background: #fff;
  border-radius: var(--r-3xl);
  box-shadow: var(--shadow-card);
  padding: 34px 30px 26px;
}
.auth__logo {
  display: block;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--navy-ink);
}
.auth__logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  width: 52px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--teal-card), var(--teal-mist));
  color: var(--teal-deep);
}
.auth__logo-mark svg { height: 28px; width: 28px; }

.seg {
  display: flex;
  gap: 4px;
  margin: 22px 0 6px;
  padding: 4px;
  border-radius: var(--r-full);
  background: var(--frame-soft);
}
.seg__btn {
  flex: 1;
  text-align: center;
  padding: 9px 10px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.seg__btn--active {
  background: #fff;
  color: var(--navy-ink);
  box-shadow: 0 1px 3px rgba(2, 43, 91, 0.12);
}

.auth__title {
  margin-top: 18px;
  text-align: center;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--navy-ink);
}
.auth__sub {
  margin-top: 6px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.auth__form { margin-top: 22px; }
.field { margin-top: 14px; }
.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-ink);
}
.field__input {
  width: 100%;
  border: 1px solid var(--frame);
  border-radius: 12px;
  background: var(--cream);
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--navy-ink);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.field__input:focus {
  outline: none;
  border-color: var(--teal);
  background: #fff;
}

.auth__error {
  display: flex;
  gap: 9px;
  margin-top: 16px;
  border-radius: 12px;
  background: #fdecec;
  color: #b4332e;
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.45;
}
.auth__error svg { flex-shrink: 0; margin-top: 1px; }

.auth__submit { margin-top: 20px; width: 100%; }

.auth__links {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}
.auth__links a { color: var(--teal-deep); }
.auth__links a:hover { text-decoration: underline; }

.auth__support {
  margin-top: 20px;
  border-top: 1px solid var(--frame-soft);
  padding-top: 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.auth__support a { color: var(--navy-ink); font-weight: 600; }

.auth__check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}
.auth__check input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--teal);
}
.field--split {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

/* ============================================================
   DASHBOARD  (dashboard.html)
   ============================================================ */
.portal {
  display: flex;
  min-height: 100vh;
  background: #eaeef4;
}

/* ---- sidebar ---- */
.portal__side {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 244px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
  border-right: 1px solid var(--frame);
  padding: 24px 16px;
}
.side__brand {
  display: block;
  padding: 6px 10px 14px;
}
.side__brand:hover .side__brand-name { color: var(--teal-deep); }
.side__brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--navy-ink);
  line-height: 1.1;
}
.side__brand-sub {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.side__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.side__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 13px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.side__link:hover { background: var(--cream); color: var(--navy-ink); }
.side__link svg { height: 20px; width: 20px; flex-shrink: 0; }
.side__link--active {
  background: var(--teal-card);
  color: var(--teal-deep);
}
.side__user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  background: var(--cream);
  padding: 10px 12px;
}
.side__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  width: 38px;
  flex-shrink: 0;
  border-radius: var(--r-full);
  background: var(--navy-deep);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.side__name { font-size: 13.5px; font-weight: 700; color: var(--navy-ink); line-height: 1.1; }
.side__role { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--teal-deep); }

/* ---- main ---- */
.portal__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 24px 96px;
}
@media (min-width: 1024px) { .portal__main { padding: 28px 32px 32px; } }

.portal__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.portal__greeting {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--navy-ink);
}
.portal__greeting .ph { font-size: inherit; }
.portal__subline {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.portal__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--r-full);
  background: var(--teal-card);
  color: var(--teal-deep);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
}
.pill svg { height: 15px; width: 15px; }

.portal__banner {
  display: flex;
  gap: 9px;
  margin-top: 16px;
  border-radius: 13px;
  background: #fff;
  border: 1px solid var(--frame);
  padding: 11px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.portal__banner svg { flex-shrink: 0; margin-top: 1px; color: var(--teal-deep); }

/* ---- card grid ---- */
.portal__grid {
  margin-top: 18px;
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}
.pcard {
  background: #fff;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 0 0 1px rgba(2, 43, 91, 0.04), 0 10px 30px -22px rgba(2, 43, 91, 0.3);
}
.pcard__title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--navy-ink);
}
.pcard__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* care activity */
.care__sub { margin-top: 4px; font-size: 12.5px; line-height: 1.5; color: var(--muted); max-width: 46ch; }
.care__status { text-align: right; flex-shrink: 0; }
.care__status-val { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--teal-deep); line-height: 1; }
.care__status-cap { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.spark {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 8px;
  height: 96px;
}
.spark__bar {
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--teal-soft), var(--teal-card));
}
.spark__bar--hi { background: linear-gradient(180deg, var(--teal), var(--teal-soft)); }
.spark__labels {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--hair);
  text-align: center;
}

/* calls card */
.pcard--calls { display: flex; flex-direction: column; }
.calls__body { display: flex; flex: 1; align-items: center; gap: 18px; margin-top: 14px; }
.calls__ring { position: relative; height: 92px; width: 92px; flex-shrink: 0; }
.calls__ring svg { height: 100%; width: 100%; transform: rotate(-90deg); }
.calls__ring-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.calls__ring-num b { font-size: 20px; font-weight: 800; color: var(--navy-ink); line-height: 1; }
.calls__ring-num span { font-size: 10px; color: var(--muted); }
.calls__next { font-size: 13px; color: var(--muted); }
.calls__next b { display: block; font-size: 14px; color: var(--navy-ink); margin-top: 2px; }
/* calls ring animates empty -> filled on load (dashboard ring is above the fold) */
@keyframes calls-ring-fill {
  from { stroke-dashoffset: 198; }
  to { stroke-dashoffset: 0; }
}
.calls__ring svg circle:last-of-type {
  animation: calls-ring-fill 1.3s var(--ease-spring) both;
}
@media (prefers-reduced-motion: reduce) {
  .calls__ring svg circle:last-of-type { animation: none; }
}

/* service progress */
.svc-list { margin-top: 16px; display: flex; flex-direction: column; }
.svc {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 4px;
  border-top: 1px solid var(--frame-soft);
}
.svc:first-child { border-top: 0; }
.svc__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  width: 36px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--teal-card);
  color: var(--teal-deep);
}
.svc__icon svg { height: 19px; width: 19px; }
.svc__body { flex: 1; min-width: 0; }
.svc__name { font-size: 13.5px; font-weight: 700; color: var(--navy-ink); }
.svc__status { font-size: 12px; color: var(--muted); }
.svc__tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--r-full);
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 700;
}
.svc__tag svg { height: 13px; width: 13px; }
.svc__tag--done { background: var(--teal-card); color: var(--teal-deep); }
.svc__tag--prog { background: var(--orange-soft); color: var(--orange-deep); }
.svc__tag--next { background: var(--blue-soft); color: var(--blue-deep); }

/* upcoming (dark) */
.pcard--upcoming {
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 0%, #143a64, var(--navy-deep) 82%);
  color: #fff;
}
.pcard--upcoming .pcard__title { color: #fff; }
.up-list { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.up {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
}
.up__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  width: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  background: rgba(127, 182, 178, 0.22);
  color: #bfe3df;
}
.up__icon svg { height: 17px; width: 17px; }
.up__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: rgba(255, 255, 255, 0.6); }
.up__text { font-size: 13.5px; font-weight: 700; margin-top: 1px; }
.up__cta { margin-top: auto; padding-top: 0; width: 100%; background: var(--teal); color: #fff; }
.up-list { flex: 1; margin-bottom: 14px; }
.up__cta:hover { background: var(--teal-deep); }

/* empty / first-time state note */
.portal__empty {
  margin-top: 18px;
  border-radius: 14px;
  border: 1px dashed var(--hair);
  background: #fff;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--muted);
}
.portal__empty b { color: var(--navy-ink); }

/* footer */
.portal__foot {
  margin-top: 26px;
  border-top: 1px solid var(--frame);
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.portal__foot-brand { font-size: 14px; font-weight: 700; color: var(--navy-ink); }
.portal__foot-links { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px; color: var(--muted); }
.portal__foot-links a:hover { color: var(--navy-ink); }
.portal__foot-note { width: 100%; font-size: 12px; color: var(--muted); }
.portal__foot-note a { color: var(--navy-ink); font-weight: 600; }

/* ---- mobile bottom tab bar ---- */
.tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--frame);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
.tabbar__nav { display: flex; }
.tabbar__link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}
.tabbar__link svg { height: 22px; width: 22px; }
.tabbar__link--active { color: var(--teal-deep); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 720px) {
  .portal__grid {
    grid-template-columns: 1fr 1fr;
  }
  .pcard--care { grid-column: span 2; }
  .pcard--services { grid-column: span 2; }
}

@media (min-width: 1024px) {
  .portal__grid {
    grid-template-columns: 1.55fr 1fr;
    grid-template-areas:
      "care     calls"
      "services upcoming";
  }
  .pcard--care { grid-area: care; }
  .pcard--calls { grid-area: calls; }
  .pcard--services { grid-area: services; }
  .pcard--upcoming { grid-area: upcoming; }
}

/* below 1024: hide sidebar, show bottom tabs */
@media (max-width: 1023px) {
  .portal__side { display: none; }
  .tabbar { display: block; }
}
