/* Swift customer portal. Builds on app.css's tokens (colours, radius,
   panels, pills) but has its own layout: no staff sidebar, phone first. */

.portal { min-height: 100vh; background: var(--bg); padding-bottom: 84px; }

.p-top {
  background: radial-gradient(120% 140% at 85% 0%, #2A2611 0%, var(--navy) 55%, #0C121D 100%);
  color: #fff;
  border-bottom: 2px solid var(--brand);
  padding: 14px 0 64px;
}
.p-top a { color: #fff; }
.p-bar { display: flex; align-items: center; gap: 12px; }
.p-bar .brand-mark { width: 40px; height: 40px; }
.p-bar .who { margin-left: auto; text-align: right; font-size: .82rem; line-height: 1.2; opacity: .9; }
.p-bar .btn-logout { color: #fff; border: 1px solid rgba(255, 255, 255, .3); background: transparent;
  border-radius: 8px; padding: 5px 10px; font-size: .8rem; }
.p-bar .btn-logout:hover { background: rgba(255, 255, 255, .12); }

.p-nav { display: none; gap: 4px; margin-top: 18px; }
.p-nav a { color: rgba(255, 255, 255, .78); padding: 7px 14px; border-radius: 999px; font-weight: 500; font-size: .9rem; }
.p-nav a:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.p-nav a.active { color: var(--on-brand); background: var(--brand); }

.p-wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.p-main { margin-top: -44px; }

.p-greeting h1 { color: #fff; font-size: 1.35rem; margin: 18px 0 2px; }
.p-greeting p { color: rgba(255, 255, 255, .8); margin: 0; }

.p-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.p-card + .p-card, .p-stack > * + * { margin-top: 14px; }
.p-card h2 { font-size: 1rem; margin: 0 0 12px; }
.p-card .p-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.p-card .p-card-head h2 { margin: 0; }

/* Days-remaining ring */
.p-status { display: flex; gap: 18px; align-items: center; }
.ring { position: relative; width: 112px; height: 112px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: var(--muted-soft); }
.ring .fill { stroke: var(--ok); transition: stroke-dashoffset .6s ease; }
.ring.warn .fill { stroke: var(--warn); }
.ring.bad .fill { stroke: var(--danger); }
.ring .ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .ring-num { font-size: 1.9rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ring .ring-unit { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { .ring .fill { transition: none; } }

.p-big { font-size: 1.25rem; font-weight: 700; }
.p-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.p-kv .k { font-size: .75rem; color: var(--text-muted); font-weight: 500; }
.p-kv .v { font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }

.p-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-radius: 14px; padding: 14px 16px;
  background: var(--warn-soft); color: var(--text); border: 1px solid transparent;
}
.p-cta.bad { background: var(--danger-soft); }
.p-cta .btn { white-space: nowrap; }

.p-list { list-style: none; margin: 0; padding: 0; }
.p-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.p-list li:first-child { border-top: 0; padding-top: 0; }
.p-list .sub { font-size: .8rem; color: var(--text-muted); }

/* Renewal choices */
.p-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.p-option { position: relative; }
.p-option input { position: absolute; opacity: 0; pointer-events: none; }
.p-option label {
  display: block; cursor: pointer; height: 100%;
  border: 1.5px solid var(--border-strong); border-radius: 12px; padding: 14px;
  background: var(--surface);
}
.p-option label:hover { border-color: var(--brand); }
.p-option input:checked + label { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.p-option input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }
.p-option .len { font-weight: 600; }
.p-option .price { font-size: 1.2rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.p-option .per { font-size: .78rem; color: var(--text-muted); }

/* QR card - always light: a QR needs a white quiet zone to scan. */
.p-qr { text-align: center; color: #111827; }
.p-qr .qr-frame { border-color: #E5E7EB; }
.p-qr-amount { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Bottom tabs on phones */
.p-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.p-tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .7rem; font-weight: 500; color: var(--text-muted); padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
}
.p-tabs a i { font-size: 1.25rem; }
.p-tabs a.active { color: var(--brand-ink); }

@media (min-width: 768px) {
  .portal { padding-bottom: 32px; }
  .p-nav { display: flex; }
  .p-tabs { display: none; }
  .p-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Login */
.p-login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(120% 120% at 80% 0%, #2A2611 0%, var(--navy) 50%, #0C121D 100%); }
.p-login .p-card { width: 100%; max-width: 400px; padding: 26px; }
