/* Customer portal — mobile-first, token-driven. Company colors come from --brand-* only. */

:root {
  --brand-primary: #128a56;
  --brand-secondary: #0b3d2e;
  --brand-background: #f3f7f4;
  --brand-surface: #ffffff;
  --brand-text: #122018;
  --brand-muted: #5a6b62;
  --brand-border: #d5e0d9;
  --brand-header: #071210;
  --brand-on-primary: #f4fff8;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(12, 28, 20, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
}

body.portal-app {
  min-height: 100vh;
  font-family: "DM Sans", Inter, system-ui, sans-serif;
  background: var(--brand-background);
  color: var(--brand-text);
  line-height: 1.55;
}

.portal-bg { display: none; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 -16px 8px;
  padding: 16px 18px;
  background: var(--brand-header);
  color: #f5faff;
}

.portal-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.portal-logo-img {
  height: 44px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.portal-logo-img-mark {
  height: 44px;
  width: 44px;
  object-fit: contain;
}

.portal-logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.portal-logo-sub {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand-primary);
}

.portal-logo-text-brand {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.6rem;
  letter-spacing: .04em;
  color: #fff;
  line-height: 1.1;
}

.portal-tagline {
  margin: 0;
  font-size: .82rem;
  color: rgba(245, 250, 255, .7);
  max-width: 220px;
  text-align: right;
}

.portal-topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin: 14px 0 18px;
  padding: 10px 12px;
  font-size: .88rem;
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.portal-topnav .nav-brand {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.05rem;
  letter-spacing: .04em;
  color: var(--brand-primary);
  margin-right: 4px;
}

.portal-topnav a {
  color: var(--brand-text);
  font-weight: 600;
  text-decoration: none;
  padding: 10px 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
}

.portal-topnav a:hover { color: var(--brand-primary); }
.portal-topnav a.active {
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 12%, white);
}
.portal-topnav .nav-div { color: var(--brand-border); user-select: none; }

.company-switcher { margin: 0; }
.switcher-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  padding: 4px;
}
.switcher-seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #f5faff;
  font: inherit;
  font-weight: 700;
  font-size: .82rem;
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
}
.switcher-seg button.is-active {
  background: var(--brand-primary);
  color: var(--brand-on-primary);
}
.switcher-seg button:focus-visible,
.portal-topnav a:focus-visible,
.btn-primary:focus-visible,
.button-link:focus-visible,
.photo-more:focus-visible,
.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
  outline: 3px solid var(--brand-primary);
  outline-offset: 2px;
}

.flash,
.flash.error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #eef6ef;
  border: 1px solid #b7d4bc;
  color: #1f4a2a;
  font-size: .95rem;
}
.flash.error {
  background: #fdeeee;
  border-color: #e2b0b0;
  color: #7a1f1f;
}
.preview-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff6e8;
  border: 1px solid #f0c37a;
  color: #6b4a12;
  font-size: .9rem;
}
.preview-banner a { color: #6b4a12; font-weight: 700; }

.portal-main { min-height: 40vh; }

.portal-footer {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--brand-border);
  font-size: .82rem;
  color: var(--brand-muted);
  text-align: center;
}

.portal-logged-in .hero { margin-bottom: 18px; }
.portal-logged-in h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  letter-spacing: .03em;
  font-weight: 400;
  margin: 0 0 6px;
  line-height: 1.1;
}
.portal-logged-in h2 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0 0 10px;
}
.portal-logged-in h3 { font-size: .95rem; margin: 14px 0 8px; }
.portal-logged-in .lead { font-size: 1.05rem; }
.portal-logged-in .muted { color: var(--brand-muted) !important; }
.portal-logged-in a { color: var(--brand-primary); }
.portal-logged-in a:hover { text-decoration: underline; }

.portal-logged-in .callout {
  background: color-mix(in srgb, var(--brand-primary) 10%, white);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 28%, var(--brand-border));
  color: var(--brand-secondary);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: .92rem;
}

.portal-logged-in .card,
.section-card {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.portal-logged-in .card.snow { border-left: 4px solid #0284c7; }
.portal-logged-in .card.lawn { border-left: 4px solid var(--brand-primary); }
.portal-logged-in .meta { color: var(--brand-muted); font-size: .88rem; }

.portal-logged-in table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.portal-logged-in th, .portal-logged-in td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--brand-border);
  vertical-align: top;
}
.portal-logged-in th {
  background: color-mix(in srgb, var(--brand-background) 70%, white);
  font-weight: 600;
}

.visit-skip-summary { color: #8a5a12; font-size: .9rem; margin-bottom: 4px; }
.visit-details { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--brand-border); }
.visit-details summary {
  cursor: pointer;
  color: var(--brand-primary);
  font-weight: 700;
  font-size: .84rem;
}
.visit-detail-body { margin-top: 8px; display: grid; gap: 8px; }

.div-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.div-pill {
  display: inline-block;
  padding: 8px 14px;
  background: var(--brand-background);
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  font-size: .88rem;
  color: var(--brand-text) !important;
  text-decoration: none !important;
}
.div-pill:hover { border-color: var(--brand-primary); }

.addr-preview { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--brand-border); }
.addr-block h3 { font-size: 1rem; margin: 0 0 6px; }
.msg-card h3 { margin-top: 0; }
.small { font-size: .85rem; }
.err { color: #b42318 !important; margin-bottom: 12px; }
.button-link {
  display: inline-block;
  background: var(--brand-primary);
  color: var(--brand-on-primary) !important;
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none !important;
}
.button-link:hover { filter: brightness(1.05); text-decoration: none !important; }

.quote-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; font-size: .9rem; margin: 0 0 18px; }
.quote-dl dt { color: var(--brand-muted); margin: 0; }
.quote-dl dd { margin: 0; }

.summary-grid,
.photo-pair,
.history-list {
  display: grid;
  gap: 12px;
}

.summary-grid {
  grid-template-columns: 1fr;
}

.kpi {
  background: var(--brand-background);
  border-radius: 12px;
  padding: 12px 14px;
}
.kpi-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand-muted);
  margin-bottom: 4px;
}

.photo-pair { grid-template-columns: 1fr; }
.photo-col h3 { margin: 0 0 8px; font-size: .9rem; }
.photo-thumb {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: #dfe8e3;
  border: 1px solid var(--brand-border);
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.photo-empty {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px dashed var(--brand-border);
  color: var(--brand-muted);
  font-size: .85rem;
  background: var(--brand-background);
}
.photo-more {
  display: inline-flex;
  align-items: center;
  margin: 8px 0 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.history-card {
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  padding: 14px;
  background: var(--brand-surface);
}
.history-card .when {
  font-weight: 700;
  margin: 0 0 4px;
}
.history-mini-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.history-mini-photos .photo-thumb { aspect-ratio: 1; }

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}

body.lightbox-open { overflow: hidden; }
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(6, 12, 10, .88);
  padding: 16px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
}
.lightbox.is-open { display: flex; }
.lightbox-figure {
  margin: 0;
  max-width: min(92vw, 1200px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.lightbox img {
  max-width: min(92vw, 1200px);
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}
.lightbox-counter {
  margin: 8px 0 0;
  color: #fff;
  font-size: .9rem;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  line-height: 1;
}
.lightbox-close {
  top: 12px;
  right: 12px;
  font-size: 1.6rem;
  z-index: 2;
}
.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
}
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }

/* Guest landing — keep split panel identity */
.landing-split {
  display: grid;
  grid-template-columns: 1fr;
  min-height: calc(100vh - 160px);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
}
.landing-logo-img {
  height: clamp(52px, 12vw, 72px);
  width: auto;
  display: block;
  margin-bottom: 8px;
}
.panel-signin-row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.panel-icon-img { height: 42px; width: auto; display: block; flex-shrink: 0; }
.landing-brand {
  padding: 32px 24px;
  color: #f5faff;
  background:
    radial-gradient(120% 80% at 10% 20%, color-mix(in srgb, var(--brand-primary) 28%, transparent), transparent 50%),
    linear-gradient(180deg, var(--brand-header) 0%, #050806 100%);
}
.landing-brand .eyebrow {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--brand-primary);
  margin: 0 0 10px;
}
.landing-headline {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.2rem, 8vw, 3rem);
  line-height: .95;
  letter-spacing: .03em;
  margin: 0 0 12px;
}
.landing-lead { font-size: .92rem; color: #7ba7c4; margin: 0 0 22px; max-width: 36rem; }
.landing-text-brand {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.6rem;
  letter-spacing: .04em;
  color: var(--brand-primary);
  margin: 0 0 8px;
}
.landing-logo-img-snow {
  width: 64px;
  height: 64px;
  display: block;
  margin: 0 0 12px;
}
.company-cards { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.company-card {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 16px 18px;
  background: rgba(255,255,255,.03);
}
.company-card-snow {
  border-color: rgba(2, 132, 199, .35);
  background: rgba(2, 132, 199, .08);
}
.company-card-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 6px; }
.company-card-meta { font-size: .82rem; color: #7ba7c4; margin: 0 0 10px; }
.company-card-meta a { color: var(--brand-primary); text-decoration: none; }
.company-card-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(245,250,255,.35);
  margin: 0 0 8px;
}
.company-card-services {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .88rem;
  color: rgba(245,250,255,.78);
}
.company-card-portal { margin: 12px 0 0; font-size: .86rem; }
.company-card-portal a { color: var(--brand-primary); font-weight: 600; text-decoration: none; }
.landing-snow-services { margin: 0 0 16px; }
.landing-snow-meta { margin-bottom: 18px; }
.landing-cross-link {
  font-size: .84rem;
  color: #7ba7c4;
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.landing-cross-link a { color: var(--brand-primary); font-weight: 600; text-decoration: none; display: inline-block; margin-top: 4px; }

.landing-panel {
  background: #fbfdfc;
  color: #1a1f1c;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 22px;
}
.landing-panel-inner { width: 100%; max-width: 400px; }
.panel-kicker {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--brand-primary);
  margin: 0 0 6px;
}
.panel-title {
  font-family: Inter, sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 8px;
}
.muted-dark { color: #5a6b5e !important; }
.portal-guest .callout {
  background: color-mix(in srgb, var(--brand-primary) 12%, white);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 28%, #dce4e0);
  color: #1a3d2e;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: .9rem;
}
.portal-form label { display: block; margin-bottom: 8px; }
.portal-form label span { font-size: .8rem; font-weight: 600; color: #3d4a40; }
.portal-form input[type="email"],
.portal-form input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #dce4e0;
  border-radius: 10px;
  font-size: 1rem;
  margin-bottom: 14px;
  background: #f5f7f6;
}
.portal-form input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 18%, transparent);
}
.signin-once-note { margin: -4px 0 12px; }
.btn-primary {
  width: 100%;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  background: var(--brand-primary);
  color: var(--brand-on-primary);
}
.btn-primary:disabled {
  opacity: 0.72;
  cursor: wait;
}
.btn-secondary {
  width: 100%;
  padding: 12px 18px;
  border: 1px solid #c5d0cb;
  border-radius: 10px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  background: #eef3f0;
  color: #1a3d2e;
}
.signin-code-details {
  margin-top: 18px;
}
.signin-code-summary {
  cursor: pointer;
  font-weight: 700;
  color: #1a3d2e;
  font-size: .95rem;
}
.signin-code-details .portal-code-form {
  margin-top: 12px;
}
.login-continue-panel {
  margin: 48px auto;
  max-width: 420px;
}
input.js-login-code {
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, Consolas, monospace;
}
.panel-hr { border: none; border-top: 1px solid #e5ebe7; margin: 24px 0; }
.h-sm { font-size: 1rem; font-weight: 700; margin: 0 0 8px; }

body.portal-guest {
  background: var(--brand-header);
  color: #f5faff;
}
body.portal-guest .portal-header {
  background: transparent;
  margin: 0 0 8px;
  padding: 8px 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

@media (min-width: 700px) {
  .wrap { padding: 24px 20px 48px; }
  .portal-header { margin: 0 0 8px; border-radius: 16px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .photo-pair { grid-template-columns: 1fr 1fr; }
  .portal-logo-img { height: 48px; }
}

@media (min-width: 900px) {
  .landing-split { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 699px) {
  .portal-logged-in table { display: block; overflow-x: auto; }
  .portal-tagline { display: none; }
  .portal-topnav { border-radius: 16px; }
  .portal-header { align-items: flex-start; }
  .company-switcher { width: 100%; }
  .switcher-seg { width: 100%; }
  .switcher-seg button { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
