/* ============================================================
   G.O.A.T — portal.css
   One-pager funnel screens: landing, login, register, /welcome/*, /account.
   Full-viewport, centred card, no scroll within a screen, bold tap targets.
   ============================================================ */

.portal-body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 70% 0%, rgba(242, 215, 27, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse at 0% 100%, rgba(46, 168, 74, 0.12) 0%, transparent 40%),
    var(--brand-white);
}

.portal-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  position: relative;
}

.portal-card {
  background: var(--brand-white);
  border: 3px solid var(--brand-black);
  border-radius: 16px;
  box-shadow: 0 8px 0 var(--brand-black);
  padding: clamp(2rem, 5vw, 3rem);
  width: 100%;
  max-width: 520px;
  position: relative;
  text-align: center;
}
.portal-card-wide { max-width: 580px; }

.portal-back {
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
}
.portal-back:hover { color: var(--brand-black); background: var(--brand-grey-100); }

.portal-logo {
  width: clamp(140px, 30vw, 200px);
  height: auto;
  margin: 0 auto clamp(1.25rem, 3vw, 2rem);
  display: block;
}

/* Landing-page tweaks — logo big, tagline directly under, buttons below */
.landing-card .portal-logo {
  width: clamp(160px, 38vw, 220px);
  margin-bottom: 0.5rem;
}
.landing-tagline {
  font-family: var(--cb-font-heading_family);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-black);
  margin: 0 0 2rem;
  font-weight: 800;
}
.portal-logo-sm {
  width: clamp(64px, 12vw, 84px);
  margin-bottom: 1.25rem;
}

.portal-title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.75rem;
  line-height: 1.05;
}
.portal-title em {
  font-style: normal;
  background: var(--brand-yellow);
  padding: 0 0.2em;
  color: var(--brand-black);
}
.portal-sub {
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.1rem);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.portal-choices {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.btn-jumbo {
  padding: 1.25rem 1.5rem !important;
  font-size: 1.1rem !important;
  width: 100%;
  border-radius: 10px !important;
  position: relative;
  text-align: left !important;
  justify-content: flex-start !important;
}
.btn-jumbo .btn-chev {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  background: var(--brand-black);
  color: var(--brand-yellow);
  border-radius: 6px;
  font-weight: 900;
  margin-right: 0.85rem;
}
.btn-ghost.btn-jumbo .btn-chev { background: var(--brand-black); color: var(--brand-yellow); }
.btn-ghost.btn-jumbo:hover .btn-chev { background: var(--brand-yellow); color: var(--brand-black); }

.portal-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.portal-form .field-xl label {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--brand-black);
  display: block;
}
.portal-form .field-xl label small.muted {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.portal-form .field-xl input {
  padding: 1rem 1rem;
  font-size: 1.05rem;
  border: 2px solid var(--brand-black);
  border-radius: 8px;
  background: var(--brand-white);
  width: 100%;
  transition: box-shadow 150ms ease;
}
.portal-form .field-xl input:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(242, 215, 27, 0.5);
}

.portal-form .form-result {
  display: none;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
}
.portal-form .form-result.show { display: block; }
.portal-form .form-result.success { background: var(--brand-green-soft); color: var(--brand-green-deep); border: 2px solid var(--brand-green); }
.portal-form .form-result.error   { background: #FBE8E1; color: #7A2E12; border: 2px solid #D88770; }

.portal-tiny {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}
.portal-tiny a {
  color: var(--brand-black);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.portal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem 0;
  width: 100%;
  max-width: 520px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.portal-footer a {
  color: var(--text-muted);
  text-decoration: none;
}
.portal-footer a:hover { color: var(--brand-black); }
@media (max-width: 480px) {
  .portal-footer { flex-direction: column; gap: 0.4rem; text-align: center; }
}

/* Mobile tweaks */
@media (max-width: 480px) {
  .portal-card { padding: 1.75rem 1.25rem; }
  .portal-back { font-size: 0.8rem; }
  .btn-jumbo .btn-chev { width: 28px; height: 28px; }
}

/* =================== FUNNEL =================== */

.portal-shell-wide { max-width: 920px; }
.portal-card-funnel { max-width: 760px; padding: clamp(1.5rem, 4vw, 2.5rem); }
.portal-card-tier { max-width: 920px; }

/* Progress bar at the top of every funnel screen */
.portal-progress {
  width: 100%;
  max-width: 760px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-inline: 0.5rem;
}
.portal-progress .portal-back { position: static; padding: 0.35rem 0.6rem; }
.progress-dots { display: inline-flex; gap: 0.5rem; align-items: center; justify-self: center; }
.progress-dot {
  width: 22px; height: 6px; border-radius: 4px;
  background: var(--brand-grey-200);
  border: 1px solid var(--brand-grey-300);
}
.progress-dot.active { background: var(--brand-yellow); border-color: var(--brand-black); }
.progress-dot.done   { background: var(--brand-green); border-color: var(--brand-green-deep); }
.progress-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 700; letter-spacing: 0.05em; text-align: right; }

/* Big card grids (size + tier selection) */
.big-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.5rem 0 1rem;
}
@media (min-width: 720px) {
  .big-card-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}
.tier-grid-funnel { grid-template-columns: 1fr; }
@media (min-width: 880px) { .tier-grid-funnel { grid-template-columns: repeat(3, 1fr); } }

.big-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.5rem 1.25rem;
  background: var(--brand-white);
  border: 2px solid var(--brand-black);
  border-radius: 12px;
  box-shadow: 0 4px 0 var(--brand-black);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
  position: relative;
}
.big-card:hover { background: var(--brand-yellow); transform: translateY(-2px); box-shadow: 0 6px 0 var(--brand-black); }
.big-card.is-selected { background: var(--brand-yellow); }
.big-card.is-featured { border-width: 3px; }
.big-card.is-featured::before {
  content: "Most popular";
  position: absolute;
  top: -14px; left: 50%;
  transform: translateX(-50%);
  background: var(--brand-black);
  color: var(--brand-yellow);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-weight: 800;
}

.big-card-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-green-deep);
  font-weight: 800;
}
.big-card-title {
  font-family: var(--cb-font-heading_family);
  font-size: 1.4rem;
  line-height: 1.1;
  color: var(--brand-black);
}
.big-card-tier .big-card-title { font-size: 1.6rem; margin-top: 0.5rem; }
.big-card-meta { color: var(--text-muted); font-size: 0.9rem; line-height: 1.4; }
.big-card-price {
  font-family: var(--cb-font-heading_family);
  font-size: 2rem;
  font-weight: 900;
  color: var(--brand-black);
  line-height: 1;
}
.big-card-price small { font-size: 0.75rem; color: var(--text-muted); font-family: var(--cb-font-body_family); font-weight: 500; letter-spacing: 0.02em; }
.big-card-go {
  margin-top: auto;
  padding-top: 0.5rem;
  font-weight: 800;
  color: var(--brand-black);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.tier-features-compact { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.25rem 0 0; padding: 0; list-style: none; }
.tier-features-compact li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--text-default);
  line-height: 1.4;
}
.tier-features-compact li::before {
  content: "✓";
  position: absolute;
  left: 0; top: 0;
  color: var(--brand-green-deep);
  font-weight: 900;
}

/* Tier medals (used in funnel + account) */
.tier-medal {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.1rem; font-weight: 900;
  font-family: var(--cb-font-heading_family);
  color: var(--brand-neutral);
  flex: 0 0 auto;
}
.tier-bronze { background: linear-gradient(135deg, #B27A47, #7A4F2A); }
.tier-silver { background: linear-gradient(135deg, #C2C7CC, #8A8E92); color: #2E2E2E; }
.tier-gold   { background: linear-gradient(135deg, #E0AE3E, #A77519); }

/* Photo drop (funnel step 3) */
.photo-drop {
  display: block;
  border: 2px dashed var(--brand-black);
  border-radius: 10px;
  padding: 1.75rem 1rem;
  text-align: center;
  background: var(--brand-paper);
  cursor: pointer;
}
.photo-drop input[type=file] { display: none; }
.photo-drop .photo-label { display: block; font-weight: 800; margin-bottom: 0.35rem; }
.photo-drop .photo-hint { font-size: 0.85rem; color: var(--text-muted); }
.photo-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.photo-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--brand-black);
}

.funnel-actions { display: flex; flex-direction: column; gap: 0.5rem; align-items: center; }
.portal-tiny-link { color: var(--brand-black); text-decoration: underline; font-weight: 700; }

/* Confirm screen */
.portal-card-confirm { max-width: 640px; }
.confirm-card {
  border: 2px solid var(--brand-black);
  border-radius: 12px;
  background: var(--brand-paper);
  padding: 1.25rem;
  margin: 1rem 0 1.5rem;
  text-align: left;
}
.confirm-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--surface-rule);
  flex-wrap: wrap;
}
.confirm-row:last-child { border-bottom: 0; }
.confirm-label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 800;
  flex: 0 0 auto;
}
.confirm-value { font-size: 1rem; color: var(--brand-black); text-align: right; flex: 1 1 auto; }
.confirm-price {
  font-family: var(--cb-font-heading_family);
  font-size: 1.5rem;
  font-weight: 900;
}
.confirm-includes { flex-direction: column; }
.confirm-includes .confirm-label { margin-bottom: 0.5rem; }
.confirm-includes .confirm-value { text-align: left; }
.confirm-warning {
  background: rgba(242, 215, 27, 0.18);
  border: 2px solid var(--brand-yellow);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  color: var(--brand-black);
  text-align: left;
}

/* =================== ACCOUNT DASHBOARD =================== */

.portal-body.account-body {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(242, 215, 27, 0.18) 0%, transparent 40%),
    var(--brand-white);
}
.portal-body.account-body .portal-shell { justify-content: flex-start; padding-top: 1rem; }

.account-topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.25rem 1.25rem;
}
.account-brand { display: inline-flex; align-items: center; }
.account-brand-logo { width: 56px; height: 56px; }
.btn-sm { padding: 0.55rem 1rem; font-size: 0.9rem; border-radius: 6px; }
.account-logout { margin: 0; }

.account-welcome {
  background: var(--brand-green-soft);
  border: 2px solid var(--brand-green);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1rem;
  width: 100%;
  font-size: 0.95rem;
  color: var(--brand-green-deep);
}

.account-card {
  width: 100%;
  background: var(--brand-white);
  border: 2px solid var(--brand-black);
  border-radius: 12px;
  box-shadow: 0 4px 0 var(--brand-black);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  margin-bottom: 1rem;
}
.account-card .eyebrow { display: block; margin-bottom: 0.5rem; }

.account-hero {
  background: var(--brand-black);
  color: var(--brand-white);
  border-color: var(--brand-yellow);
  box-shadow: 0 4px 0 var(--brand-grey-900);
}
.account-hero .eyebrow { color: var(--brand-yellow); }
.account-next-date {
  font-family: var(--cb-font-heading_family);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--brand-yellow);
  line-height: 1.1;
  margin: 0.25rem 0;
}
.account-next-route { color: var(--text-on-deep-muted); font-size: 0.95rem; margin: 0; }

.account-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
}
@media (min-width: 720px) { .account-grid { grid-template-columns: 1.2fr 1fr; } }

.account-plan-line {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0 0.75rem;
  flex-wrap: wrap;
}
.account-plan-tier { font-size: 1.5rem; line-height: 1.1; margin: 0; }
.account-plan-size { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.account-plan-price {
  margin-left: auto;
  font-family: var(--cb-font-heading_family);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--brand-black);
}
.account-plan-price small { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; letter-spacing: 0.02em; }
.account-plan-summary { font-size: 0.92rem; margin: 0.5rem 0 0; }

.status-badge {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  margin-top: 0.4rem;
}
.status-active { background: var(--brand-green-soft); color: var(--brand-green-deep); border: 1px solid var(--brand-green); }
.status-pending { background: var(--brand-yellow); color: var(--brand-black); border: 1px solid var(--brand-black); }
.status-warn { background: #FBE8E1; color: #7A2E12; border: 1px solid #D88770; }
.status-cancelled { background: var(--brand-grey-200); color: var(--brand-grey-700); border: 1px solid var(--brand-grey-300); }

.account-actions { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.5rem; }
.account-actions .btn-quiet { font-size: 0.85rem; color: var(--text-muted); }

.account-history .history-list { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.history-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--surface-rule);
  font-size: 0.95rem;
}
.history-row:last-child { border-bottom: 0; }
.history-status { font-weight: 700; }
.history-completed { color: var(--brand-green-deep); }
.history-rescheduled { color: var(--brand-accent-700); }
.history-cancelled { color: var(--brand-grey-700); }
.history-empty { color: var(--text-muted); font-style: italic; justify-content: center; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}


/* =================== RADIO CARDS (residential/commercial) =================== */

.field-group { margin-bottom: 0.5rem; }
.radio-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.radio-card {
  position: relative;
  cursor: pointer;
  user-select: none;
}
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card-inner {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border: 2px solid var(--brand-black);
  border-radius: 10px;
  background: var(--brand-white);
  transition: background 150ms ease;
}
.radio-card:hover .radio-card-inner { background: var(--brand-grey-100); }
.radio-card input:checked + .radio-card-inner {
  background: var(--brand-yellow);
  box-shadow: 0 3px 0 var(--brand-black);
}
.radio-card-title { font-weight: 800; color: var(--brand-black); font-size: 1.05rem; }
.radio-card-meta  { font-size: 0.85rem; color: var(--text-muted); }
.radio-card input:checked + .radio-card-inner .radio-card-meta { color: var(--brand-black); }

/* =================== SECTOR HERO TINTS =================== */
/* Used on /account hero card to show the customer's sector colour */
.sector-tinted { border-color: var(--sector-colour, var(--brand-yellow)) !important; }
.sector-tinted .eyebrow { color: var(--sector-colour, var(--brand-yellow)) !important; }
.sector-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--sector-colour, var(--brand-yellow));
  color: var(--brand-black);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}
.sector-chip::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brand-black);
}

/* =================== INVOICE PATH (confirm step) =================== */
.confirm-cta-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
@media (min-width: 640px) {
  .confirm-cta-pair { grid-template-columns: 1.2fr 1fr; }
}
.confirm-cta-pair .btn { margin: 0; }

/* =================== LEGAL / ABOUT PAGE HEADER =================== */
.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 2rem);
  border-bottom: 2px solid var(--brand-black);
  background: var(--brand-white);
  gap: 1rem;
  flex-wrap: wrap;
}
.page-topbar-brand img { height: 44px; width: auto; display: block; }
.page-topbar-back {
  font-weight: 700;
  color: var(--brand-black);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border: 2px solid var(--brand-black);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--brand-yellow);
}
.page-topbar-back:hover { background: var(--brand-yellow-warm); }
