/*
 * AB Care — customer home after sign-in, in the unified design (8 Nov 2026).
 * Loaded after portal.css and re-tokens `.pc`: navy #071A33 and blue instead of indigo and gold,
 * one sans family, a dark header with the turning logo, a contract card whose seal counts the
 * days left, action tiles whose icons draw themselves, and visits as a timeline.
 * Motion is one load sequence; prefers-reduced-motion settles everything.
 */
.pc {
  --pc-ground: #F5F8FC; --pc-surface: #fff; --pc-surface-2: #F3F7FC;
  --pc-ink: #10223A; --pc-ink-2: #4A5A6E; --pc-muted: #5E6E82;
  --pc-line: #E3E9F1; --pc-line-soft: #EDF2F8;
  --pc-navy: #071A33; --pc-navy-deep: #071A33; --pc-gold: #5FB2FF;
  --pc-info: #0070E0; --pc-info-bg: #EAF4FF;
  --pc-ok: #0E7C5A; --pc-ok-bg: #E6F6EF;
  --ph-blue: #0070E0; --ph-sky: #5FB2FF; --ph-navy-2: #0D2647;
  --pc-display: "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  --pc-r: 14px; --pc-r-lg: 18px;
  --pc-shadow: 0 1px 2px #0718330a, 0 10px 26px -14px #07183326;
}
.pc-h1, .pc-h2 { font-weight: 800; letter-spacing: -.005em; }

/* ── header: dark, logo turns in with one ripple ── */
.pc { overflow-x: clip; }
.pc-head { background: #071A33; border-bottom: 0; }
.pc-head__mark { width: 40px; height: 40px; border-radius: 50%; }
.pc-head__mark img { width: 34px; height: 34px; }
.pc-head__id strong { color: #fff; font-weight: 800; }
.pc-head__id small { color: #8FB0D3; font-weight: 600; }
.pc-head .pc-bell { background: #ffffff0f; border-color: #ffffff22; color: #C9D8EA; }
.pc-head .pc-bell:hover { background: #ffffff1c; color: #fff; }
.pc-head .pc-bell--alert { color: #F5C27A; border-color: #f5c27a66; }
.pc-head .pc-bell--alert svg { transform-origin: 50% 10%; animation: ph-ring 2.4s ease-in-out 1.2s 2; }
@keyframes ph-ring { 0%, 60%, 100% { transform: none; } 8% { transform: rotate(14deg); } 18% { transform: rotate(-12deg); } 28% { transform: rotate(8deg); } 38% { transform: rotate(-5deg); } }
.pc-head > .pc-wrap > .pc-btn--sm { background: transparent; color: #C9D8EA; border-color: #ffffff2e; }
.pc-head > .pc-wrap > .pc-btn--sm:hover { background: #ffffff14; color: #fff; }
.pc-head #p-org-filter span { color: #8FB0D3 !important; }

/* ── hero band: navy, drifting grid, greeting settles word by word ── */
.pc-hero { overflow: hidden; isolation: isolate; border-radius: 0; margin-inline: calc(50% - 50vw); padding: 26px max(var(--pc-pad), calc(50vw - 590px + var(--pc-pad))) 30px;
  background: radial-gradient(70% 90% at 90% 0, #16437a 0, transparent 70%), radial-gradient(60% 80% at 0 100%, #0b3466 0, transparent 70%), #071A33; }
.pc-hero:has(+ #p-contract-card:not([hidden])) { padding-bottom: 86px; }
.pc-hero .pc-lede { color: #A9C3E0; }
.pc-eyebrow { color: #7BE0B8; font-weight: 700; }
.pc-eyebrow i { background: #3DD39A; box-shadow: 0 0 0 0 #3dd39a88; animation: cm-dot 1.9s ease-out infinite; }

/* ── the contract card: seal fills to the share of the contract still ahead ── */
#p-contract-card { position: relative; z-index: 2; margin: -64px 0 0; }
.ph-contract { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "seal head" "meta meta" "open open"; gap: 16px 16px; align-items: center; padding: 20px; border-radius: 18px; color: var(--pc-ink);
  background: #fff; border: 1px solid var(--pc-line); box-shadow: 0 24px 48px -26px #0718335c;
  animation: cm-card-in .7s cubic-bezier(.2, .8, .2, 1) .2s both; }
.ph-contract .ph-seal { grid-area: seal; } .ph-head { grid-area: head; min-width: 0; } .ph-meta { grid-area: meta; } .ph-contract .ph-open { grid-area: open; }
.ph-seal { --p: 0; position: relative; flex: none; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; text-align: center;
  background: conic-gradient(var(--ph-ring) calc(var(--p) * 360deg), #E3E9F1 0); animation: ph-seal 1.6s cubic-bezier(.2, .7, .2, 1) .45s forwards; }
.ph-seal { --ph-ring: #0A85FD; }
.ph-seal::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #fff; }
.ph-seal > * { position: relative; }
.ph-seal b { display: block; color: var(--pc-navy); font-size: 30px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.ph-seal span { font-size: 12px; color: var(--pc-muted); }
.ph-seal--warn { --ph-ring: #D98A1E; } .ph-seal--bad { --ph-ring: #C8331F; }
@keyframes ph-seal { to { --p: var(--to, 0); } }
.ph-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--pc-ok-bg); color: var(--pc-ok); }
.ph-chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ph-chip--warn { background: var(--pc-warn-bg); color: var(--pc-warn); } .ph-chip--bad { background: var(--pc-bad-bg); color: var(--pc-bad); }
.ph-contract h2 { margin: 8px 0 0; color: var(--pc-navy); font-size: 18px; font-weight: 800; line-height: 1.5; }
.ph-contract h2 small { color: var(--pc-muted); font-weight: 500; font-size: 13px; margin-inline-start: 6px; direction: ltr; unicode-bidi: isolate; }
.ph-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ph-meta div { background: var(--pc-surface-2); border: 1px solid var(--pc-line-soft); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.ph-meta small { display: block; font-size: 12px; color: var(--pc-muted); }
.ph-meta b { color: var(--pc-navy); font-size: 14px; font-weight: 700; }
.ph-contract .ph-open { justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--pc-line); background: #fff; color: var(--pc-navy); font: 700 14px var(--pc-sans); cursor: pointer; transition: background .15s, transform .15s; }
.ph-contract .ph-open:hover { background: var(--pc-surface-2); border-color: #C9DCF2; }
.ph-contract .ph-open svg { width: 16px; height: 16px; transition: transform .2s; }
.ph-contract .ph-open:hover svg { transform: translateX(-3px); }

/* ── quick actions: tiles rise in order, their icons draw themselves ── */
.ph-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.ph-acts:empty { display: none; }
.ph-act { display: grid; justify-items: center; gap: 8px; padding: 16px 8px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--pc-line);
  color: var(--pc-navy); font: 700 14px var(--pc-sans); text-align: center; text-decoration: none; cursor: pointer; box-shadow: var(--pc-shadow);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s, border-color .2s; animation: cm-up .55s cubic-bezier(.2, .8, .2, 1) both; }
.ph-act:nth-child(1) { animation-delay: .5s; } .ph-act:nth-child(2) { animation-delay: .58s; } .ph-act:nth-child(3) { animation-delay: .66s; } .ph-act:nth-child(4) { animation-delay: .74s; }
.ph-act:hover { transform: translateY(-3px); border-color: #C9DCF2; box-shadow: 0 16px 30px -18px #0718334d; }
.ph-act:focus-visible { outline: 3px solid var(--ph-sky); outline-offset: 2px; }
.ph-act .ph-ic { width: 44px; height: 44px; padding: 10px; border-radius: 13px; background: #EAF4FF; color: var(--ph-blue); transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.ph-act:hover .ph-ic { transform: scale(1.08) rotate(-4deg); }
.ph-act--main { background: linear-gradient(160deg, #0A85FD, #0062C9); color: #fff; border-color: transparent; }
.ph-act--main .ph-ic { background: #ffffff26; color: #fff; }
.ph-act .ph-ic [pathLength] { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ph-draw .9s ease-out forwards; }
.ph-act:nth-child(1) .ph-ic [pathLength] { animation-delay: .75s; } .ph-act:nth-child(2) .ph-ic [pathLength] { animation-delay: .85s; }
.ph-act:nth-child(3) .ph-ic [pathLength] { animation-delay: .95s; } .ph-act:nth-child(4) .ph-ic [pathLength] { animation-delay: 1.05s; }
@keyframes ph-draw { to { stroke-dashoffset: 0; } }

/* ── open requests in place of the numbers row ── */
#p-kpis:has(.ph-reqs) { display: block !important; }
.ph-reqs { gap: 10px; }
.ph-req { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--pc-line); border-radius: 12px; animation: cm-up .5s cubic-bezier(.2, .8, .2, 1) both; }
.ph-req:nth-child(3) { animation-delay: .08s; } .ph-req:nth-child(4) { animation-delay: .16s; }
.ph-req > .ph-ic { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--pc-surface-2); color: var(--pc-ink-2); }
.ph-req > div { flex: 1; min-width: 0; display: grid; }
.ph-req b { font-size: 14px; color: var(--pc-navy); font-weight: 700; }
.ph-req small { color: var(--pc-muted); font-size: 12px; justify-self: start; }

/* the cleaning offer: quiet border, one column on phones */
#p-care-offer .card { border-color: var(--pc-line) !important; }
@media (max-width: 760px) { #p-care-offer .p-cols { grid-template-columns: 1fr !important; } #p-care-offer .p-cols > div + div { border-inline-start: 0 !important; border-top: 1px solid var(--pc-line); } }

/* ── icons that replaced the emoji ── */
.ph-ic { width: 20px; height: 20px; flex: none; }
.pc-item__ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--pc-surface-2); color: var(--pc-ink-2); }
.pc-card__head--ok + .pc-item .pc-item__ic, .pc-card__head--ok ~ .pc-item .pc-item__ic { background: var(--pc-ok-bg); color: var(--pc-ok); }
.pc-card__head--warn ~ .pc-item .pc-item__ic { background: var(--pc-warn-bg); color: var(--pc-warn); }
.pc-notif__ic { color: currentColor; }
.pc-notif--info .pc-notif__ic { color: var(--pc-info); } .pc-notif--ok .pc-notif__ic { color: var(--pc-ok); }
.pc-notif--warn .pc-notif__ic { color: var(--pc-warn); } .pc-notif--bad .pc-notif__ic { color: var(--pc-bad); }
.ph-empty-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: #EAF4FF; color: var(--ph-blue); }
.ph-empty-ic .ph-ic { width: 26px; height: 26px; }

/* ── numbers row, cards and buttons in the new palette ── */
.pc-stat { border-radius: 14px; padding: 14px 16px; box-shadow: var(--pc-shadow); }
.pc-stat__label { font-weight: 700; }
.pc-num { font-weight: 800; color: var(--pc-navy); }
.pc-panel > * { animation: cm-up .5s cubic-bezier(.2, .8, .2, 1) both; }
.pc-panel > :nth-child(2) { animation-delay: .06s; } .pc-panel > :nth-child(3) { animation-delay: .12s; } .pc-panel > :nth-child(n+4) { animation-delay: .18s; }
.pc-btn--primary, .pc .btn-primary { background: var(--ph-blue); box-shadow: 0 10px 22px -12px #0070e0cc; border-radius: 10px; }
.pc-btn--primary:hover, .pc .btn-primary:hover { background: #005FC2; }
.pc-nav__btn[aria-current="page"] { background: #071A33; border-color: #071A33; }
.pc-nav__btn[aria-current="page"] .pc-nav__ic { color: var(--ph-sky); }
.pc-nav__btn[aria-current="page"] .pc-nav__n { background: var(--ph-sky); color: #071A33; }
.pc .card { border-radius: 14px; border-color: var(--pc-line); box-shadow: var(--pc-shadow); background: #fff; }

/* ── visits as a timeline: the next one hollow, done ones filled ── */
#p-visits { padding: 8px 18px 4px; }
#p-visits .pc-item { position: relative; border: 0; padding: 0 30px 18px 0; align-items: flex-start; }
#p-visits .pc-item::before { content: ""; position: absolute; right: 6px; top: 20px; bottom: 0; width: 2px; background: var(--pc-line); }
#p-visits .pc-item:last-child::before { display: none; }
#p-visits .pc-item::after { content: ""; position: absolute; right: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--ph-blue); background: #fff; box-sizing: border-box; }
#p-visits .pc-item--next::after { border-color: var(--pc-line); background: var(--pc-ground); }
#p-visits .pc-item--next .pc-h3 { color: var(--ph-blue); }
#p-visits .pc-empty { padding: 14px 0; }

@media (min-width: 760px) {
  .ph-contract { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "seal head open" "seal meta open"; gap: 10px 24px; padding: 24px 28px; }
  .ph-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ph-contract .ph-open { align-self: center; }
  .ph-seal { width: 128px; height: 128px; } .ph-seal b { font-size: 34px; }
  .ph-acts { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (max-width: 420px) { .ph-seal { width: 96px; height: 96px; } .ph-seal b { font-size: 26px; } .ph-contract { padding: 18px 16px; }
  .ph-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } .ph-meta div { padding: 8px; } .ph-meta b { font-size: 12.5px; } .ph-meta small { font-size: 11px; } }
/* switching sections scrolls to them below the sticky header, not under it */
.pc-shell { scroll-margin-top: 80px; }

@media (prefers-reduced-motion: reduce) {
  .ph-seal { animation: none; --p: var(--to, 0); }
  .ph-contract, .ph-act, .pc-panel > *, .pc-eyebrow i, .pc-head .pc-bell--alert svg { animation: none !important; }
  .ph-act .ph-ic [pathLength] { animation: none; stroke-dashoffset: 0; }
}

/* the visit report link under each approved visit */
.ph-report { justify-self: start; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 12px; border-radius: 999px; background: #EAF4FF; color: #0070E0; font-size: 13px; font-weight: 700; text-decoration: none; transition: background .15s; }
.ph-report:hover { background: #D8EAFE; }
.ph-report .ph-ic { width: 16px; height: 16px; }
