/* ====================================
   Customer Offers Marketplace
   ==================================== */


/* Cabeçalho da página */
.offers-page .page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-ink-night);
}

/* Barra de filtros */
.offers-filters-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  width: 100%;
  /* Espaçamento padronizado (token) entre a barra de filtros e o conteúdo abaixo. */
  margin-bottom: var(--spacing-md);
  background: var(--color-text-on-brand);
  border: 1px solid var(--color-gray-200);
  border-radius: 12px;
  padding: 0.65rem var(--spacing-sm);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.filter-field {
  display: flex;
  align-items: center;
  position: relative;
}

/* Campo de busca */
.filter-field.filter-search {
  flex: 1;
  min-width: min(100%, 18rem);
}

.filter-search-icon {
  position: absolute;
  left: 0.7rem;
  color: var(--color-gray-400);
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 1;
}

.filter-input {
  border: 1px solid var(--color-gray-200);
  border-radius: 8px;
  padding: 0.45rem 0.75rem 0.45rem var(--spacing-lg);
  font-family: var(--font-body, "Montserrat", sans-serif);
  font-size: var(--form-control-font-size, 1rem);
  font-weight: var(--form-control-font-weight, 500);
  line-height: var(--form-control-line-height, 1.5);
  color: var(--color-gray-700);
  width: 100%;
  min-height: var(--btn-height-md, 44px);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--color-neutral-50);
}

.filter-input::placeholder {
  font-family: var(--font-body, "Montserrat", sans-serif);
  font-size: var(--form-placeholder-font-size, 1rem);
  font-weight: var(--form-placeholder-font-weight, 400);
  line-height: var(--form-control-line-height, 1.5);
  color: var(--color-text-muted, var(--color-gray-500));
  opacity: 1;
}

.filter-input:focus {
  border-color: var(--color-primary, var(--color-primary));
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 109, 40, 217), 0.12);
  background: var(--color-text-on-brand);
}

/* Selects */
.filter-select {
  border: 1px solid var(--color-gray-200);
  border-radius: 8px;
  padding: 0.45rem var(--spacing-lg) 0.45rem 0.75rem;
  font-family: var(--font-body, "Montserrat", sans-serif);
  font-size: var(--form-control-font-size, 1rem);
  font-weight: var(--form-control-font-weight, 500);
  line-height: var(--form-control-line-height, 1.5);
  color: var(--color-gray-700);
  min-height: var(--btn-height-md, 44px);
  background: var(--color-neutral-50);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.filter-select:focus {
  border-color: var(--color-primary, var(--color-primary));
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 109, 40, 217), 0.12);
  background-color: var(--color-text-on-brand);
}

/* Botão limpar */
.filter-clear-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--color-gray-400);
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.filter-clear-btn:hover {
  color: var(--color-danger-500);
  background: var(--color-danger-soft-50);
}

.offers-filters-bar .filter-panel__submit {
  flex: 0 0 auto;
  min-width: 8.25rem;
}

@media (max-width: 767.98px) {
  .offers-filters-bar {
    align-items: stretch;
  }

  .offers-filters-bar > * {
    flex: 1 1 100%;
  }

  .offers-filters-bar .filter-panel__submit,
  .offers-filters-bar .filter-clear-btn {
    justify-content: center;
  }
}

/* ====================================
   Card de Oferta
   ==================================== */
.offer-card {
  background: var(--color-text-on-brand);
  border: 1px solid var(--color-gray-200);
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: box-shadow 0.25s ease;
  overflow: hidden;
}

.offer-card:hover {

  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

/* ── Header com banner ou gradiente colorido ── */
.offer-card-header {
  position: relative;
  height: 130px;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  overflow: hidden;
}

/* Overlay escuro sobre a imagem de banner */
.offer-card-header-overlay {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  z-index: 0;
}

/* Container dos elementos no header */
.offer-card-header-content {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.7rem 0.85rem 0;
}

/* Sigla grande no centro do header (sem banner) */
.offer-header-sigla {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,0.22);
  pointer-events: none;
  user-select: none;
}

/* Badge de tipo no header (branco translúcido) */
.offer-header-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28em 0.7em;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* Badge de setor no header — fundo escuro sólido para garantir leitura sobre qualquer banner */
.offer-header-badge-sector {
  background: rgba(0, 0, 0, 0.55) !important;
  color: var(--color-text-on-brand) !important;
  font-weight: 600;
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
}

/* Sobrescreve as cores para usar no header — fundo opaco no header */
.offer-card-header .badge-security-equity   { background: rgba(255,243,205,0.95); color: var(--color-warning-gold-850); }
.offer-card-header .badge-security-cri      { background: rgba(230,240,255,0.95); color: var(--color-blue-db-600); }
.offer-card-header .badge-security-cra      { background: rgba(230,255,237,0.95); color: var(--color-success-github); }
.offer-card-header .badge-security-ccb      { background: rgba(243,230,255,0.95); color: var(--color-purple-700); }
.offer-card-header .badge-security-debenture { background: rgba(255,240,230,0.95); color: var(--color-warning-orange-700); }
.offer-card-header .badge-security-outro    { background: rgba(240,240,240,0.95); color: var(--color-accent-gray-2); }

/* Contador de dias no header */
.offer-header-days {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-on-brand);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  padding: 0.3em 0.65em;
  border-radius: 20px;
}

.offer-header-days-urgent {
  background: rgba(220,53,69,0.8);
}

/* ── Corpo do card ── */
.offer-card-body {
  padding: 0.9rem 1.1rem var(--spacing-xs);
}

.offer-company-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-ink-night);
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

/* Localização + Setor lado a lado (abaixo do nome) */
.offer-location-sector {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-xs) var(--spacing-sm);
  margin-bottom: var(--spacing-xs);
}

.offer-location,
.offer-sector-inline {
  font-size: 0.75rem;
  color: var(--color-bs-gray-500);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.offer-description {
  font-size: 0.8rem;
  color: var(--color-bs-gray-500);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0;
}

/* Métricas de destaque (retorno + equity/taxa) */
.offer-metrics-top {
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem 1.1rem;
  border-top: 1px solid var(--color-neutral-150);
  background: var(--color-text-on-brand);
}

.offer-metric-highlight-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-bs-gray-100);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  flex: 1;
}

.offer-metric-big-value {
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1;
  color: var(--color-ink-night);
}

.offer-metric-big-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-gray-400);
  margin-top: 0.15rem;
}

.text-equity { color: var(--color-primary, var(--color-primary)); }

/* Box flutuante de Taxa (cards não-equity) */
.offer-metrics-top:has(.offer-taxa-box) {
  padding: 0;
  background: transparent;
  border-top: none;
}

.offer-taxa-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.65rem 0.75rem var(--spacing-xs);
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  box-sizing: border-box;
}

.offer-taxa-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-bs-gray-500);
  letter-spacing: 0.02em;
}

.offer-taxa-value {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}


/* ── Métricas secundárias ── */
/* ── Box de informações adicionais (label: valor) ── */
.offer-info-rows {
  padding: var(--spacing-xs) 1.1rem;
  border-top: 1px solid var(--color-neutral-150);
}

.offer-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--color-surface-200);
}

.offer-info-row:last-child { border-bottom: none; }

.offer-info-label {
  font-size: 0.74rem;
  color: var(--color-gray-400);
  white-space: nowrap;
  flex-shrink: 0;
}

.offer-info-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-ink-night);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Progresso de captação ── */
.offer-progress-section {
  padding: 0.55rem 1.1rem 0.65rem;
  border-top: 1px solid var(--color-neutral-150);
}

.offer-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.3rem;
}

.offer-progress-amounts {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-gray-700);
}

.offer-progress-pct {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-gray-700);
}

.offer-progress-bar-track {
  height: 6px;
  border-radius: 4px;
  background: var(--color-bs-gray-200);
  overflow: hidden;
  display: flex;
}

.offer-progress-bar-fill {
  height: 100%;
  transition: width 0.4s ease;
  min-width: 0;
}

/* Segmentos de captação */
.offer-progress-acquired {
  background: var(--color-success-bs-600);
  border-radius: 4px 0 0 4px;
}

.offer-progress-reserved {
  background: var(--color-success-bs-light);
}

.offer-progress-acquired:last-child {
  border-radius: 4px;
}

.offer-progress-reserved:last-child {
  border-radius: 0 4px 4px 0;
}

/* Legenda abaixo da barra */
.offer-progress-legend {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.3rem;
}

.offer-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  color: var(--color-gray-400);
}

.offer-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.offer-legend-acquired { background: var(--color-success-bs-600); }
.offer-legend-reserved { background: var(--color-success-bs-light); }

/* ── Rodapé ── */
.offer-card-footer {
  padding: 0.7rem 1.1rem 0.9rem;
  border-top: 1px solid var(--color-neutral-150);
}

/* Botão Ver Oferta (full width no novo layout) */
.btn-offer-primary {
  background: var(--color-primary, var(--color-primary));
  border: none;
  color: var(--color-text-on-brand);
  font-size: 0.85rem;
  font-weight: 600;
  padding: var(--spacing-xs) 1.1rem;
  border-radius: 8px;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
}

.btn-offer-primary:hover:not(:disabled) {
  box-shadow: none;
  color: var(--color-text-on-brand);
}

.btn-offer-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Responsivo ── */
@media (max-width: 575.98px) {
  .offers-page-header {
    flex-direction: column;
    align-items: stretch !important;
  }
}

/* ====================================
   Customer Offer Detail Page
   ==================================== */

.offer-detail-hero {
  border: 1px solid var(--color-gray-200);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.offer-detail-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--color-ink-night);
  margin-bottom: 0;
  line-height: 1.2;
}

.offer-detail-progress {
  height: 8px;
  border-radius: 8px;
  background: var(--color-neutral-150);
}

.offer-detail-progress .progress-bar {
  background: var(--color-primary, var(--color-primary));
  border-radius: 8px;
}

.offer-detail-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-gray-400);
  margin-bottom: 0.2rem;
}

.offer-detail-value {
  font-weight: 600;
  color: var(--color-ink-night);
  margin-bottom: 0;
  font-size: 1rem;
}

.offer-detail-value-highlight {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--color-primary, var(--color-primary));
  margin-bottom: 0;
}

.offer-invest-card {
  border: 2px solid var(--color-primary, var(--color-primary));
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(var(--primary-rgb, 109, 40, 217), 0.12);
}

/* ====================================
   Documentos (grid moderno — espelho do admin)
   ==================================== */

/* Badge de contagem no card-header */
.offer-doc-count-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-gray-500);
  background: var(--color-surface-muted);
  border: 1px solid var(--color-gray-200);
  border-radius: 20px;
  padding: 0.2rem 0.65rem;
  letter-spacing: 0.02em;
}

/* Grid de cards */
.offer-docs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

/* Card individual de documento */
.offer-doc-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.875rem;
  min-width: 0;
  min-height: 6.75rem;
  padding: 1rem;
  border: 1px solid var(--color-gray-200);
  border-radius: 10px;
  background: var(--color-text-on-brand);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.offer-doc-card:hover {
  border-color: var(--color-gray-300);
  box-shadow: var(--shadow-card);

}

/* Ícone com cor por extensão */
.offer-doc-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  flex-shrink: 0;
}

.offer-doc-icon i {
  font-size: 1.25rem;
  line-height: 1;
}

.offer-doc-ext {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* Nome do arquivo */
.offer-doc-info {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  min-width: 0;
}

.offer-doc-name {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-gray-900);
  overflow-wrap: anywhere;
}

@media (max-width: 991.98px) {
  .offer-docs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .offer-doc-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .offer-doc-download-btn {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
  }
}

/* Botão de download — usa cor primária do portal customer */
.offer-doc-download-btn {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 0.35rem;
  padding: 0.4rem 0.875rem;
  border-radius: 8px;
  background: var(--color-primary, var(--color-primary));
  color: var(--color-text-on-brand);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.offer-doc-download-btn:hover {
  /* Hover segue o tema do tenant (token), nunca cor de marca hardcoded —
     evita contaminação entre whitelabels/áreas. */
  background: var(--color-secondary, var(--color-primary, var(--color-primary)));
  color: var(--color-text-on-brand);
  text-decoration: none;
}

.offer-doc-download-btn i { font-size: 0.8rem; }

/* Estado vazio */
.offer-docs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-lg) var(--spacing-sm);
  color: var(--color-gray-400);
}

.offer-docs-empty i {
  font-size: 2.5rem;
  opacity: 0.5;
}

.offer-docs-empty span {
  font-size: 0.875rem;
  font-style: italic;
}
