/* ═══════════════════════════════════════════════
   Open House — Visitor Notes & Broker Feedback
   Mobile-first, print-optimized
   ═══════════════════════════════════════════════ */

/* ─── Shared ────────────────────────────────── */
.oh-visitor-page,
.oh-broker-page {
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 80px;
}

.oh-hero {
  position: relative;
  height: 240px;
  background-size: cover;
  background-position: center;
  border-radius: 0 0 16px 16px;
  overflow: hidden;
}

.oh-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 30%, rgba(0,0,0,0.7));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  color: #fff;
}

.oh-hero-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.oh-hero-subtitle {
  margin: 4px 0 0;
  font-size: 15px;
  opacity: 0.9;
}

.oh-hero-price {
  margin: 8px 0 0;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.oh-header {
  padding: 24px;
  text-align: center;
}

.oh-header h1 {
  margin: 0;
  font-size: 24px;
  color: var(--color-primary);
}

.oh-header p {
  margin: 4px 0;
  color: #666;
}

/* ─── Form Elements ─────────────────────────── */
.oh-notes-container,
.oh-feedback-container {
  padding: 0 20px;
}

.oh-section {
  margin: 24px 0;
}

.oh-section h2 {
  font-size: 18px;
  margin: 0 0 8px;
  color: var(--color-primary);
}

.oh-section h3 {
  font-size: 16px;
  margin: 0 0 8px;
  color: #333;
}

.oh-section-desc {
  font-size: 14px;
  color: #666;
  margin: 0 0 16px;
}

.oh-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.oh-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.oh-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  margin-bottom: 8px;
  box-sizing: border-box;
}

.oh-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.oh-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  cursor: pointer;
  padding: 8px 0;
}

.oh-checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--color-primary);
}

/* ─── Star Ratings ──────────────────────────── */
.oh-star-rating {
  display: flex;
  gap: 4px;
}

.oh-star {
  font-size: 32px;
  cursor: pointer;
  color: #ddd;
  transition: color 0.15s;
  user-select: none;
  -webkit-user-select: none;
}

.oh-star.active,
.oh-star.hover {
  color: var(--color-accent);
}

/* ─── Radio Group ───────────────────────────── */
.oh-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.oh-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.oh-radio:has(input:checked) {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.oh-radio input[type="radio"] {
  display: none;
}

/* ─── Buttons ───────────────────────────────── */
.oh-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.oh-btn {
  flex: 1;
  padding: 14px 24px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.oh-btn-save,
.oh-btn-submit {
  background: var(--color-primary);
  color: #fff;
}

.oh-btn-save:hover,
.oh-btn-submit:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

.oh-btn-email {
  background: var(--color-success, #16a34a);
  color: #fff;
}

.oh-btn-email:hover {
  background: var(--color-success-hover, #15803d);
  transform: translateY(-1px);
}

.oh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ─── Status Messages ───────────────────────── */
.oh-status {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

.oh-status.success {
  background: #dcfce7;
  color: #166534;
}

.oh-status.error {
  background: #fef2f2;
  color: #991b1b;
}

/* ─── Footer ────────────────────────────────── */
.oh-footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: #999;
}

/* ─── Capture Section ───────────────────────── */
.oh-capture-section {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
}

.oh-capture-desc {
  font-size: 14px;
  color: #666;
  margin: 0 0 12px;
}

.oh-tcpa-text {
  font-size: 11px;
  color: #999;
  margin: 8px 0 12px;
  line-height: 1.4;
}

.oh-consent-section {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
}
.oh-consent-section .oh-checkbox-label {
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
}
.oh-tcpa {
  font-size: 11px;
  color: #777;
  margin: 8px 0 0;
  line-height: 1.4;
}

/* Brokerage autocomplete — same shape as the agent search dropdown. */
.oh-brokerage-search-wrap { position: relative; }
.oh-brokerage-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  max-height: 240px;
  overflow-y: auto;
  z-index: 20;
}
.oh-brokerage-dropdown-item {
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}
.oh-brokerage-dropdown-item:last-child { border-bottom: none; }
.oh-brokerage-dropdown-item:hover { background: #f8fafc; }
.oh-brokerage-dropdown-item-other {
  color: #012169;
  font-style: italic;
}

.oh-btn-text {
  background: var(--color-info, #2563eb);
  color: #fff;
}

.oh-btn-text:hover {
  background: var(--color-info-hover, #1d4ed8);
  transform: translateY(-1px);
}

/* ─── Sponsor Card ──────────────────────────── */
.oh-sponsor-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  margin: 16px 0 8px;
}

.oh-sponsor-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.oh-sponsor-info {
  flex: 1;
}

.oh-sponsor-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
}

.oh-sponsor-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-primary);
}

.oh-sponsor-company {
  font-size: 13px;
  color: #555;
}

.oh-sponsor-nmls {
  font-size: 11px;
  color: #999;
}

/* ─── Property Stats Bar ────────────────────── */
.oh-property-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.oh-stat {
  text-align: center;
}

.oh-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
}

.oh-stat-label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── Rating Grid (Pill Style) ──────────────── */
.oh-rating-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.oh-rating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.oh-rating-label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  min-width: 140px;
  flex-shrink: 0;
}

.oh-rating-options {
  display: flex;
  gap: 6px;
}

.oh-pill {
  cursor: pointer;
  display: inline-block;
}

.oh-pill input[type="radio"] {
  display: none;
}

.oh-pill span {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  color: #555;
  background: #fff;
}

.oh-pill:hover span {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.oh-pill input:checked + span {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ─── Field Labels ──────────────────────────── */
.oh-field-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin: 16px 0 6px;
}

.oh-field-label:first-child {
  margin-top: 0;
}

.oh-input-row {
  display: flex;
  gap: 16px;
}

.oh-input-group {
  flex: 1;
}

.oh-input-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
}

/* ─── Agent Autocomplete ────────────────────── */
.oh-agent-search-wrap {
  position: relative;
}

.oh-agent-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
}

.oh-agent-option {
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
}

.oh-agent-option:hover {
  background: #f0f9ff;
}

.oh-agent-option:last-child {
  border-bottom: none;
}

.oh-agent-brokerage {
  font-size: 12px;
  color: #888;
  margin-left: 8px;
}

/* ─── Photo Upload ──────────────────────────── */
.oh-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.oh-photo-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
}

.oh-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.oh-photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.oh-btn-outline {
  background: #fff;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  text-align: center;
  cursor: pointer;
  flex: 0;
  padding: 10px 20px;
}

.oh-btn-outline:hover {
  background: #f0f5ff;
}

/* ─── Comps Grid ────────────────────────────── */
.oh-comps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.oh-comp-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.oh-comp-photo {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.oh-comp-info {
  padding: 10px;
}

.oh-comp-addr {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.oh-comp-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 14px;
}

.oh-comp-status {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
}

.oh-comp-details {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

/* ─── Mobile adjustments for broker form ────── */
@media (max-width: 600px) {
  .oh-rating-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .oh-rating-options {
    flex-wrap: wrap;
  }

  .oh-property-stats {
    gap: 12px;
    padding: 16px;
  }

  .oh-stat-value {
    font-size: 17px;
  }

  .oh-comps-grid {
    grid-template-columns: 1fr;
  }

  .oh-input-row {
    flex-direction: column;
    gap: 0;
  }
}

/* ═══════════════════════════════════════════════
   Seller Report — Print-optimized
   ═══════════════════════════════════════════════ */

.seller-report {
  max-width: 800px;
  margin: 0 auto;
}

.report-cover-photo {
  position: relative;
  height: 360px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.report-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 20%, rgba(1, 33, 105, 0.85));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px;
  color: #fff;
}

.report-brand {
  margin-bottom: 16px;
}

.report-logo {
  height: 40px;
}

.report-cover-title {
  font-size: 36px;
  margin: 0;
  font-weight: 700;
}

.report-cover-address {
  font-size: 22px;
  margin: 8px 0 0;
}

.report-cover-city {
  font-size: 16px;
  margin: 4px 0 0;
  opacity: 0.8;
}

.report-cover-plain {
  padding: 60px 40px;
  background: var(--color-primary);
  color: #fff;
  text-align: center;
}

.report-cover-plain h1 {
  font-size: 36px;
  margin: 0 0 8px;
}

.report-body {
  padding: 40px;
}

.report-section {
  margin-bottom: 40px;
  page-break-inside: avoid;
}

.report-section h2 {
  font-size: 22px;
  color: var(--color-primary);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
}

.report-section h3 {
  font-size: 16px;
  color: #333;
  margin: 24px 0 12px;
}

.report-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 15px;
}

.report-stats-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.report-stat {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 16px;
  background: #f8fafc;
  border-radius: 12px;
}

.report-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
}

.report-stat-value span {
  font-size: 16px;
  font-weight: 400;
  color: #999;
}

.report-stat-label {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

.report-price-dist {
  margin-top: 16px;
}

.report-price-bar {
  display: flex;
  height: 24px;
  border-radius: 12px;
  overflow: hidden;
  gap: 2px;
}

.report-price-segment {
  min-width: 4px;
  transition: flex 0.3s;
}

.report-price-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
}

.report-feedback-grid {
  display: grid;
  gap: 16px;
}

.report-feedback-card {
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  page-break-inside: avoid;
}

.report-feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.report-feedback-company {
  font-size: 13px;
  color: #888;
}

.report-rating {
  color: var(--color-accent);
  margin-bottom: 4px;
}

.report-comment {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
}

.report-footer {
  text-align: center;
  padding: 40px;
  font-size: 14px;
  color: #888;
  border-top: 1px solid #e2e8f0;
}

/* ─── Print Styles ──────────────────────────── */
@media print {
  .seller-report {
    max-width: none;
  }

  .report-cover-photo {
    height: 300px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-cover-overlay,
  .report-cover-plain {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-body {
    padding: 24px;
  }

  .report-stat {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-price-segment {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ─── Mobile ────────────────────────────────── */
@media (max-width: 600px) {
  .report-body {
    padding: 20px;
  }

  .report-cover-title {
    font-size: 28px;
  }

  .report-details-grid {
    grid-template-columns: 1fr;
  }

  .report-stats-row {
    flex-direction: column;
  }
}

/* ────────────────────────────────────────────────────────────────
   Print — visitor survey, single page, no breaks
   ──────────────────────────────────────────────────────────────── */
@media print {
  @page {
    size: letter portrait;
    margin: 0.4in;
  }

  html, body {
    background: #fff !important;
    color: #000;
    font-size: 10pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Page chrome — nav, footer, modal hosts, hydration islands, etc. */
  header, footer,
  .site-header, .site-footer,
  kpdd-toast-host, kpdd-modal-host, kpdd-message-modal,
  .smart-cta, .smart-cta-bar { display: none !important; }

  /* The visitor / broker pages themselves */
  .oh-visitor-page,
  .oh-broker-page {
    max-width: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  /* Hero — keep address visible but kill the background image so it
     prints fast and ink-light. */
  .oh-hero {
    background-image: none !important;
    background: #f3f4f6 !important;
    color: #000 !important;
    padding: 8pt 12pt;
    page-break-after: avoid;
  }
  .oh-hero-overlay { background: none !important; }
  .oh-hero-title, .oh-hero-subtitle, .oh-hero-price { color: #000 !important; text-shadow: none !important; }
  .oh-hero-title { font-size: 14pt; margin: 0 0 2pt; }
  .oh-hero-subtitle { font-size: 10pt; margin: 0; }
  .oh-hero-price { font-size: 11pt; font-weight: 600; margin: 2pt 0 0; }

  .oh-header { padding: 6pt 0; page-break-after: avoid; }
  .oh-header h1 { font-size: 14pt; margin: 0 0 2pt; }
  .oh-header p { font-size: 10pt; margin: 0; }

  /* Tighten the property stats row */
  .oh-property-stats {
    gap: 8pt;
    padding: 4pt 0;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    margin: 6pt 0;
    page-break-inside: avoid;
  }
  .oh-stat-value { font-size: 11pt; }
  .oh-stat-label { font-size: 8pt; }

  /* Don't let sections split across pages */
  .oh-section,
  .oh-rating-grid,
  .oh-rating-row,
  .oh-question,
  .oh-actions,
  .oh-capture-section,
  .oh-consent-section,
  .oh-tcpa-text,
  .oh-tcpa,
  .oh-comp-card,
  .oh-footer {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .oh-section { margin: 6pt 0; padding: 0; }
  .oh-section h2 { font-size: 10pt; margin: 0 0 3pt; }
  .oh-section-desc { font-size: 9pt; margin: 0 0 4pt; }

  /* Show write-on lines for paper-fill ratings + textareas */
  .oh-rating-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4pt 12pt;
  }
  .oh-textarea {
    min-height: 36pt;
    border: 1px solid #999 !important;
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
  }
  .oh-input {
    border: none !important;
    border-bottom: 1px solid #999 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    padding: 2pt 0 !important;
  }

  /* Drop interactive-only chrome */
  .oh-btn,
  .oh-photo-add,
  .oh-photo-grid,
  .oh-status,
  .oh-actions,
  .oh-capture-section > h2,
  .oh-capture-section .oh-capture-desc { display: none !important; }

  /* Show the contact-info fields (normally toggled by JS after save) so
     the printed page has somewhere to write name/phone/email. */
  .oh-capture-section { display: block !important; margin-top: 6pt; }
  .oh-capture-section input[type="text"],
  .oh-capture-section input[type="tel"],
  .oh-capture-section input[type="email"] { display: block !important; margin: 2pt 0; }

  /* TCPA + footer — small, single line where possible */
  .oh-tcpa-text,
  .oh-tcpa { font-size: 7pt; margin: 4pt 0 2pt; line-height: 1.25; }
  .oh-footer { font-size: 8pt; text-align: center; margin: 4pt 0 0; }
  .oh-footer p { margin: 0; }

  /* Broker survey only — autocomplete dropdowns are interactive chrome,
     comp cards are reference material that should stay together. */
  .oh-agent-dropdown,
  .oh-brokerage-dropdown { display: none !important; }

  .oh-comps-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6pt;
  }
  .oh-comp-card {
    border: 1px solid #ccc;
    padding: 4pt;
    font-size: 9pt;
  }
  .oh-comp-photo { display: none !important; }
}
