/* Headland Law & Strategy — intake widget
   Brand tokens from live WP/Elementor kit */
@font-face {
  font-family: Recoleta;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/recoleta-regular.ttf") format("truetype");
}
@font-face {
  font-family: Recoleta;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/recoleta-black-typeface.ttf") format("truetype");
}

.headland-intake {
  --hl-navy: #222055;
  --hl-navy-2: #1a1844;
  --hl-gold: #e2b662;
  --hl-gold-deep: #3f382a;
  --hl-sage: #718c80;
  --hl-cream: #f7f4ee;
  --hl-ink: #222055;
  --hl-muted: #6b7280;
  --hl-white: #ffffff;
  --hl-serif: Recoleta, Georgia, "Times New Roman", serif;
  --hl-sans: Recoleta, Georgia, serif;

  box-sizing: border-box;
  width: 100%;
  max-width: 720px;
  height: 640px;
  max-height: calc(100dvh - 32px);
  margin: 1.5rem auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--hl-ink);
  font: 17px/1.5 var(--hl-sans);
  background: var(--hl-white);
  border: 1px solid rgba(34, 32, 85, 0.12);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(34, 32, 85, 0.14);
}

.headland-intake * {
  box-sizing: border-box;
}

.headland-intake .hl-header {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 22px;
  color: var(--hl-white);
  background-color: var(--hl-navy);
  background-image:
    linear-gradient(165deg, rgba(226, 182, 98, 0.16) 0%, transparent 45%),
    url("images/Headland-topography-map-scaled.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  border-bottom: 1px solid rgba(226, 182, 98, 0.35);
  font-family: var(--hl-serif);
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Navy overlay (#222055) at 50% opacity positioned over the background image */
.headland-intake .hl-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #222055;
  opacity: 0.88;
  z-index: 1;
  pointer-events: none;
}

/* Ensure all header text and controls render above the overlay */
.headland-intake .hl-header > * {
  position: relative;
  z-index: 2;
}

.headland-intake .hl-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.headland-intake .hl-header-description {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.headland-intake .hl-header-description p {
  margin: 0;
}

.headland-intake .hl-header-disclaimer {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
  line-height: 1.45;
}

.headland-intake .hl-header-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.headland-intake .hl-header-kicker {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hl-gold);
}

.headland-intake .hl-connection {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
}

.headland-intake .hl-indicator {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}

.headland-intake .hl-online { background: #65d69e; }
.headland-intake .hl-offline { background: #ff8e80; }
.headland-intake .hl-busy {
  background: var(--hl-gold);
  animation: hl-pulse 1s ease-in-out infinite alternate;
}
.headland-intake .hl-preview { background: #94a3b8; }

@keyframes hl-pulse {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

.headland-intake .hl-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(ellipse at top, rgba(226, 182, 98, 0.07), transparent 55%),
    var(--hl-cream);
}

.headland-intake .hl-bubble {
  margin: 0;
  max-width: 86%;
  padding: 13px 16px;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgba(34, 32, 85, 0.06);
}

.headland-intake .hl-assistant {
  align-self: flex-start;
  background: var(--hl-white);
  color: var(--hl-ink);
  border: 1px solid rgba(34, 32, 85, 0.08);
  border-bottom-left-radius: 4px;
}

.headland-intake .hl-visitor {
  align-self: flex-end;
  background: var(--hl-navy);
  color: var(--hl-white);
  border-bottom-right-radius: 4px;
}

.headland-intake .hl-status {
  align-self: flex-start;
  background: transparent;
  box-shadow: none;
  border: 0;
  color: var(--hl-muted);
  font-style: italic;
  font-size: 0.95rem;
  padding: 4px 2px;
}

.headland-intake .hl-error {
  align-self: flex-start;
  color: #9f1239;
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.headland-intake .hl-controls {
  flex-shrink: 0;
  border-bottom: 1px solid rgba(34, 32, 85, 0.1);
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--hl-white);
}

.headland-intake .hl-controls form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.headland-intake textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid rgba(34, 32, 85, 0.18);
  border-radius: 10px;
  color: var(--hl-ink);
  background: var(--hl-white);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.headland-intake textarea:focus {
  outline: none;
  border-color: var(--hl-gold);
  box-shadow: 0 0 0 3px rgba(226, 182, 98, 0.28);
}

.headland-intake button,
.headland-intake .hl-action {
  cursor: pointer;
  border: 1px solid rgba(34, 32, 85, 0.14);
  border-radius: 12px;
  background: var(--hl-white);
  color: var(--hl-navy);
  padding: 12px 14px;
  text-align: left;
  text-decoration: none;
  font: 500 0.98rem/1.35 var(--hl-serif);
  transition: background 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}

.headland-intake button:hover,
.headland-intake .hl-action:hover {
  background: #f3eee4;
  border-color: rgba(226, 182, 98, 0.55);
}

.headland-intake button:focus-visible,
.headland-intake a:focus-visible {
  outline: 3px solid rgba(226, 182, 98, 0.55);
  outline-offset: 2px;
}

.headland-intake form > button[type="submit"],
.headland-intake .hl-action {
  background: linear-gradient(180deg, var(--hl-gold) 0%, var(--hl-gold-deep) 100%);
  border: 0;
  color: var(--hl-white);
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px rgba(63, 56, 42, 0.28);
}

.headland-intake form > button[type="submit"] {
  flex-shrink: 0;
  min-width: 100px;
  padding: 12px 18px;
}

.headland-intake form > button[type="submit"]:hover,
.headland-intake .hl-action:hover {
  filter: brightness(1.06);
  background: linear-gradient(180deg, #ebb96f 0%, #4a4030 100%);
  border: 0;
  color: var(--hl-white);
}

@media (max-width: 560px) {
  .headland-intake {
    height: min(600px, calc(100dvh - 24px));
    border-radius: 12px;
  }
  .headland-intake .hl-bubble {
    max-width: 94%;
  }
  .headland-intake .hl-controls form {
    flex-direction: column;
    align-items: stretch;
  }
}
