/* ==========================================================================
   FIFTY PUBLIC SITE — LIGHT THEME v1.0
   ========================================================================== */

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Brand */
  --brand-navy: #1A237E;
  --brand-navy-dark: #0D1452;
  --brand-navy-light: #283593;
  --brand-orange: #E8511A;
  --brand-orange-hover: #D44A15;
  --brand-orange-light: #FFF4F0;
  --brand-orange-soft: #FDEEE8;

  /* Surfaces */
  --bg-page: #FAFAFA;
  --bg-white: #FFFFFF;
  --bg-section-alt: #F9FAFB;
  --bg-input: #F3F4F6;
  --bg-overlay: rgba(0,0,0,0.5);

  /* Text */
  --text-primary: #1C1C1E;
  --text-heading: #111827;
  --text-body: #374151;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --text-white: #FFFFFF;
  --text-link: #2563EB;

  /* Borders */
  --border-light: #E5E7EB;
  --border-medium: #D1D5DB;
  --border-dark: #9CA3AF;

  /* Feedback / status (tema público) */
  --warning-bg: #FEF3C7;
  --warning-border: #FCD34D;
  --warning-text: #92400E;

  /* Status */
  --color-success: #059669;
  --color-success-bg: #ECFDF5;
  --color-info: #2563EB;
  --color-info-bg: #EFF6FF;
  --color-warning: #D97706;
  --color-warning-bg: #FFFBEB;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Typography */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Layout */
  --max-width: 1200px;
  --header-height: 72px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--text-body);
  background: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; }
a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.site-flash-wrap {
  position: sticky;
  top: 0;
  z-index: 1200;
  padding: 0.75rem 1rem 0;
}

.site-flash {
  max-width: var(--max-width);
  margin: 0 auto;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
}

.site-flash.notice {
  background: var(--color-success-bg);
  border-color: var(--color-success);
  color: #065F46;
}

.site-flash.alert {
  background: #FEF2F2;
  border-color: #EF4444;
  color: #991B1B;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  height: var(--header-height);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.header-brand:hover { text-decoration: none; }

.header-brand .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--brand-orange);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}

.header-brand .logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-brand .brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  color: var(--brand-navy);
}

.header-brand .broker-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: -2px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.header-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-body);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.header-nav a:hover { color: var(--brand-navy); text-decoration: none; }
.header-nav a.active { color: var(--brand-navy); font-weight: 600; }
.header-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -24px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-orange);
  border-radius: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}


.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25D366;
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: var(--font-body);
}

.btn-whatsapp:hover { background: #1ebe5d; transform: translateY(-1px); box-shadow: var(--shadow-sm); text-decoration: none; color: white; }

/* ============================================================
   HERO SECTION (HOMEPAGE) — Immersive visual, search-first
   ============================================================ */
.hero {
  position: relative;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}


/* Search Box — first element in hero */
.hero-search {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 6px;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 780px;
  border: 1px solid rgba(255,255,255,0.2);
  margin-bottom: var(--space-2xl);
}


.btn-search {
  background: var(--brand-orange);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-search:hover { background: var(--brand-orange-hover); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(232,81,26,0.35); }

/* Headline — below search */
.hero h1 {
  font-family: var(--font-heading);
  font-size: 46px;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.15;
  margin-bottom: var(--space-md);
  max-width: 700px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.hero h1 span { color: var(--brand-orange); }


.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-heading);
}

.section-header p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 4px;
}


/* Property Card */
.property-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.property-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: all 0.25s ease;
  cursor: pointer;
  display: block;
  color: inherit;
  text-decoration: none;
}

.property-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--border-medium);
  text-decoration: none;
  color: inherit;
}

.property-card-image {
  position: relative;
  height: 220px;
  background: linear-gradient(135deg, #E5E7EB, #D1D5DB);
  overflow: hidden;
}

.property-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.property-card:hover .property-card-image img {
  transform: scale(1.04);
}

.property-card-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  z-index: 1;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}


.property-card-photo-count {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 1;
}

.property-card-body {
  padding: var(--space-md) var(--space-lg) var(--space-lg);
}

.property-card-location {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.property-card-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: var(--space-sm);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.property-card-specs {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-light);
}

.property-card-spec {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.property-card-spec strong { color: var(--text-primary); font-weight: 600; }

.property-card-price {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-navy);
}

.property-card-price small {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
}


.btn-ai-chat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-orange);
  color: white;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: var(--font-body);
  text-decoration: none;
}

.btn-ai-chat:hover { background: var(--brand-orange-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(232,81,26,0.3); color: white; text-decoration: none; }


.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-orange);
  color: white;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
  text-decoration: none;
}

.btn-primary:hover { background: var(--brand-orange-hover); color: white; text-decoration: none; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--brand-navy);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--brand-navy);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
  text-decoration: none;
}

.btn-outline:hover { background: var(--brand-navy); color: white; text-decoration: none; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--brand-navy-dark);
  color: rgba(255,255,255,0.8);
  padding: var(--space-2xl) 0 var(--space-lg);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: var(--space-lg);
}

.footer-brand .brand-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: white;
  margin-bottom: 6px;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.6;
  max-width: 280px;
  opacity: 0.7;
}

.footer-links h5 {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-sm);
}

.footer-links a {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  padding: 3px 0;
  text-decoration: none;
}

.footer-links a:hover { color: white; text-decoration: none; }

.footer-social {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  transition: background 0.2s;
  text-decoration: none;
}

.footer-social a:hover { background: var(--brand-orange); text-decoration: none; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.5;
}

.footer-bottom a { color: rgba(255,255,255,0.5); text-decoration: none; }
.footer-bottom a:hover { color: white; text-decoration: none; }


/* ============================================================
   LISTING PAGE — GRID + SIDEBAR
   ============================================================ */
.listing-section {
  padding: var(--space-xl) 0 var(--space-3xl);
}


.sidebar-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: var(--space-lg);
}

.sidebar-card h4 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: var(--space-md);
}


/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: var(--space-xl);
  grid-column: 1 / -1;
}


.gallery-back-link {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  font-size: 13px;
  color: var(--text-secondary);
}

.gallery-back-link a { color: var(--text-link); font-weight: 500; }

/* ============================================================
   DETAIL PAGE — CONTENT
   ============================================================ */
.detail-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-3xl);
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-xl);
}

.detail-main { display: flex; flex-direction: column; gap: var(--space-xl); }


.detail-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
  margin-bottom: 6px;
}


/* Description */
.detail-description {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.detail-description h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: var(--space-md);
}

.detail-description p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-body);
}


/* ============================================================
   DETAIL PAGE — SIDEBAR (CONTACT + AI)
   ============================================================ */
.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding-top: var(--space-lg);
}

.contact-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: sticky;
  top: calc(var(--header-height) + var(--space-lg));
}

.contact-card h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: var(--space-md);
}

.contact-form-field {
  margin-bottom: var(--space-md);
}

.contact-form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.contact-form-field input,
.contact-form-field textarea {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
  background: var(--bg-white);
}

.contact-form-field input:focus,
.contact-form-field textarea:focus { border-color: var(--brand-navy); }

.contact-form-field input::placeholder,
.contact-form-field textarea::placeholder { color: var(--text-muted); }

/* === AVALIAR (app/views/public/pages/avaliar.html.erb) — migrado de style block === */
.contact-form-field select {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-white);
  color: var(--text-primary);
  outline: none;
  margin-top: 6px;
  transition: border-color 0.15s;
}
.contact-form-field select:focus { border-color: var(--brand-navy); }
@media (max-width: 600px) {
  .contact-form-field select { font-size: 16px; }
}

.btn-submit-lead {
  width: 100%;
  background: var(--brand-orange);
  color: white;
  border: none;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
  margin-bottom: var(--space-sm);
}

.btn-submit-lead:hover { background: var(--brand-orange-hover); }
.btn-submit-lead:disabled { opacity: 0.7; cursor: not-allowed; }

.contact-or {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin: var(--space-sm) 0;
  position: relative;
}

.contact-or::before,
.contact-or::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 20px);
  height: 1px;
  background: var(--border-light);
}

.contact-or::before { left: 0; }
.contact-or::after { right: 0; }

.lead-form-error {
  font-size: 12px;
  color: #DC2626;
  margin-bottom: var(--space-sm);
  display: none;
}

.lead-form-error.is-visible { display: block; }


/* ============================================================
   FLOATING AI CHAT BUBBLE
   ============================================================ */
.ai-chat-bubble {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 54px;
  height: 54px;
  background: var(--brand-navy);
  border-radius: 50%;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(26,35,126,0.35);
  z-index: 200;
  transition: all 0.2s;
}

.ai-chat-bubble:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(26,35,126,0.45); }

.ai-chat-bubble svg { width: 26px; height: 26px; fill: white; }

.ai-chat-panel {
  position: fixed;
  bottom: 164px;
  right: 24px;
  width: 360px;
  max-height: 520px;
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xl);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ai-chat-panel[hidden] { display: none; }

.ai-chat-header {
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-navy-light));
  color: white;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-chat-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
}

.ai-chat-subtitle {
  font-size: 12px;
  opacity: 0.75;
  display: block;
}

.ai-chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  padding: 4px;
}

.ai-chat-close:hover { opacity: 1; }

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
}

.ai-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border-light);
}

.ai-quick-reply {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--brand-orange-light);
  color: var(--brand-orange);
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: 1px solid rgba(232,81,26,0.2);
  font-family: var(--font-body);
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}

.ai-quick-reply:hover { background: var(--brand-orange-soft); }

.ai-chat-form {
  display: flex;
  border-top: 1px solid var(--border-light);
  padding: var(--space-sm);
  gap: var(--space-sm);
}

.ai-chat-input {
  flex: 1;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  color: var(--text-primary);
  background: var(--bg-white);
}

.ai-chat-input:focus { border-color: var(--brand-navy); }
.ai-chat-input::placeholder { color: var(--text-muted); }

.ai-chat-send {
  background: var(--brand-orange);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.ai-chat-send:hover { background: var(--brand-orange-hover); }

@media (max-width: 480px) {
  .ai-chat-bubble { right: 14px; bottom: 80px; }
  .ai-chat-panel { right: 10px; bottom: 148px; width: calc(100vw - 20px); }
}

/* ============================================================
   CHAT — MENSAGENS, ESTADO DE ERRO E "DIGITANDO" (.pub-chat-*)
   Escopo: site público. Bolhas injetadas via Stimulus (ai-chat).
   Usuário à direita, IA à esquerda, erro como estado distinto.
   ============================================================ */
.pub-chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  border-radius: var(--radius-md);
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Usuário — direita, fundo de marca */
.pub-chat-msg--user {
  align-self: flex-end;
  background: var(--brand-navy);
  color: var(--text-white);
  border-bottom-right-radius: var(--radius-sm);
}

/* IA — esquerda, fundo neutro distinto do painel */
.pub-chat-msg--assistant {
  align-self: flex-start;
  background: var(--bg-input);
  color: var(--text-body);
  border-bottom-left-radius: var(--radius-sm);
}

/* Erro — estado discreto de aviso, não parece mensagem da IA */
.pub-chat-msg--error {
  align-self: stretch;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.4;
}

.pub-chat-msg--error svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Indicador "digitando" — ocupa o lugar da bolha da IA durante a espera */
.pub-chat-typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 12px 14px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-sm);
}

.pub-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--text-muted);
  animation: pub-chat-typing-bounce 1.2s infinite ease-in-out;
}

.pub-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.pub-chat-typing span:nth-child(3) { animation-delay: 0.4s; }

/* Cards de imóveis sugeridos pela IA — thumb + resumo + CTA "Visualizar" */
.pub-chat-prop-list {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.pub-chat-prop-card {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pub-chat-prop-card:hover {
  border-color: var(--brand-orange);
  box-shadow: var(--shadow-sm);
}

.pub-chat-prop-card__thumb {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-input);
}

.pub-chat-prop-card__thumb--empty {
  display: block;
}

.pub-chat-prop-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pub-chat-prop-card__title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--brand-navy);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pub-chat-prop-card__meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-orange);
}

.pub-chat-prop-card__desc {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pub-chat-prop-card__cta {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-orange);
}

.pub-chat-prop-card__cta::after {
  content: " →";
}

@keyframes pub-chat-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .pub-chat-typing span { animation: pub-chat-typing-fade 1.2s infinite ease-in-out; }
}

@keyframes pub-chat-typing-fade {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Consentimento LGPD — micro-texto discreto, sempre visível junto ao input.
   Não compete com as mensagens nem com o CTA de envio. */
.pub-chat-consent {
  margin: var(--space-xs) 0 0;
  padding: 0 var(--space-xs);
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
  text-align: center;
}

/* ============================================================
   FLOATING WHATSAPP BUTTON
   ============================================================ */
.floating-whatsapp {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 16px rgba(37,211,102,0.3);
  cursor: pointer;
  z-index: 200;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.floating-whatsapp:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(37,211,102,0.4); color: white; text-decoration: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .property-grid { grid-template-columns: repeat(2, 1fr); }
  
  
  
  
  .detail-content { grid-template-columns: 1fr; }
  .detail-sidebar { position: static; padding-top: 0; }
  .contact-card { position: static; }
}

@media (max-width: 768px) {
  .hero { min-height: 480px; }
  .hero h1 { font-size: 32px; }
  .hero-search { flex-direction: column; }
  
  
  .btn-search { width: 100%; justify-content: center; }
  
  .property-grid { grid-template-columns: 1fr; }
  
  
  
  
  
  
  
  .header-nav { display: none; }
  
  
  
  .footer-top { flex-direction: column; }
  
  
  .floating-whatsapp { bottom: 16px; right: 16px; width: 50px; height: 50px; }
}

/* === SITE PAGES/SHOW (app/views/public/site_pages/show.html.erb) — migrado de style block === */
/* Páginas do CMS (institucionais) — tema público é LIGHT. O cabeçalho/logo
   vem do layout (theme header); aqui só estilizamos o cartão de conteúdo. */
.page-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}
.page-content {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 48px;
  box-shadow: var(--shadow-md);
}
.page-title {
  font-size: 42px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 32px;
  font-family: 'Inter', sans-serif;
}
.page-body { color: var(--text-body); line-height: 1.8; font-size: 16px; }
.page-body p { margin-bottom: 20px; }
.page-body h2 { color: var(--text-heading); font-size: 28px; font-weight: 700; margin-top: 40px; margin-bottom: 16px; font-family: 'Inter', sans-serif; }
.page-body h3 { color: var(--text-heading); font-size: 22px; font-weight: 700; margin-top: 32px; margin-bottom: 12px; font-family: 'Inter', sans-serif; }
.page-body ul, .page-body ol { margin: 20px 0; padding-left: 24px; }
.page-body li { margin-bottom: 12px; }
.page-body a { color: var(--text-link); text-decoration: none; font-weight: 600; }
.page-body a:hover { text-decoration: underline; }
@media (max-width: 768px) {
  .page-container { padding: 24px 20px 60px; }
  .page-content { padding: 32px 24px; }
  .page-title { font-size: 32px; }
}

/* ───────────────────────────────────────────────────────────────
   Banner de consentimento (LGPD) — Google Consent Mode v2 / Meta
   ─────────────────────────────────────────────────────────────── */
.pub-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--pub-z-overlay);
  padding: var(--pub-space-md);
  background: var(--pub-bg-navy);
  color: var(--pub-text-invert);
  box-shadow: var(--pub-shadow-lg);
}
.pub-consent__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--pub-space-lg);
  flex-wrap: wrap;
}
.pub-consent__text {
  margin: 0;
  flex: 1 1 320px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--pub-text-invert-soft);
}
.pub-consent__text a {
  color: var(--pub-text-invert);
  text-decoration: underline;
}
.pub-consent__actions {
  display: flex;
  gap: var(--pub-space-sm);
  flex-shrink: 0;
}
.pub-consent__btn {
  min-height: 44px;
  padding: 0 var(--pub-space-lg);
}
@media (max-width: 640px) {
  .pub-consent__inner { flex-direction: column; align-items: stretch; }
  .pub-consent__actions { justify-content: stretch; }
  .pub-consent__btn { flex: 1; }
}
