:root {
  --portal-ink: #102326;
  --portal-muted: #5f7074;
  --portal-line: #dbe7e5;
  --portal-paper: #ffffff;
  --portal-wash: #f4faf8;
  --portal-teal: #0f766e;
  --portal-teal-dark: #0a4f4b;
  --portal-blue: #1d4ed8;
  --portal-gold: #f59e0b;
  --portal-red: #dc2626;
  --portal-shadow: 0 22px 60px rgba(13, 54, 58, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--portal-ink);
  background: var(--portal-paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; line-height: 1.06; letter-spacing: 0; }
p { color: var(--portal-muted); line-height: 1.55; }

.portal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--portal-line);
  backdrop-filter: blur(18px);
}

.portal-brand img {
  display: block;
  width: min(210px, 46vw);
  height: 45px;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) saturate(100%) invert(30%) sepia(77%) saturate(785%) hue-rotate(133deg) brightness(92%) contrast(90%);
}

.portal-header nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #385053;
  font-size: 0.95rem;
  font-weight: 800;
}

.portal-nav-button {
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 8px;
  color: white;
  background: var(--portal-teal);
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.7fr);
  gap: clamp(28px, 5vw, 78px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: clamp(54px, 8vw, 100px) clamp(18px, 6vw, 82px);
  background:
    linear-gradient(90deg, rgba(244, 250, 248, 0.97), rgba(244, 250, 248, 0.74)),
    url("assets/digitizecanada-hero-preview.png");
  background-size: cover;
  background-position: center;
}

.portal-eyebrow {
  margin: 0 0 12px;
  color: var(--portal-teal);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.portal-hero h1 {
  max-width: 760px;
  font-size: clamp(2.6rem, 6vw, 5.6rem);
}

.portal-hero p {
  max-width: 660px;
  font-size: clamp(1.03rem, 2vw, 1.22rem);
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.portal-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: white;
  background: var(--portal-teal);
  font-weight: 900;
  cursor: pointer;
}

.portal-button-secondary {
  color: var(--portal-teal-dark);
  background: white;
  border-color: var(--portal-line);
}

.portal-device,
.portal-panel,
.lead-card,
.summary-card,
.admin-panel,
.auth-card,
.careers-grid article {
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--portal-shadow);
}

.portal-device {
  min-height: 360px;
  padding: 18px;
}

.portal-device-bar {
  display: flex;
  gap: 7px;
  padding-bottom: 18px;
}

.portal-device-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9fb5b4;
}

.lead-preview {
  display: grid;
  gap: 14px;
  min-height: 280px;
  padding: 28px;
  border-radius: 8px;
  background: var(--portal-wash);
}

.lead-preview-kicker {
  color: var(--portal-teal);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.lead-preview strong {
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1;
}

.status-row,
.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.status-row span,
.status-grid button {
  min-height: 44px;
  padding: 10px;
  border: 1px solid #cbdcda;
  border-radius: 8px;
  background: white;
  color: var(--portal-ink);
  font-weight: 850;
  text-align: center;
}

.status-grid button {
  cursor: pointer;
}

.status-grid button[aria-pressed="true"] {
  border-color: var(--portal-teal);
  background: #e7f8f4;
  color: var(--portal-teal-dark);
  box-shadow: inset 0 0 0 1px var(--portal-teal);
}

.portal-button:disabled,
.status-grid button:disabled,
.auth-card input:disabled,
.lead-form textarea:disabled,
.admin-form textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.careers-grid,
.portal-shell,
.summary-grid,
.admin-grid {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(56px, 8vw, 96px) 0;
}

.careers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.careers-grid article,
.auth-card,
.lead-card,
.summary-card,
.admin-panel {
  padding: clamp(22px, 3vw, 34px);
}

.portal-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(320px, 1fr);
  gap: 22px;
  align-items: start;
}

.portal-panel {
  padding: 18px;
  background: var(--portal-wash);
}

.portal-panel h1 {
  font-size: clamp(2rem, 4vw, 3.3rem);
}

.config-banner {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #f3d48a;
  border-radius: 8px;
  background: #fff7df;
  color: #704d05;
  font-weight: 800;
}

.config-banner p {
  margin: 0;
  color: #704d05;
  font-size: 0.95rem;
}

.portal-status {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: var(--portal-wash);
  color: var(--portal-ink);
  font-weight: 800;
}

.portal-status[data-state="success"] {
  border-color: #9bd7ca;
  background: #e7f8f4;
  color: var(--portal-teal-dark);
}

.portal-status[data-state="warning"] {
  border-color: #f3d48a;
  background: #fff7df;
  color: #704d05;
}

.portal-status[data-state="error"] {
  border-color: #f3a8a8;
  background: #fff1f1;
  color: #9f1239;
}

.auth-card form,
.lead-form,
.admin-form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  color: var(--portal-ink);
  font-weight: 850;
}

.auth-card input,
.admin-form select,
.lead-form textarea,
.admin-form input,
.admin-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid #cbdcda;
  border-radius: 8px;
  background: white;
  color: var(--portal-ink);
}

.lead-form textarea,
.admin-form textarea {
  min-height: 104px;
  resize: vertical;
}

.lead-meta {
  display: grid;
  gap: 8px;
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: var(--portal-wash);
}

.lead-phone {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  color: white;
  background: var(--portal-blue);
  font-weight: 900;
}

.summary-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  color: var(--portal-teal-dark);
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1;
}

.admin-stat {
  display: block;
  margin-top: 10px;
  color: var(--portal-teal-dark);
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1;
}

.summary-list {
  grid-column: 1 / -1;
}

.summary-list ul,
.admin-panel ul {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.summary-list li,
.admin-panel li {
  padding: 12px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: var(--portal-wash);
}

.portal-footer {
  padding: 28px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--portal-line);
}

.portal-footer p {
  margin: 0;
}

@media (max-width: 900px) {
  .portal-header nav a:not(.portal-nav-button) {
    display: none;
  }

  .portal-hero,
  .portal-shell,
  .careers-grid,
  .summary-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .summary-list {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .portal-header {
    gap: 12px;
    padding: 12px 16px;
  }

  .portal-brand img {
    width: min(184px, 54vw);
    height: 40px;
  }

  .portal-hero {
    min-height: auto;
    padding-top: 46px;
  }

  .portal-actions,
  .status-row,
  .status-grid {
    grid-template-columns: 1fr;
  }
}
