/* =====================================================
   Portal Ouvidoria - Design System
   Maternidade de Campinas
   ===================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --blue:       #7C4DBC;
  --blue-dark:  #3D1A5C;
  --blue-hover: #8B5CC8;
  --blue-light: #F0E6FF;
  --cta:        #B45309;
  --cta-dark:   #92400E;
  --border:     #D8CFF0;
  --bg:         #FAF7FF;
  --white:      #ffffff;
  --text:       #1A1228;
  --muted:      #6B5C82;
  --required:   #dc2626;
  --success:    #16a34a;
  --warning:    #d97706;
  --danger:     #dc2626;
  --radius:     4px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow:     0 2px 8px rgba(0,0,0,0.10);
}

body.portal-page {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === TOPNAV === */
.portal-topnav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.portal-topnav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.portal-topnav-inner::-webkit-scrollbar { display: none; }
.portal-topnav a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  text-decoration: none;
  padding: 13px 24px;
  font-size: 13.5px;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: border-color 0.18s, background 0.18s;
}
.portal-topnav a:hover,
.portal-topnav a.pnav-active {
  border-bottom-color: var(--blue);
  background: var(--blue-light);
  text-decoration: none;
  color: var(--blue);
}
.portal-topnav a i { font-size: 14px; }

/* === BANNER === */
.portal-banner {
  background: var(--blue);
  background-image: linear-gradient(120deg, #1BADB0 0%, #3D1A5C 55%, #7C4DBC 100%);
  padding: 26px 40px;
  position: relative;
  overflow: hidden;
  min-height: 108px;
  display: flex;
  align-items: center;
}
.portal-banner::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 40%;
  height: 100%;
  background: url('../img/hero-img.png') center/cover no-repeat;
  clip-path: polygon(16% 0%, 100% 0%, 100% 100%, 0% 100%);
  opacity: 0.18;
  pointer-events: none;
}
.portal-banner-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.portal-banner h1 {
  color: white;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.portal-banner-sep {
  color: rgba(255,255,255,0.3);
  font-size: 1.3rem;
  font-weight: 200;
}
.portal-banner p {
  color: rgba(255,255,255,0.82);
  margin: 0;
  font-size: 13.5px;
}

/* === PAGE WRAPPER === */
.portal-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  flex: 1;
}

/* === SECTION CARD === */
.portal-section {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.portal-section-header {
  background: var(--blue);
  color: var(--white);
  padding: 11px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.portal-section-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  flex: 1;
}
.portal-section-header .psh-arrow { font-size: 15px; }
.pf-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.portal-section-body { padding: 18px 20px; }
.portal-section-body > p:first-child { margin-top: 0; }

/* === FORM GROUPS === */
.pf-group { margin-bottom: 14px; }
.pf-group:last-child { margin-bottom: 0; }
.pf-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--text);
  font-size: 13.5px;
}
.pf-required { color: var(--required); margin-left: 2px; }
.pf-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pf-checkbox-same {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--blue);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.pf-checkbox-same input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--blue);
  cursor: pointer;
}

/* === INPUTS === */
.pf-input,
.pf-select,
.pf-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.18s, box-shadow 0.18s;
  outline: none;
  font-family: inherit;
  display: block;
}
.pf-input::placeholder,
.pf-textarea::placeholder { color: #aab5c6; }
.pf-input:hover,
.pf-select:hover,
.pf-textarea:hover { border-color: #a0b0cc; }
.pf-input:focus,
.pf-select:focus,
.pf-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,63,122,0.10);
}
.pf-input.pf-invalid,
.pf-select.pf-invalid,
.pf-textarea.pf-invalid { border-color: var(--required); box-shadow: 0 0 0 3px rgba(220,38,38,0.08); }
.pf-textarea { min-height: 160px; resize: vertical; line-height: 1.6; padding-top: 10px; }
.pf-select {
  appearance: none;
  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='%235b6c82' 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 12px center;
  padding-right: 34px;
  height: auto;
  min-height: 38px;
}

/* === INPUT GROUP (with button) === */
.pf-input-group { display: flex; align-items: stretch; }
.pf-input-group .pf-input {
  flex: 1;
  border-radius: var(--radius) 0 0 var(--radius);
  border-right: none;
}
.pf-input-group .pf-input-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background: var(--blue);
  color: white;
  border: 1px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.18s;
}
.pf-input-group .pf-input-btn:hover { background: var(--blue-hover); }

/* === IDENTIFICAÇÃO DISPLAY (form step 1) === */
.pf-ident-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #f8fafd;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 16px 18px;
  cursor: pointer;
  transition: box-shadow 0.18s, border-color 0.18s;
}
.pf-ident-display:hover { border-color: var(--blue); box-shadow: 0 2px 10px rgba(26,63,122,0.1); }
.pf-ident-display-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.pf-ident-current-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.pf-ident-display-left strong { display: block; font-size: 14px; font-weight: 700; color: var(--text); }
.pf-ident-display-left span   { font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; display: block; }
.pf-ident-change {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; color: var(--blue);
  white-space: nowrap; flex-shrink: 0;
}
/* === MODAL IDENTIFICAÇÃO OPTIONS === */
.pf-ident-option {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pf-ident-option:hover { border-color: var(--blue); background: #f5f8fd; }
.pf-ident-option.selected { border-color: var(--blue); background: var(--blue-light); }
.pf-ident-opt-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.pf-ident-opt-text { flex: 1; }
.pf-ident-opt-text strong { display: block; font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.pf-ident-opt-text span   { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* === RADIO OPTION CARDS (legacy, kept for fallback) === */
.pf-radio-options { display: flex; flex-direction: column; gap: 8px; }
.pf-radio-row { flex-direction: row; gap: 10px; }
.pf-radio-row .pf-radio-card { flex: 1; flex-direction: column; align-items: flex-start; gap: 8px; }
.pf-radio-icon { font-size: 22px; }
.pf-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  background: #fafbfc;
}
.pf-radio-card:hover { border-color: var(--blue); background: #f5f8fd; }
.pf-radio-card input[type="radio"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  cursor: pointer;
}
.pf-radio-card.selected { border-color: var(--blue); background: var(--blue-light); }
.pf-radio-card-text strong { display: block; font-size: 13.5px; color: var(--text); font-weight: 600; }
.pf-radio-card-text span { font-size: 12.5px; color: var(--muted); line-height: 1.5; display: block; margin-top: 2px; }

/* === GRID ROWS === */
.pf-row { display: grid; gap: 12px; margin-bottom: 12px; }
.pf-row:last-child { margin-bottom: 0; }
.pf-row.col-2 { grid-template-columns: 1fr 1fr; }
.pf-row.col-3 { grid-template-columns: 1fr 1fr 1fr; }
.pf-row.col-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.pf-row.col-1-2 { grid-template-columns: 1fr 2fr; }
.pf-row.col-cep { grid-template-columns: 180px 1fr 120px 160px; }
.pf-row.col-estado { grid-template-columns: 100px 1fr 160px; }

/* === BUTTONS === */
.pf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.18s, box-shadow 0.18s, color 0.18s;
  font-family: inherit;
  line-height: 1.4;
}
.pf-btn-primary { background: var(--cta); color: white; box-shadow: 0 2px 8px rgba(212,0,106,0.22); }
.pf-btn-primary:hover { background: var(--cta-dark); color: white; text-decoration: none; }
.pf-btn-outline { background: white; color: var(--blue); border: 1px solid var(--border); }
.pf-btn-outline:hover { background: var(--blue-light); border-color: var(--blue); color: var(--blue); text-decoration: none; }

/* === HOME INTRO === */
.portal-home-intro {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 20px;
}

/* === TYPE CARDS (home page) === */
.portal-type-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 0;
}
.portal-type-grid-2 { grid-template-columns: repeat(2, 1fr); }
.portal-type-grid-3 { grid-template-columns: repeat(3, 1fr); }
.pf-type-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
  border-radius: 12px;
  padding: 20px 16px;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  border-top: 4px solid transparent;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: box-shadow 0.18s, transform 0.18s;
}
.pf-type-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.10);
  transform: translateY(-3px);
  text-decoration: none;
}
.pf-type-arrow { display: none; }
.pf-type-icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.pf-type-info { flex: 1; }
.pf-type-info strong { display: block; font-size: 15px; font-weight: 700; color: #111827; margin-bottom: 2px; }
.pf-type-info span   { font-size: 13px; color: #6b7280; line-height: 1.4; }
.pf-type-arrow { font-size: 14px; color: #9ca3af; flex-shrink: 0; }

.pf-type-reclamacao { border-top-color: #dc2626; }
.pf-type-reclamacao .pf-type-icon { background: #fef2f2; color: #dc2626; }
.pf-type-reclamacao:hover .pf-type-info strong { color: #dc2626; }

.pf-type-denuncia { border-top-color: #ea580c; }
.pf-type-denuncia .pf-type-icon { background: #fff7ed; color: #ea580c; }
.pf-type-denuncia:hover .pf-type-info strong { color: #ea580c; }

.pf-type-sugestao { border-top-color: #16a34a; }
.pf-type-sugestao .pf-type-icon { background: #f0fdf4; color: #16a34a; }
.pf-type-sugestao:hover .pf-type-info strong { color: #16a34a; }

.pf-type-elogio { border-top-color: #2563eb; }
.pf-type-elogio .pf-type-icon { background: #eff6ff; color: #2563eb; }
.pf-type-elogio:hover .pf-type-info strong { color: #2563eb; }

.pf-type-informacao { border-top-color: #0891b2; }
.pf-type-informacao .pf-type-icon { background: #ecfeff; color: #0891b2; }
.pf-type-informacao:hover .pf-type-info strong { color: #0891b2; }

/* === INFO BOX === */
.pf-info-box {
  background: #f8fafc;
  border: 1px solid #dce6f0;
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 14px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.65;
}
.pf-info-box ul { margin: 8px 0 0; padding-left: 20px; }
.pf-info-box li { margin-bottom: 5px; }
.pf-info-box strong { color: var(--text); }
.pf-info-box p { margin: 0 0 8px; }
.pf-info-box p:last-child { margin-bottom: 0; }

/* === ALERTS === */
.pf-alert {
  padding: 11px 16px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 13.5px;
  border-left: 4px solid;
  line-height: 1.55;
}
.pf-alert-success { background: #f0fdf4; border-color: #16a34a; color: #15803d; }
.pf-alert-danger  { background: #fef2f2; border-color: #dc2626; color: #991b1b; }
.pf-alert-warning { background: #fffbeb; border-color: #d97706; color: #92400e; }
.pf-alert-info    { background: #eff6ff; border-color: var(--blue); color: var(--blue-dark); }

/* === FIELD ERROR === */
.pf-field-error { display: none; font-size: 12px; color: var(--required); margin-top: 4px; }
.pf-field-error.visible { display: block; }

/* === FOOTER === */
.portal-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: auto;
}
.portal-footer a { color: var(--blue); text-decoration: none; }
.portal-footer p { margin: 3px 0; }

/* === DETAIL GRID (consulta result) === */
.pf-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}
.pf-detail-item {
  padding: 14px 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.pf-detail-item:nth-child(3n) { border-right: none; }
.pf-detail-item:nth-last-child(-n+3) { border-bottom: none; }
.pf-detail-label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.pf-detail-value { font-size: 14px; font-weight: 600; color: #111827; }

/* === FAQ === */
.pf-faq-hero {
  text-align: center;
  padding: 28px 20px 24px;
  margin-bottom: 8px;
}
.pf-faq-hero h2 { font-size: 1.5rem; color: var(--blue); margin: 0 0 6px; font-weight: 700; }
.pf-faq-hero p  { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.pf-faq-search {
  display: flex;
  align-items: center;
  max-width: 500px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 4px 8px 4px 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}
.pf-faq-search-icon { color: var(--muted); font-size: 15px; margin-right: 6px; flex-shrink: 0; }
.pf-faq-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  background: transparent;
  padding: 7px 0;
}
.pf-faq-item {
  border-bottom: 1px solid var(--border);
  padding: 13px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: background 0.15s;
}
.pf-faq-item:last-of-type { border-bottom: none; }
.pf-faq-item:hover { background: #f8fafd; }
.pf-faq-item-title { font-size: 13.5px; color: var(--blue); font-weight: 500; flex: 1; }
.pf-faq-item-body {
  display: none;
  padding: 12px 16px 16px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.7;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.pf-faq-item-body.open { display: block; }
.pf-faq-toggle { color: var(--blue); font-size: 15px; flex-shrink: 0; transition: transform 0.2s; }
.pf-faq-item.open .pf-faq-toggle { transform: rotate(180deg); }

/* === CONSULTA PAGE === */
.pf-consulta-hero {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  padding: 20px 0 10px;
}
.pf-consulta-icon {
  width: 64px; height: 64px;
  background: var(--blue-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--blue);
  margin: 0 auto 18px;
}
.pf-consulta-hero h2 { font-size: 1.5rem; color: var(--text); margin: 0 0 8px; font-weight: 700; }
.pf-consulta-hero > p { color: var(--muted); font-size: 14px; margin: 0 0 24px; line-height: 1.6; }
.pf-consulta-form { width: 100%; }
.pf-consulta-input-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 6px 6px 6px 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: border-color 0.2s;
}
.pf-consulta-input-wrap:focus-within { border-color: var(--blue); }
.pf-consulta-input-icon { color: var(--muted); font-size: 16px; flex-shrink: 0; margin-right: 10px; }
.pf-consulta-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  background: transparent;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text);
}
.pf-consulta-input::placeholder { font-weight: 400; letter-spacing: 0; color: #adb5bd; }
.pf-consulta-btn {
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.18s;
}
.pf-consulta-btn:hover { background: var(--blue-hover); }
.pf-consulta-hint {
  margin: 18px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* === SUCCESS PAGE === */
.pf-protocol-box {
  text-align: center;
  padding: 22px 24px;
  border: 2px dashed var(--blue);
  border-radius: 8px;
  margin: 20px auto;
  background: var(--blue-light);
  max-width: 340px;
}
.pf-protocol-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue-dark);
  letter-spacing: 4px;
}

/* === PRELOADER === */
#pf-preloader {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.82);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
}
.pf-spin {
  width: 44px; height: 44px;
  border: 4px solid #dce6f0;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: pfSpin 0.8s linear infinite;
}
@keyframes pfSpin { to { transform: rotate(360deg); } }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .portal-banner { padding: 20px 18px; }
  .portal-banner h1 { font-size: 1.15rem; white-space: normal; }
  .portal-banner-sep { display: none; }
  .portal-banner-symbol { height: 30px; }
  .portal-banner::after { width: 0; }
  .portal-wrapper { padding: 16px 12px 32px; }
  .portal-section-body { padding: 14px 14px; }
  .pf-row.col-2,
  .pf-row.col-3,
  .pf-row.col-4,
  .pf-row.col-1-2,
  .pf-row.col-cep,
  .pf-row.col-estado { grid-template-columns: 1fr; }
  .portal-type-grid { grid-template-columns: repeat(3, 1fr); }
  .portal-type-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .portal-type-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .pf-radio-row { flex-direction: column; }
  .pf-type-card { padding: 14px 16px; }
  .pf-type-icon { width: 40px; height: 40px; font-size: 17px; }
  .pf-detail-grid { grid-template-columns: 1fr 1fr; }
  .pf-detail-item:nth-child(3n) { border-right: 1px solid var(--border); }
  .pf-detail-item:nth-child(2n) { border-right: none; }
  .portal-banner h1 { white-space: normal; font-size: 1.3rem; }
  .portal-banner-sep { display: none; }
}
@media (max-width: 480px) {
  .portal-topnav a { padding: 11px 14px; font-size: 12px; }
  .portal-type-grid,
  .portal-type-grid-2,
  .portal-type-grid-3 { grid-template-columns: 1fr 1fr; }
}
