/* ouvidoria.css — Estilos institucionais da Ouvidoria & e-SIC sobre os tokens do DETCREDE */

/* Modal Backdrop & Container com z-index seguro */
.modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1050 !important;
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(6px);
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  box-sizing: border-box;
}
.modal-overlay[hidden] {
  display: none !important;
}

.saas-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 14px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-sizing: border-box;
  color: var(--text);
  position: relative;
  z-index: 1051;
}

/* Hero Section */
.ouv-hero {
  background: radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--accent) 15%, transparent) 0%, transparent 75%);
  padding: 48px 20px 36px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.ouv-hero-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 10px 0;
  color: var(--text);
}
.ouv-hero-desc {
  font-size: 15px;
  color: var(--text-2);
  max-width: 660px;
  margin: 0 auto 28px;
  line-height: 1.55;
}

/* Caixa de Consulta de Protocolo */
.ouv-search-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 680px;
  margin: 0 auto;
  padding: 8px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  box-shadow: var(--shadow);
}
.ouv-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.ouv-search-box input::placeholder {
  color: var(--text-3);
}

/* Container do Conteúdo */
.ouv-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  width: 100%;
  box-sizing: border-box;
  flex: 1;
}

/* Grade de Cards das 6 Manifestações */
.ouv-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.ouv-type-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 14px);
  padding: 22px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.ouv-type-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong, var(--accent));
  box-shadow: var(--shadow);
}
.ouv-type-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
}
.ouv-type-card.denuncia::before { background: #a855f7; }
.ouv-type-card.reclamacao::before { background: var(--risk); }
.ouv-type-card.elogio::before { background: var(--ok); }
.ouv-type-card.sugestao::before { background: var(--warn); }
.ouv-type-card.solicitacao::before { background: var(--accent); }
.ouv-type-card.sic::before { background: #f97316; }

.ouv-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.denuncia .ouv-card-icon { background: color-mix(in srgb, #a855f7 16%, var(--surface)); color: #a855f7; }
.reclamacao .ouv-card-icon { background: var(--risk-soft); color: var(--risk); }
.elogio .ouv-card-icon { background: var(--ok-soft); color: var(--ok); }
.sugestao .ouv-card-icon { background: var(--warn-soft); color: var(--warn); }
.solicitacao .ouv-card-icon { background: var(--accent-soft); color: var(--accent); }
.sic .ouv-card-icon { background: color-mix(in srgb, #f97316 16%, var(--surface)); color: #f97316; }

.ouv-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.ouv-card-desc {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}
.ouv-card-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

/* Card de Consulta e Timeline */
.saas-card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 14px);
  padding: 24px;
  box-shadow: var(--shadow);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.status-pill.active { background: var(--ok-soft); color: var(--ok); }
.status-pill.grace { background: var(--warn-soft); color: var(--warn); }
.status-pill.expired { background: var(--risk-soft); color: var(--risk); }

.saas-badge-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: white;
}

.ouv-timeline {
  position: relative;
  padding-left: 28px;
  margin: 20px 0;
}
.ouv-timeline::before {
  content: '';
  position: absolute;
  top: 6px; bottom: 6px; left: 8px;
  width: 2px;
  background: var(--border);
}
.ouv-timeline-step {
  position: relative;
  margin-bottom: 20px;
}
.ouv-timeline-bullet {
  position: absolute;
  left: -28px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--accent);
}

.star-rating {
  display: flex;
  gap: 8px;
  font-size: 24px;
  cursor: pointer;
}
.star-rating span.active { color: #facc15; }
.star-rating span { color: var(--text-3); transition: color 0.15s; }

/* ── Regras de Adaptação para Celulares e Tablets (Ouvidoria & Transparência) ── */
@media (max-width: 768px) {
  .ouv-hero {
    padding: 24px 14px 20px;
  }
  .ouv-hero-title {
    font-size: 24px;
    line-height: 1.25;
    margin-bottom: 8px;
  }
  .ouv-hero-desc {
    font-size: 13.5px;
    margin-bottom: 18px;
    line-height: 1.5;
  }
  .ouv-search-box {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
  }
  .ouv-search-box input {
    width: 100%;
    max-width: 100% !important;
    min-height: 48px;
    font-size: 16px !important;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    box-sizing: border-box;
  }
  .ouv-search-box button {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
    justify-content: center;
  }
  .ouv-container {
    padding: 20px 12px 60px;
  }
  .ouv-types-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .ouv-card {
    padding: 18px 16px;
  }
  .modal-overlay {
    padding: 0 !important;
    align-items: stretch !important;
  }
  .saas-modal {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0 !important;
    padding: 20px 16px 40px !important;
    margin: 0 !important;
    border: none;
  }
  .saas-modal input,
  .saas-modal select,
  .saas-modal textarea {
    font-size: 16px !important;
    min-height: 48px !important;
  }
  .saas-modal .pt-row,
  .saas-modal .row {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }
  .saas-modal .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    font-size: 15px;
  }
}

/* ══ Revisão de 13/10/2026: formulário por tipo, celular, acessibilidade e consulta legível ══ */
.ouv-skip { position: absolute; left: -9999px; top: 8px; z-index: 2000; background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 8px; border: 2px solid var(--accent); }
.ouv-skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ouv-h2 { font-size: 19px; font-weight: 800; margin: 0 0 4px; color: var(--text); }
.ouv-h3 { font-size: 14.5px; font-weight: 700; margin: 16px 0 6px; color: var(--text); }
.ouv-muted { color: var(--text-2); font-size: 13.5px; line-height: 1.55; margin: 0 0 10px; }
.ouv-muted.small, .small { font-size: 12.5px; }
.ouv-pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; color: var(--text); margin: 0; }
.ouv-container > section { margin-bottom: 24px; }
.ouv-section-head { text-align: center; margin: 8px 0 16px; }
.ouv-section-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 16px; }
.ouv-logo { height: 28px; max-width: 120px; object-fit: contain; vertical-align: middle; margin-right: 6px; }
.ouv-legal { text-align: center; color: var(--text-2); font-size: 12.5px; line-height: 1.6; max-width: 820px; margin: 8px auto 32px; }
.ouv-empty { text-align: center; padding: 16px; color: var(--text-3); }
.ouv-table { max-height: 380px; overflow: auto; }
.ouv-kpis { margin-bottom: 18px; }

/* Cartões de tipo (botões de verdade: teclado e leitor de tela) */
button.ouv-type-card { font: inherit; text-align: left; color: inherit; width: 100%; }
.ouv-type-card::before { background: var(--type-color, var(--accent)); }
.ouv-type-card .ouv-card-icon { background: color-mix(in srgb, var(--type-color, var(--accent)) 14%, var(--surface)); color: var(--type-color, var(--accent)); }
.ouv-type-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ouv-card-cta { color: var(--type-color, var(--accent)); }

/* Acompanhar */
.ouv-track-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.ouv-view-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.ouv-view-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.ouv-answer { background: var(--accent-soft, color-mix(in srgb, var(--accent) 10%, var(--surface))); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; color: var(--text); }
.ouv-action { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-top: 16px; }
.ouv-action .ouv-h3 { margin-top: 0; }
.ouv-action textarea { width: 100%; margin: 6px 0 8px; box-sizing: border-box; }
ol.ouv-timeline { list-style: none; margin: 8px 0 0; }
.ouv-timeline-step { padding-left: 4px; }
.ouv-timeline-step::before { content: ""; position: absolute; left: -25px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); }
.ouv-timeline-step strong { display: block; color: var(--text); font-size: 14px; }
.ouv-timeline-step time { display: block; color: var(--text-2); font-size: 12px; margin: 2px 0 4px; }
.star-rating button { background: none; border: 0; padding: 0 2px; font-size: 28px; line-height: 1; color: var(--text-3); cursor: pointer; }
.star-rating button.active { color: #f59e0b; }
.star-rating button:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }

/* Como funciona */
.ouv-steps { margin: 8px 0 12px; padding-left: 20px; line-height: 1.6; color: var(--text); font-size: 14px; }
.ouv-steps li { margin-bottom: 6px; }
.ouv-deadlines { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.ouv-deadlines > div { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--surface-2); }
.ouv-deadlines strong { display: block; font-size: 22px; color: var(--accent); }
.ouv-deadlines span { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.ouv-list { margin: 0; padding-left: 20px; line-height: 1.6; font-size: 14px; color: var(--text); }

/* Formulário */
.ouv-modal { max-width: 720px; padding: 22px 24px; overflow-y: auto; display: block; }
.ouv-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 10px; }
.ouv-modal-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ouv-modal-title h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--text); }
.ouv-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.ouv-form .full { grid-column: 1 / -1; }
.ouv-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; }
.ouv-field > span { font-size: 12.5px; font-weight: 700; color: var(--text); }
.ouv-field .input, .ouv-field .select, .ouv-field textarea { width: 100%; box-sizing: border-box; }
.ouv-field[hidden] { display: none; }
.ouv-hint { color: var(--text-2); font-size: 12px; }
.ouv-err { color: var(--risk); font-size: 12px; }
.ouv-err:empty { display: none; }
[aria-invalid="true"] { border-color: var(--risk) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--risk) 25%, transparent); }
.ouv-ident { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); margin: 0; min-width: 0; }
.ouv-ident legend { font-size: 13px; font-weight: 700; padding: 0 4px; color: var(--text); }
.ouv-radio { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; margin: 6px 0; cursor: pointer; color: var(--text); }
.ouv-radio input { margin-top: 3px; flex: none; }
.ouv-radio[hidden] { display: none; }
.ouv-ident-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin-top: 10px; }
.ouv-ident-grid[hidden] { display: none; }
.ouv-msg { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--risk-soft, #fee2e2); color: var(--risk); font-size: 13.5px; line-height: 1.5; }
.ouv-msg.ok { background: var(--ok-soft, #dcfce7); color: var(--ok); }
.ouv-msg[hidden] { display: none; }
.ouv-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.ouv-success { max-width: 540px; text-align: center; }
.ouv-success h2 { font-size: 20px; margin: 0 0 6px; color: var(--text); }
.ouv-success-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.ouv-codes { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin: 12px 0; }
.ouv-codes dt { font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; align-self: center; }
.ouv-codes dd { margin: 0; font-size: 18px; font-weight: 800; color: var(--text); overflow-wrap: anywhere; }
.ouv-success a { overflow-wrap: anywhere; }
.ouv-success .ouv-actions { justify-content: center; }
body.ouv-modal-open { overflow: hidden; }

/* Acessibilidade */
.ouv-a11y { display: inline-flex; gap: 2px; margin-left: 6px; align-items: center; }
body.ouv-zoomed main, body.ouv-zoomed .ouv-hero, body.ouv-zoomed .saas-modal { zoom: var(--ouv-zoom, 1); }
body.ouv-contrast { --text: #000; --text-2: #111; --text-3: #222; --border: #000; --surface: #fff; --surface-2: #fff; --bg: #fff; --accent: #0033cc; }
body.ouv-contrast a { text-decoration: underline; }
body.ouv-contrast .ouv-type-card, body.ouv-contrast .saas-card-panel { border-width: 2px; }

@media (max-width: 768px) {
  .ouv-track-form, .ouv-view-grid, .ouv-deadlines, .ouv-form, .ouv-ident-grid { grid-template-columns: 1fr; }
  .ouv-track-form .btn { width: 100%; justify-content: center; min-height: 48px; }
  .ouv-modal { padding: 18px 14px 32px !important; }
  .ouv-actions { flex-direction: column-reverse; }
  .ouv-actions .btn { width: 100%; justify-content: center; }
  .ouv-a11y { margin: 8px 0 0; }
  .ouv-modal-head .btn { width: auto !important; min-height: 44px; flex: none; }
  .ouv-modal-title { flex: 1; }
  .ouv-codes { grid-template-columns: 1fr; }
}

@media print {
  .pt-bar, .ouv-hero, main, .ouv-actions, #manifest-modal, .ouv-skip { display: none !important; }
  .modal-overlay { position: static !important; background: none !important; backdrop-filter: none; }
  .saas-modal { box-shadow: none; border: 0; max-height: none; }
}

/* A consulta e as seções não ficam escondidas sob o cabeçalho fixo ao rolar. */
#protocol-view-card, #acompanhar, #manifestar, #transparencia, #como-funciona { scroll-margin-top: 84px; }
