/* Ukalo Web: client portal + team admin styling.
   Loaded as an external stylesheet (allowed by the CSP: style-src 'self').
   Uses the site's own colour variables, so it follows the existing dark look. */

/* ---------- page shell: compact title band, content right below ---------- */
main:has(#portal-root) > .sec.d,
main:has(#admin-root) > .sec.d { padding: 56px 0 32px !important; }
main:has(#portal-root) > .sec.d h1,
main:has(#admin-root) > .sec.d h1 { font-size: clamp(1.9rem, 5vw, 2.9rem) !important; margin-bottom: .35em; }
main:has(#portal-root) > .sec.d p.m,
main:has(#admin-root) > .sec.d p.m { font-size: 1rem !important; max-width: 520px !important; margin-bottom: 0; }
main:has(#portal-root) > .sec.d .w { text-align: center; }
main:has(#portal-root) > .sec.d p.m { margin-left: auto; margin-right: auto; }
main:has(#portal-root) > .sec.l,
main:has(#admin-root) > .sec.l { padding: 8px 0 96px !important; overflow: visible; }
#portal-root, #admin-root { max-width: none !important; }
nav a[href="#portal"] { display: none; } /* the header already has a Client Login button */

/* ---------- card ---------- */
.px-card {
  background: linear-gradient(180deg, rgba(255,255,255,.035), transparent 140px), var(--card);
  border: 1px solid var(--bd);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
}
.px-auth { max-width: 440px; margin: 0 auto; }
.px-wrap { max-width: 880px; margin: 0 auto; }
.px-wide { max-width: 1120px; margin: 0 auto; }
.px-h { font-size: 1.55rem; margin: 0 0 6px; }
.px-sub { color: var(--mut); font-size: .95rem; margin: 0 0 22px; line-height: 1.55; }
.px-foot { text-align: center; color: var(--mut); font-size: .85rem; margin: 18px 0 0; }
.px-foot a { color: var(--fg); }
.px-i { flex: 0 0 auto; display: block; }

/* ---------- tabs ---------- */
.px-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 24px;
  background: rgba(255,255,255,.04); border: 1px solid var(--bd); border-radius: 14px;
}
.px-tab {
  border: 0; background: transparent; color: var(--mut); cursor: pointer;
  min-height: 42px; border-radius: 10px; font: 600 .92rem var(--bf);
  transition: background .2s, color .2s;
}
.px-tab:hover { color: var(--fg); }
.px-tab[aria-selected="true"] { background: #f2f2f2; color: #0b0b0b; }

/* ---------- buttons ---------- */
.b.px-full { width: 100%; max-width: none; margin: 0; }
.px-google { gap: 12px; background: rgba(255,255,255,.04); }
.b.px-sm, .px-sm { min-height: 40px; padding: 0 16px; font-size: .85rem; border-radius: 12px; }
.px-link {
  background: none; border: 0; padding: 4px 0; cursor: pointer; font: inherit; font-size: .85rem;
  color: var(--mut); text-decoration: underline; text-underline-offset: 3px;
}
.px-link:hover { color: var(--fg); }
.b.px-danger:hover { border-color: #ff7a7a; color: #ff9a9a; box-shadow: none; }
.px-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.px-rowend { display: flex; justify-content: flex-end; margin-top: -4px; }
.px-or { display: flex; align-items: center; gap: 14px; color: var(--mut); font-size: .8rem; margin: 22px 0; }
.px-or::before, .px-or::after { content: ""; flex: 1; height: 1px; background: var(--bd); }

/* ---------- form fields ---------- */
.px-form { display: grid; gap: 16px; }
.px-field { display: grid; gap: 7px; }
.px-label { font-size: .78rem; font-weight: 600; color: var(--mut); letter-spacing: .02em; }
.px-input {
  width: 100%; min-height: 50px; padding: 13px 14px; border-radius: 12px; font: inherit;
  color: var(--fg); background: rgba(255,255,255,.03); border: 1px solid var(--bd);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.px-input::placeholder { color: #5f5f5f; }
.px-input:hover { border-color: rgba(255,255,255,.18); }
.px-input:focus, .px-input:focus-visible {
  outline: none; border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.05);
  box-shadow: 0 0 0 4px rgba(255,255,255,.08);
}
textarea.px-input { min-height: 96px; resize: vertical; line-height: 1.5; }
select.px-input {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239a9a9a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
select.px-input option { background: #141414; color: #f2f2f2; }
.px-pw { position: relative; }
.px-pw .px-input { padding-right: 52px; }
.px-eye {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px;
  display: grid; place-items: center; border: 0; background: transparent; color: var(--mut);
  border-radius: 10px; cursor: pointer;
}
.px-eye:hover { color: var(--fg); background: rgba(255,255,255,.06); }
.px-hint { font-size: .8rem; color: var(--mut); margin: -6px 0 0; }

/* ---------- status message ---------- */
.px-msg {
  margin: 16px 0 0; padding: 11px 14px; font-size: .88rem; line-height: 1.5; color: var(--fg);
  background: rgba(255,255,255,.04); border: 1px solid var(--bd); border-left: 3px solid #f2f2f2; border-radius: 10px;
}
.px-msg:empty { display: none; }
.px-msg[data-kind="err"] { background: rgba(255,90,90,.08); border-color: rgba(255,90,90,.25); border-left-color: #ff6b6b; }
.px-msg[data-kind="ok"] { background: rgba(110,220,160,.08); border-color: rgba(110,220,160,.25); border-left-color: #6edca0; }

/* ---------- state cards (verify, empty, error, coming soon) ---------- */
.px-state { text-align: center; }
.px-state .px-badge {
  width: 64px; height: 64px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(255,255,255,.05); border: 1px solid var(--bd); color: var(--fg);
}
.px-state .px-h { font-size: 1.4rem; }
.px-state .px-sub { max-width: 340px; margin-left: auto; margin-right: auto; }
.px-state .px-sub b { color: var(--fg); overflow-wrap: anywhere; }
.px-actions { display: grid; gap: 10px; }

/* ---------- loading skeleton ---------- */
.px-skel { display: grid; gap: 12px; }
.px-skel i {
  display: block; height: 16px; border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.1), rgba(255,255,255,.04));
  background-size: 200% 100%; animation: px-shimmer 1.4s linear infinite;
}
.px-skel i:nth-child(1) { width: 40%; height: 24px; }
.px-skel i:nth-child(2) { width: 85%; }
.px-skel i:nth-child(3) { width: 65%; }
@keyframes px-shimmer { to { background-position: -200% 0; } }

/* ---------- signed-in top bar ---------- */
.px-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.px-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  font: 700 1.15rem var(--hf); background: linear-gradient(135deg, #2c2c2c, #111); border: 1px solid var(--bd);
}
.px-who { min-width: 0; flex: 1; }
.px-who strong { display: block; font: 700 1.1rem var(--hf); letter-spacing: -.01em; overflow-wrap: anywhere; }
.px-who span { display: block; color: var(--mut); font-size: .85rem; overflow-wrap: anywhere; }

/* ---------- client project card ---------- */
.px-proj { display: grid; gap: 24px; margin-bottom: 18px; }
.px-pill {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .04em; padding: 4px 11px;
  border-radius: 99px; border: 1px solid var(--bd); color: var(--mut); background: rgba(255,255,255,.03);
}
.px-pill.is-stage { color: var(--fg); border-color: rgba(255,255,255,.28); }
.px-title { font-size: 1.6rem; margin: 10px 0 4px; overflow-wrap: anywhere; }
.px-date { font-size: .85rem; color: var(--mut); margin: 0; }
.px-prog-top { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; margin-bottom: 10px; color: var(--mut); }
.px-prog-top strong { color: var(--fg); }
.px-track { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.px-track.is-sm { height: 4px; }
.px-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6a6a6a, #f2f2f2); animation: px-grow 1s cubic-bezier(.2,.8,.2,1); }
@keyframes px-grow { from { width: 0; } }
.px-body { display: grid; gap: 24px; }
@media (min-width: 760px) { .px-body.has-both { grid-template-columns: 1fr 1fr; align-items: start; } }

.px-steps { list-style: none; margin: 0; padding: 0; }
.px-steps li { display: flex; align-items: center; gap: 14px; padding: 9px 0; color: var(--mut); font-size: .95rem; }
.px-dot {
  position: relative; width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center;
  border-radius: 50%; border: 2px solid rgba(255,255,255,.14); background: var(--card); color: #0b0b0b;
}
.px-steps li:not(:last-child) .px-dot::after {
  content: ""; position: absolute; left: 50%; top: calc(100% + 2px); transform: translateX(-50%);
  width: 2px; height: 18px; background: rgba(255,255,255,.1);
}
.px-steps li[data-s="done"] { color: rgba(242,242,242,.85); }
.px-steps li[data-s="done"] .px-dot { background: #f2f2f2; border-color: #f2f2f2; }
.px-steps li[data-s="done"]:not(:last-child) .px-dot::after { background: rgba(242,242,242,.55); }
.px-steps li[data-s="now"] { color: var(--fg); font-weight: 700; }
.px-steps li[data-s="now"] .px-dot { border-color: #f2f2f2; animation: px-pulse 2.2s ease-out infinite; }
.px-steps li[data-s="now"] .px-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #f2f2f2; }
.px-now { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; background: #f2f2f2; color: #0b0b0b; }
@keyframes px-pulse { 0% { box-shadow: 0 0 0 0 rgba(242,242,242,.35); } 100% { box-shadow: 0 0 0 10px rgba(242,242,242,0); } }

.px-note { padding: 18px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid var(--bd); }
.px-note .lb { margin-bottom: 8px; }
.px-note p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.6; }
.px-side-col { display: grid; gap: 14px; }

/* ---------- admin ---------- */
.px-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.px-stat { background: var(--card); border: 1px solid var(--bd); border-radius: 16px; padding: 16px 18px; }
.px-stat b { display: block; font: 700 1.9rem/1.1 var(--hf); letter-spacing: -.02em; }
.px-stat span { color: var(--mut); font-size: .8rem; }
.px-admin { display: grid; gap: 20px; }
@media (min-width: 980px) {
  .px-admin { grid-template-columns: 380px minmax(0, 1fr); align-items: start; }
  .px-aside { position: sticky; top: 88px; }
}
.px-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.px-tools h2 { font-size: 1.25rem; margin: 0; }
.px-search { position: relative; flex: 1 1 220px; max-width: 320px; }
.px-search .px-i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--mut); pointer-events: none; }
.px-search .px-input { padding-left: 42px; min-height: 44px; }
.px-list { display: grid; gap: 12px; }
.px-row {
  background: var(--card); border: 1px solid var(--bd); border-radius: 18px; padding: 18px 20px;
  display: grid; gap: 10px; transition: border-color .2s;
}
.px-row:hover { border-color: rgba(255,255,255,.2); }
.px-row.is-editing { border-color: #f2f2f2; box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
.px-row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.px-row-top h3 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.px-row-meta { font-size: .85rem; color: var(--mut); margin: 0; overflow-wrap: anywhere; }
.px-row-note { margin: 0; font-size: .9rem; color: rgba(242,242,242,.8); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.px-row-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.px-row-foot .px-date { font-size: .8rem; }
.px-row-btns { display: flex; gap: 8px; }
.px-empty { text-align: center; color: var(--mut); padding: 36px 16px; border: 1px dashed var(--bd); border-radius: 18px; margin: 0; }

@media (max-width: 520px) {
  .px-card { padding: 22px 18px; border-radius: 20px; }
  .px-title { font-size: 1.4rem; }
  .px-stat { padding: 14px; }
  .px-stat b { font-size: 1.5rem; }
  .px-row { padding: 16px; }
  .px-bar { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .px-fill, .px-skel i, .px-steps li[data-s="now"] .px-dot { animation: none; }
}

/* header: make the Client Login outline button actually show its outline */
header .b.o { border: 1px solid rgba(255,255,255,.35); }
header .b.o:hover { border-color: #f2f2f2; }

/* phones: Client Login becomes the first pill in the menu row (keeps the header two rows tall) */
@media (max-width: 600px) {
  header .b.o { display: none; }
  nav a[href="#portal"] {
    display: inline-flex; align-items: center; order: -1; margin-right: 6px;
    color: #f2f2f2; border: 1px solid rgba(255,255,255,.35);
  }
  nav a[href="#portal"].on { background: #f2f2f2; color: #0b0b0b; }
}
/* the floating Email Us bubble covers form fields on these two pages */
main:has(#portal-root) ~ .wa, main:has(#admin-root) ~ .wa { display: none; }
