/* Havlo Surface System
   Stitch-inspired primitives for calm, premium, decision-centered real estate surfaces. */

:root {
  --hs-paper: #fbf7f1;
  --hs-page: #f3f5fa;
  --hs-card: #ffffff;
  --hs-ink: #132033;
  --hs-muted: #647084;
  --hs-soft: #e9eef8;
  --hs-line: rgba(19, 32, 51, 0.1);
  --hs-copper: #a75413;
  --hs-copper-dark: #8f430d;
  --hs-navy: #06203f;
  --hs-shadow: 0 22px 52px rgba(10, 22, 39, 0.08);
  --hs-radius: 14px;
}

.hs-surface {
  background:
    radial-gradient(circle at 8% 0%, rgba(167, 84, 19, 0.07), transparent 26rem),
    linear-gradient(180deg, var(--hs-page), #f7f8fb 58%, #eef2f8);
  color: var(--hs-ink);
}

.hs-kicker {
  color: var(--hs-copper);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hs-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-radius);
  box-shadow: var(--hs-shadow);
}

.hs-status-pill,
.hs-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: var(--hs-soft);
  color: var(--hs-ink);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hs-action-copper {
  background: var(--hs-copper);
  color: #fff;
  border: 0;
  box-shadow: 0 10px 24px rgba(167, 84, 19, 0.22);
}

.hs-action-copper:hover {
  background: var(--hs-copper-dark);
}

/* Booking / showing surface */
.hs-booking-surface:not(.hv-booking-manage) [data-zone="hero-zone"] {
  min-height: 24rem !important;
  align-items: center !important;
  background:
    linear-gradient(90deg, rgba(243, 245, 250, 0.94), rgba(243, 245, 250, 0.86)),
    radial-gradient(circle at 84% 28%, rgba(167, 84, 19, 0.14), transparent 20rem) !important;
}

.hs-booking-surface:not(.hv-booking-manage) [data-zone="hero-zone"] h1 {
  color: var(--hs-copper) !important;
}

.hs-booking-surface:not(.hv-booking-manage) [data-zone="hero-zone"] p,
.hs-booking-surface:not(.hv-booking-manage) [data-zone="hero-zone"] div {
  color: var(--hs-muted) !important;
}

.hs-booking-surface:not(.hv-booking-manage) [data-zone="form-zone"] {
  background: var(--hs-page) !important;
  padding-top: 2.25rem !important;
}

.hs-booking-surface:not(.hv-booking-manage) .booking-bento-grid > div > div > div[x-show],
.hs-booking-surface:not(.hv-booking-manage) .booking-sidebar > div {
  border-radius: var(--hs-radius);
  box-shadow: var(--hs-shadow) !important;
  border: 1px solid var(--hs-line);
}

.hs-booking-surface:not(.hv-booking-manage) .booking-sidebar > div:nth-child(3) {
  background: linear-gradient(160deg, var(--hs-copper), #b7641c) !important;
  color: #fff !important;
}

.hs-booking-surface:not(.hv-booking-manage) .booking-sidebar > div:nth-child(4) {
  border-radius: 10px;
  background: #e4e8ef !important;
}

.hs-booking-surface:not(.hv-booking-manage) .hv-action.hv-action--primary,
.hs-booking-surface:not(.hv-booking-manage) button.hv-action.hv-action--primary {
  background: var(--hs-copper) !important;
  border-color: var(--hs-copper) !important;
  color: #fff !important;
  border-radius: 6px !important;
}

.hs-booking-surface:not(.hv-booking-manage) input,
.hs-booking-surface:not(.hv-booking-manage) select,
.hs-booking-surface:not(.hv-booking-manage) textarea {
  background: #f3f6fc !important;
  border: 1px solid rgba(19, 32, 51, 0.06) !important;
  border-radius: 6px !important;
}

/* Portal access */
.portal-login {
  background: var(--hs-page);
}

.portal-login__hero {
  background: linear-gradient(160deg, #6d390d 0%, var(--hs-copper) 48%, #7b4517 100%) !important;
}

.portal-login__hero-bg {
  background:
    radial-gradient(ellipse 84% 46% at 28% 24%, rgba(255, 255, 255, 0.13), transparent 62%),
    radial-gradient(ellipse 52% 80% at 74% 46%, rgba(255, 229, 196, 0.16), transparent 66%) !important;
}

.portal-login__hero-quote,
.portal-login__hero-body {
  color: #fff !important;
}

.portal-login__form {
  background:
    radial-gradient(circle at 88% 82%, rgba(167, 84, 19, 0.08), transparent 12rem),
    var(--hs-page) !important;
}

.portal-login__form-inner {
  max-width: 38rem !important;
}

.portal-login [data-portal-card] {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(19, 32, 51, 0.08);
  border-radius: var(--hs-radius);
  box-shadow: var(--hs-shadow);
  padding: 1.5rem;
}

.portal-login .portal-submit {
  background: var(--hs-copper) !important;
}

/* Admin decision surfaces */
.hs-admin-surface {
  min-height: calc(100vh - 64px);
  background:
    radial-gradient(circle at 18% 0%, rgba(167, 84, 19, 0.06), transparent 24rem),
    var(--hs-page);
}

.hs-admin-surface .dl-header h1,
.hs-admin-surface .dd-header h1 {
  color: var(--hs-copper) !important;
}

.hs-admin-surface .dl-header,
.hs-admin-surface .dd-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.5rem !important;
}

.hs-admin-surface .dl-stats {
  grid-template-columns: 1.35fr 1fr 1fr 1fr !important;
  gap: 1rem !important;
  background: transparent !important;
}

.hs-admin-surface .dl-stat,
.hs-admin-surface .dd-card,
.hs-admin-surface .hv-table-shell,
.hs-ledger-rail,
.hs-record-actions {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-radius) !important;
  box-shadow: var(--hs-shadow) !important;
}

.hs-admin-surface .dl-stat:first-child {
  text-align: left;
}

.hs-admin-surface .dl-stat__value {
  color: var(--hs-copper) !important;
  font-size: clamp(2rem, 4vw, 3rem) !important;
}

.hs-ledger-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 23rem;
  gap: 1.5rem;
  align-items: start;
}

.hs-ledger-rail {
  padding: 1.25rem;
  position: sticky;
  top: 5.5rem;
}

.hs-ledger-rail__title {
  color: var(--hs-copper);
  font-family: var(--hv-font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hs-ledger-rail__bar {
  height: 8px;
  background: #eef2f8;
  border-radius: 999px;
  overflow: hidden;
}

.hs-ledger-rail__fill {
  height: 100%;
  background: var(--hs-copper);
}

.hs-ledger-rail__block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hs-line);
}

.hs-record-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.8rem;
}

.hs-record-actions a,
.hs-record-actions button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--hs-line);
  background: #fff;
  color: var(--hs-ink);
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
}

.hs-record-actions .hs-primary {
  background: var(--hs-copper);
  color: #fff;
  border-color: var(--hs-copper);
}

.hs-admin-surface .dd-recommendation {
  background: linear-gradient(160deg, var(--hs-copper), #b8641d) !important;
  color: #fff !important;
}

.hs-admin-surface .dd-actions,
.hs-admin-surface .dd-override {
  background: #fff7ef !important;
  border-color: rgba(167, 84, 19, 0.22) !important;
}

@media (max-width: 1100px) {
  .hs-ledger-workbench {
    grid-template-columns: 1fr;
  }

  .hs-ledger-rail {
    position: static;
  }
}

@media (max-width: 720px) {
  .portal-login {
    margin: 0 !important;
  }

  .hs-admin-surface {
    padding: 1rem !important;
  }

  .hs-admin-surface .dl-stats {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* Public narrative system: every page is a different lens on the same engine. */
.hv-system-page {
  background:
    radial-gradient(circle at 82% 4%, rgba(167, 84, 19, 0.12), transparent 24rem),
    linear-gradient(180deg, #f3f5fa 0%, #fbf7f1 52%, #eef2f8 100%);
  color: var(--hs-ink);
}

.hv-system-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(22rem, 0.95fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  max-width: 78rem;
  margin: 0 auto;
  padding: clamp(4rem, 8vw, 7rem) 1.5rem;
}

.hv-system-hero__eyebrow,
.hv-system-label {
  color: var(--hs-copper);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hv-system-hero h1 {
  max-width: 44rem;
  margin: 1rem 0 1.25rem;
  color: var(--hs-copper);
  font-family: var(--hv-font-display);
  font-size: clamp(3rem, 7vw, 6.25rem);
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 0.88;
}

.hv-system-hero__lead {
  max-width: 38rem;
  color: var(--hs-muted);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.75;
}

.hv-system-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.hv-system-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.75rem 1.1rem;
  border-radius: 6px;
  border: 1px solid rgba(19, 32, 51, 0.14);
  color: var(--hs-ink);
  background: rgba(255, 255, 255, 0.68);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.hv-system-button--primary {
  background: var(--hs-copper);
  border-color: var(--hs-copper);
  color: #fff;
  box-shadow: 0 16px 36px rgba(167, 84, 19, 0.18);
}

.hv-orchestrator-panel {
  position: relative;
  overflow: hidden;
  min-height: 34rem;
  padding: 1.25rem;
  border-radius: 22px;
  background:
    linear-gradient(150deg, rgba(6, 32, 63, 0.96), rgba(14, 45, 78, 0.9)),
    var(--hs-navy);
  color: #fff;
  box-shadow: 0 34px 90px rgba(6, 32, 63, 0.24);
}

.hv-orchestrator-panel::before {
  content: "";
  position: absolute;
  inset: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
}

.hv-orchestrator-panel__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000, transparent 92%);
}

.hv-orchestrator-panel__content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1rem;
}

.hv-system-chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hv-system-chip::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: #8be6d0;
}

.hv-state-card {
  padding: 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hv-state-card strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #fff;
  font-family: var(--hv-font-display);
}

.hv-state-card span {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.84rem;
  line-height: 1.55;
}

.hv-system-band {
  background: var(--hs-navy);
  color: #fff;
}

.hv-system-band__inner,
.hv-system-section {
  max-width: 78rem;
  margin: 0 auto;
  padding: clamp(3.5rem, 7vw, 6rem) 1.5rem;
}

.hv-system-band__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem);
}

.hv-system-band h2,
.hv-system-section h2 {
  margin: 0.85rem 0 1rem;
  font-family: var(--hv-font-display);
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.hv-system-band p,
.hv-system-section p {
  color: var(--hs-muted);
  line-height: 1.7;
}

.hv-system-band p {
  color: rgba(255, 255, 255, 0.64);
}

.hv-capability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.hv-capability-card {
  min-height: 14rem;
  padding: 1.2rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--hs-line);
  box-shadow: var(--hs-shadow);
}

.hv-system-band .hv-capability-card {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
}

.hv-capability-card h3 {
  margin: 0.7rem 0 0.55rem;
  color: var(--hs-ink);
  font-family: var(--hv-font-display);
  font-size: 1.2rem;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.hv-system-band .hv-capability-card h3 {
  color: #fff;
}

.hv-capability-card p {
  font-size: 0.9rem;
}

.hv-decision-thread {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hv-thread-row {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--hs-line);
}

.hv-thread-row span {
  color: var(--hs-copper);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hv-thread-row strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--hs-ink);
}

.hv-thread-row p {
  margin: 0;
  font-size: 0.9rem;
}

.hv-quiet-cta {
  background: linear-gradient(160deg, var(--hs-copper), #8f430d);
  color: #fff;
  text-align: center;
}

.hv-quiet-cta .hv-system-section {
  max-width: 54rem;
}

.hv-quiet-cta p {
  color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 960px) {
  .hv-system-hero,
  .hv-system-band__inner {
    grid-template-columns: 1fr;
  }

  .hv-capability-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .hv-thread-row {
    grid-template-columns: 1fr;
  }
}
