﻿:root {
  color-scheme: light;
  font-family: Inter, "SF Pro Display", "Segoe UI", Arial, sans-serif;
  --bg: #f5f5f7;
  --ink: #111114;
  --muted: #646873;
  --line: rgba(17, 17, 20, 0.1);
  --line-strong: rgba(17, 17, 20, 0.18);
  --surface: rgba(255, 255, 255, 0.86);
  --white: #fff;
  --black: #111114;
  --orange: #ff6a00;
  --blue: #0071e3;
  --green: #078a55;
  --red: #b42318;
  --shadow: 0 24px 70px rgba(23, 28, 38, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 106, 0, 0.12), transparent 26vw),
    radial-gradient(circle at 92% 4%, rgba(0, 113, 227, 0.1), transparent 25vw),
    linear-gradient(180deg, #fbfbfd, var(--bg));
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
  padding: 8px clamp(18px, 5vw, 70px);
  background: rgba(251, 251, 253, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(1.2);
}

.brand img {
  width: clamp(108px, 12vw, 158px);
}

.portal-header nav {
  display: flex;
  gap: 8px;
}

.portal-header a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.portal-header nav a:hover {
  background: var(--white);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.login-screen,
.portal-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 52px);
}

.login-screen {
  min-height: calc(100vh - 70px);
  display: grid;
  align-items: center;
}

.login-hero,
.property-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 26px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(28px, 6vw, 76px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.68)),
    linear-gradient(120deg, rgba(255, 106, 0, 0.12), rgba(0, 113, 227, 0.1));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-hero h1,
.property-hero h1 {
  margin: 14px 0 0;
  max-width: 900px;
  font-size: clamp(44px, 7vw, 96px);
  line-height: 0.96;
  letter-spacing: 0;
}

.property-hero p,
.muted {
  color: var(--muted);
  line-height: 1.55;
}

.app-topbar {
  position: sticky;
  top: 86px;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 44px rgba(18, 22, 30, 0.09);
  backdrop-filter: blur(22px) saturate(1.2);
}

.topbar-brand,
.profile-chip,
.hero-actions,
.toolbar-row,
.prompt-row,
.handoff-flow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-brand strong,
.topbar-brand span {
  display: block;
}

.topbar-brand span,
.section-tab span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.brand-mark,
.feature-icon,
.guide-card > span {
  display: inline-grid;
  place-items: center;
  width: 44px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--black);
  color: var(--white);
  font-weight: 700;
}

.section-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.section-tab,
.feature-card,
.quick-card {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.section-tab {
  min-height: 54px;
  padding: 8px 12px;
}

.section-tab strong,
.section-tab span {
  display: block;
}

.section-tab.active,
.section-tab:hover {
  background: var(--black);
  color: var(--white);
}

.section-tab.active span,
.section-tab:hover span {
  color: rgba(255, 255, 255, 0.72);
}

.topbar-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.search-box,
.filter-box {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.search-box input,
.filter-box select,
.form input,
.form select,
.form textarea {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  outline: none;
}

.search-box input:focus,
.filter-box select:focus,
.form input:focus,
.form select:focus,
.form textarea:focus {
  border-color: rgba(0, 113, 227, 0.65);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.11);
}

.profile-chip,
.icon-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.profile-chip {
  padding: 4px 12px 4px 4px;
}

.icon-button {
  width: 44px;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.9), transparent 30%),
    linear-gradient(135deg, var(--orange), var(--blue));
  color: var(--white);
  border: 3px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(18, 22, 30, 0.16);
  flex: 0 0 auto;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar span {
  color: var(--white);
  font-weight: 700;
}

.avatar-lg {
  width: 108px;
}

.avatar-lg span {
  font-size: 34px;
}

.section-stage {
  margin-top: 20px;
}

.glass-card,
.panel-card,
.metric-card,
.resident-card,
.feature-card,
.quick-card,
.guide-card,
.help-card,
.handoff-card,
.empty-state,
.state-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 50px rgba(21, 25, 32, 0.08);
  backdrop-filter: blur(18px);
}

.resident-card {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 24px;
  background: var(--black);
  color: var(--white);
}

.resident-card span,
.resident-card p {
  color: rgba(255, 255, 255, 0.74);
}

.large-card {
  align-content: start;
  min-height: 360px;
}

.insight-grid,
.guided-grid,
.feature-grid,
.deposit-summary,
.utility-grid,
.solar-widget,
.guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.feature-grid,
.solar-widget,
.guide-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card,
.feature-card,
.quick-card,
.guide-card,
.panel-card,
.glass-card,
.handoff-card,
.empty-state,
.state-card {
  padding: 22px;
}

.interactive-card {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.interactive-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 106, 0, 0.34);
  box-shadow: 0 28px 70px rgba(21, 25, 32, 0.14);
}

.metric-card span,
.feature-card p,
.quick-card span,
.guide-card p,
.compact-list p,
.timeline-item p,
.timeline-item em,
td small {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

.feature-card {
  min-height: 210px;
}

.feature-card strong,
.quick-card strong,
.guide-card h3 {
  display: block;
  margin-top: 16px;
  font-size: 20px;
}

.quick-card {
  min-height: 140px;
}

.two-column,
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
  gap: 16px;
  margin-top: 18px;
}

.section-heading h2 {
  max-width: 930px;
  margin: 12px 0 0;
  font-size: clamp(30px, 4vw, 56px);
  line-height: 1.04;
  letter-spacing: 0;
}

.section-landing,
.detail-view {
  min-height: 520px;
}

.detail-view {
  display: grid;
  gap: 18px;
}

.eyebrow,
.readonly-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 700;
}

.eyebrow {
  background: rgba(255, 106, 0, 0.11);
  color: #9c3b00;
}

.readonly-badge {
  background: rgba(17, 17, 20, 0.08);
  color: var(--black);
}

.status-badge {
  background: rgba(255, 106, 0, 0.13);
  color: #8b3600;
  white-space: nowrap;
}

.status-badge.good {
  background: rgba(7, 138, 85, 0.12);
  color: var(--green);
}

.action,
.back-button,
.mini-button {
  border: 0;
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action {
  min-height: 44px;
  padding: 0 17px;
}

.action.secondary,
.back-button,
.mini-button {
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--line-strong);
}

.mini-button {
  min-height: 32px;
  padding: 0 10px;
  margin-right: 6px;
  font-size: 12px;
}

.back-button {
  justify-self: start;
  min-height: 38px;
  padding: 0 14px;
}

.message {
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: 8px;
  background: rgba(0, 113, 227, 0.1);
  color: #004b9a;
  font-weight: 700;
}

.timeline {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.timeline-item > span {
  width: 10px;
  aspect-ratio: 1;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 5px rgba(255, 106, 0, 0.12);
}

.timeline-item strong,
.timeline-item p {
  display: block;
  margin: 0;
}

.compact-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.compact-list article,
.state-card,
.help-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.compact-list strong,
.compact-list p,
.compact-list span {
  display: block;
  margin: 0;
}

.form {
  display: grid;
  gap: 12px;
}

.form label {
  display: grid;
  gap: 7px;
  color: #3a3d44;
  font-size: 13px;
  font-weight: 700;
}

.form textarea {
  min-height: 120px;
  padding-top: 14px;
}

.inline-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.profile-photo-editor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.file-drop {
  min-height: 116px;
  justify-content: center;
  border: 1px dashed rgba(0, 113, 227, 0.38);
  border-radius: 8px;
  padding: 18px;
  background: rgba(0, 113, 227, 0.05);
}

.profile-lines {
  display: grid;
  gap: 9px;
  margin: 18px 0;
}

.records-toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td small {
  display: block;
  margin-top: 4px;
}

.toolbar-row {
  margin-bottom: 12px;
}

.chat-panel {
  display: grid;
  gap: 14px;
}

.chat-stream {
  display: grid;
  gap: 10px;
  min-height: 280px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 245, 247, 0.9));
}

.chat-bubble {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: 8px;
}

.chat-bubble.assistant {
  justify-self: start;
  background: var(--white);
  border: 1px solid var(--line);
}

.chat-bubble.user {
  justify-self: end;
  background: var(--black);
  color: var(--white);
}

.chat-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.handoff-flow {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 106, 0, 0.08);
}

.handoff-flow span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--white);
  font-weight: 700;
}

.empty-state {
  text-align: center;
}

.empty-state p {
  color: var(--muted);
}

.success-state {
  border-color: rgba(7, 138, 85, 0.24);
  background: rgba(7, 138, 85, 0.08);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .app-topbar {
    grid-template-columns: 1fr;
    top: 76px;
  }

  .topbar-tools {
    justify-content: start;
    flex-wrap: wrap;
  }

  .section-nav {
    overflow-x: auto;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
  }

  .insight-grid,
  .guided-grid,
  .feature-grid,
  .solar-widget,
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .login-hero,
  .property-hero,
  .two-column,
  .split,
  .inline-form,
  .chat-form,
  .profile-photo-editor {
    grid-template-columns: 1fr;
  }

  .insight-grid,
  .guided-grid,
  .feature-grid,
  .deposit-summary,
  .utility-grid,
  .solar-widget,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .portal-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-hero h1,
  .property-hero h1 {
    font-size: 42px;
  }
}
