/* Customer portal theme - Monarch navy + gold, trust-first and calm.
   Self-contained (loads over Bootstrap CDN); does not pull in the heavier
   staff stylesheet. Light mode only: customers check bookings and money owed,
   so the surface stays bright, legible, and quiet. */
:root {
  /* Brand tokens sampled from the Monarch Buildestate logo
     (monarchbuildestate.com): royal blue #243e79 + vivid yellow #ffe900. */
  --p-navy-950: #16264c;
  --p-navy-900: #243e79;
  --p-navy-800: #2f4d92;
  --p-gold: #ffe900;
  --p-gold-soft: #fff3a0;
  --p-ink: #1b2540;
  --p-muted: #6b7488;
  --p-line: rgba(36, 62, 121, 0.11);
  --p-rail: rgba(36, 62, 121, 0.06);
  --p-radius: 16px;
}

body.portal {
  min-height: 100dvh;
  background:
    radial-gradient(circle at top left, rgba(215, 179, 58, 0.14), transparent 30%),
    linear-gradient(180deg, #f8f6ef 0%, #eef2f7 100%);
  color: var(--p-ink);
  font-family: "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---- top bar ---------------------------------------------------------- */
.portal-nav {
  background: linear-gradient(90deg, var(--p-navy-950), var(--p-navy-800));
  box-shadow: 0 10px 28px rgba(7, 22, 47, 0.22);
  border-bottom: 2px solid var(--p-gold);
}
.portal-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.portal-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #fff;
  padding: 3px;
  box-shadow: 0 2px 8px rgba(7, 22, 47, 0.28);
  flex: 0 0 auto;
}
.portal-brand .name { color: #fff; line-height: 1.05; }
.portal-brand .sub {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--p-gold);
}
.portal-nav .btn-logout {
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.28);
}
.portal-nav .btn-logout:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

/* ---- cards ------------------------------------------------------------ */
.portal-card {
  background: #fff;
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  box-shadow: 0 14px 34px rgba(13, 34, 72, 0.07);
}
.portal-card-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 1rem 1.25rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--p-muted);
}
.portal-card-head i { color: var(--p-navy-800); font-size: 0.9rem; }

/* ---- welcome + summary ------------------------------------------------ */
.portal-welcome { font-weight: 700; letter-spacing: -0.02em; }
.portal-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}
@media (max-width: 575px) { .portal-summary { grid-template-columns: 1fr; } }
.summary-tile {
  background: #fff;
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  padding: 0.9rem 1.05rem;
  box-shadow: 0 10px 26px rgba(13, 34, 72, 0.06);
}
.summary-tile .label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--p-muted);
}
.summary-tile .value {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.15;
  margin-top: 0.15rem;
  color: var(--p-navy-900);
}
.summary-tile .value.owed { color: #b23b2e; }
.summary-tile .value.clear { color: #0f7b4f; }
.summary-tile .meta { font-size: 0.78rem; color: var(--p-muted); margin-top: 0.1rem; }

/* ---- visit rows ------------------------------------------------------- */
.visit-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--p-line);
}
.visit-date {
  flex: 0 0 3.2rem;
  text-align: center;
  line-height: 1.1;
}
.visit-date .d { font-size: 1.2rem; font-weight: 700; color: var(--p-navy-900); }
.visit-date .m {
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--p-muted);
}
.visit-main { flex: 1 1 auto; min-width: 0; }
.visit-main .title { font-weight: 600; color: var(--p-ink); }
.visit-main .when { font-size: 0.8rem; color: var(--p-muted); }

/* ---- payment schedule ------------------------------------------------- */
.sale-block { padding: 1rem 1.25rem 1.25rem; border-top: 1px solid var(--p-line); }
.sale-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.sale-unit { font-weight: 700; color: var(--p-navy-900); }
.sale-out { font-size: 0.82rem; color: var(--p-muted); }
.sale-out b { color: #b23b2e; font-weight: 700; }

.pay-progress {
  height: 6px;
  border-radius: 999px; /* unslop-ignore: rounded progress bar */
  background: var(--p-rail);
  overflow: hidden;
  margin: 0.7rem 0 0.9rem;
}
.pay-progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, #f5c400, var(--p-navy-800));
  border-radius: 999px; /* unslop-ignore: progress fill */
}

.milestone {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--p-rail);
}
.milestone:last-child { border-bottom: 0; }
.milestone .m-label { flex: 1 1 auto; min-width: 0; color: var(--p-ink); }
.milestone .m-amount { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--p-navy-900); }

.pill {
  flex: 0 0 auto;
  min-width: 5.4rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px; /* unslop-ignore: deliberate status pill */
  white-space: nowrap;
}
.pill.paid { background: #e2f3ea; color: #0f7b4f; }
.pill.overdue { background: #fbe4e1; color: #b23b2e; }
.pill.soon { background: #fbf0d8; color: #9a6b12; }
.pill.upcoming { background: var(--p-rail); color: var(--p-navy-800); }

/* ---- auth panels (login / verify) ------------------------------------ */
.auth-card {
  background: #fff;
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  box-shadow: 0 18px 44px rgba(13, 34, 72, 0.1);
  border-top: 3px solid var(--p-gold);
}
.auth-card .form-control:focus {
  border-color: var(--p-navy-800);
  box-shadow: 0 0 0 0.2rem rgba(23, 56, 111, 0.14);
}
.btn-portal {
  background: var(--p-navy-900);
  border: 1px solid var(--p-navy-900);
  color: #fff;
  font-weight: 600;
}
.btn-portal:hover { background: var(--p-navy-800); border-color: var(--p-navy-800); color: #fff; }
.btn-portal:active { transform: translateY(1px); }

.empty-note { color: var(--p-muted); padding: 1rem 1.25rem 1.25rem; }

/* auth intro (login / verify) */
.auth-intro { text-align: center; margin-bottom: 1.25rem; }
.auth-intro img { width: 64px; height: 64px; border-radius: 14px; box-shadow: 0 8px 22px rgba(7, 22, 47, 0.2); }
.auth-intro .tag {
  margin-top: 0.6rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--p-navy-800);
}

.portal-foot {
  color: var(--p-muted);
  font-size: 0.78rem;
  text-align: center;
  padding: 2rem 0 2.5rem;
}
