/* 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); }
.p-wifi + .p-wifi { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }
.p-wifi-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.p-option .save { font-size: .74rem; font-weight: 600; color: var(--ok); margin-top: 2px; }

/* 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(5, 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; }

/* ---- App-style home (portal/dashboard.html) -------------------------------- */
.p-hello { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.p-hello h1 { color: #fff; font-size: 1.35rem; margin: 0; line-height: 1.15; }
.p-hello-small { color: rgba(255, 255, 255, .7); font-size: .8rem; }
.p-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: grid; place-items: center;
  background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 1.1rem; border: 2px solid rgba(215, 177, 7, .6); }
.p-avatar.lg { width: 84px; height: 84px; font-size: 1.8rem; }

.p-hero { border-radius: 20px; padding: 18px; color: #fff; box-shadow: var(--shadow);
  background: radial-gradient(130% 120% at 100% 0%, #3A3310 0%, #1A2233 45%, var(--navy) 100%);
  border: 1px solid rgba(215, 177, 7, .35); }
.p-hero.bad { border-color: rgba(220, 38, 38, .6); }
.p-hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.p-hero-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); font-weight: 700; }
.p-hero.bad .p-hero-label { color: #fca5a5; }
.p-hero-speed { font-size: 1.9rem; font-weight: 800; line-height: 1.1; margin-top: 4px; }
.p-hero-plan { color: rgba(255, 255, 255, .75); font-size: .88rem; margin-top: 2px; }
.p-hero .ring { width: 96px; height: 96px; }
.p-hero .ring .track { stroke: rgba(255, 255, 255, .12); }
.p-hero .ring .fill { stroke: var(--brand); }
.p-hero.warn .ring .fill { stroke: #f59e0b; } .p-hero.bad .ring .fill { stroke: #ef4444; }
.p-hero .ring .ring-num { font-size: 1.6rem; color: #fff; }
.p-hero .ring .ring-unit { color: rgba(255, 255, 255, .7); }
.p-hero-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; color: rgba(255, 255, 255, .85); }
.p-hero-note { margin: 10px 0 0; font-size: .85rem; color: rgba(255, 255, 255, .85); }
.p-hero-btn { font-size: 1rem; padding: 10px; }
.p-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: rgba(127, 127, 127, .18); color: inherit; }
.p-chip.ok { background: rgba(22, 163, 74, .18); color: #22c55e; }
.p-card .p-chip { color: var(--text-muted); } .p-card .p-chip.ok { color: var(--ok); }

.p-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.p-actions a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); color: var(--text);
  font-size: .8rem; font-weight: 600; text-align: center; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.p-actions a:active { transform: scale(.97); }
.p-actions .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink); font-size: 1.25rem; }
@media (min-width: 768px) { .p-actions { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.p-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.p-tile { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--border); min-width: 0; }
.p-tile > i { font-size: 1.2rem; color: var(--brand-ink); margin-top: 2px; }
.p-tile .k { font-size: .72rem; color: var(--text-muted); }
.p-tile .v { font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
@media (min-width: 768px) { .p-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.p-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; height: 110px; }
.p-week-day { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.p-week-bar { flex: 1; width: 100%; max-width: 26px; display: flex; align-items: flex-end; background: var(--muted-soft); border-radius: 8px; overflow: hidden; }
.p-week-bar span { display: block; width: 100%; background: linear-gradient(180deg, var(--accent), var(--brand)); border-radius: 8px; }
.p-week-label { font-size: .68rem; color: var(--text-muted); }

/* Top bar: brand on the left, "Namaste, name" + photo on the right. */
.p-me { display: flex; align-items: center; gap: 10px; margin-left: auto; color: #fff; text-decoration: none; min-width: 0; }
.p-bar .btn-logout.ms-auto:not([hidden]) + .p-me { margin-left: 10px; }
.p-me-text { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; min-width: 0; }
.p-me-small { font-size: .72rem; color: rgba(255, 255, 255, .7); }
.p-me-name { font-weight: 700; font-size: .95rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-me .p-avatar { width: 40px; height: 40px; font-size: 1rem; }
.p-top { padding-bottom: 56px; }
.p-devices li { align-items: center; gap: 10px; }
.p-devices li > span:first-child { min-width: 0; flex: 1; }
.p-devices .bi-phone, .p-devices .bi-phone-vibrate { font-size: 1.2rem; color: var(--brand-ink); }
.p-login { align-content: center; }
/* The app is a column: header, content (grows), credit at the very bottom. */
.portal { display: flex; flex-direction: column; }
.portal > .p-main { flex: 1 0 auto; width: 100%; }
.portal > .app-credit { margin: 18px 0 0; padding: 0 16px 12px; }
