:root {
  --oab-blue: #0f1f44;
  --oab-red: #af1f2d;
  --oab-red-bright: #d4293a;
  --bg: #0f1f44;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.1);
  --text: #f0ede8;
  --text-muted: rgba(240, 237, 232, 0.65);
  --line: rgba(255, 255, 255, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Barlow", sans-serif;
  color: var(--text);
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(175, 31, 45, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(26, 48, 104, 0.3) 0%, transparent 50%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* -- HEADER -- */
.header {
  padding: 48px 0 8px;
  text-align: center;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: #fff;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header h1 {
  font-family: "Barlow", sans-serif;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  font-weight: 300;
}

.header-sub strong {
  color: var(--text);
  font-weight: 600;
}

/* -- PILLS ROW -- */
.pills {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pill strong {
  color: var(--text);
  font-weight: 700;
}

/* -- DIVIDER -- */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--line) 50%, transparent 100%);
  margin: 10px 0 0;
}

/* -- SEARCH -- */
.search-section {
  margin-top: 12px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 40px 14px 42px;
  font-size: 0.92rem;
  font-family: "Barlow", sans-serif;
  color: var(--text);
  background: var(--surface);
  transition: all 0.2s;
}

.search-clear {
  position: absolute;
  right: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: var(--surface-hover);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0;
  transition: all 0.2s;
}

.search-clear:hover {
  background: rgba(255,255,255,0.15);
  color: var(--text);
}

.search-clear.visible { display: flex; }

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  outline: none;
  border-color: rgba(175, 31, 45, 0.5);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px rgba(175, 31, 45, 0.1);
}

/* -- CHIPS -- */
.chips {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
  position: relative;
  mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
  padding-left: 6px;
  padding-right: 6px;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  font-family: "Barlow", sans-serif;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.chip:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
  background: var(--surface);
}

.chip.active {
  color: #fff;
  background: var(--oab-red);
  border-color: var(--oab-red);
}

/* -- CARDS (accordion) -- */
.card-stack {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.convenio-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: all 0.25s ease;
  opacity: 0;
  transform: translateY(10px);
  animation: cardIn 0.4s ease forwards;
}

.convenio-card:hover {
  background: var(--surface-hover);
  border-color: rgba(255,255,255,0.14);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
  gap: 10px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: inherit;
  font-family: inherit;
}

.card-header:focus-visible {
  outline: 2px solid var(--oab-red);
  outline-offset: -2px;
  border-radius: var(--radius);
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
  background: var(--surface-hover);
  border: 1px solid var(--line);
  color: var(--text-muted);
}

.card-icon svg {
  width: 18px;
  height: 18px;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.3;
}

.card-cat {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.card-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.card-condition {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--oab-red) 0%, var(--oab-red-bright) 100%);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(175, 31, 45, 0.25);
  line-height: 1.3;
  margin-top: 2px;
}

.card-chevron {
  transition: transform 0.25s ease;
  color: var(--text-muted);
}

.convenio-card.open .card-chevron {
  transform: rotate(180deg);
}

.card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 18px;
}

.convenio-card.open .card-body {
  max-height: 500px;
  padding: 0 18px 18px;
}

.card-detail {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
  font-weight: 400;
}

.card-location {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.4;
}

.card-location svg { flex-shrink: 0; }

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: "Barlow", sans-serif;
  background: #25d366;
  color: #fff;
  border: none;
  transition: all 0.2s;
  width: 100%;
  justify-content: center;
}

.btn-whatsapp:hover {
  background: #1fb855;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
}

/* -- EMPTY -- */
.empty {
  margin-top: 24px;
  padding: 32px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* -- FOOTER -- */
.foot {
  margin-top: 40px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  letter-spacing: 0.02em;
}

@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
  .page { padding: 0 16px 48px; }
  .header { padding: 36px 0 28px; }
  .header h1 { font-size: 1.65rem; }
  .pills { gap: 6px; }
}

/* -- BANNER DESENVOLVIMENTO -- */
.dev-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  padding: 10px 16px;
  text-align: center;
  font-family: "Barlow", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: repeating-linear-gradient(
    -45deg,
    var(--oab-red),
    var(--oab-red) 10px,
    var(--oab-red-bright) 10px,
    var(--oab-red-bright) 20px
  );
}
