:root {
  --brand: #9e1b1b;
  --brand-dark: #6f1010;
  --brand-soft: #f7eaea;
  --ink: #1c1917;
  --muted: #57534e;
  --line: rgba(28, 25, 23, 0.1);
  --surface: rgba(255, 252, 249, 0.92);
  --surface-solid: #fffdfb;
  --shadow: 0 18px 50px rgba(48, 18, 18, 0.14);
  --radius: 1.25rem;
  --font-sans: "Manrope", system-ui, sans-serif;
  --font-display: "Source Serif 4", Georgia, serif;
  --header-offset: 0px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  color: var(--ink);
  background: #f3ebe4;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(158, 27, 27, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(180, 83, 9, 0.12), transparent 50%),
    linear-gradient(165deg, #f8f1ea 0%, #efe4da 42%, #e8d5cb 100%);
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(110, 40, 40, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 40, 40, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 85%);
}

.site-header {
  padding: 1.25rem 0 0.5rem;
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.brand-banner {
  width: min(100%, 34rem);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(80, 20, 20, 0.12));
  animation: rise-in 0.7s ease both;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  animation: rise-in 0.8s ease 0.08s both;
}

.brand-icon {
  width: 4.25rem;
  height: 4.25rem;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text {
  text-align: left;
}

.brand-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-title {
  margin: 0.1rem 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 5vw, 2.45rem);
  font-weight: 700;
  line-height: 1;
  color: var(--brand);
  letter-spacing: -0.02em;
}

.brand-subtitle {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.site-main {
  flex: 1;
  padding: 0.75rem 0 2.5rem;
}

.lookup-panel {
  position: relative;
  margin: 0 auto 1.5rem;
  max-width: 34rem;
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
  overflow: hidden;
  animation: rise-in 0.75s ease 0.12s both;
}

.lookup-panel__glow {
  position: absolute;
  inset: auto -20% -40% -20%;
  height: 55%;
  background: radial-gradient(circle at 50% 0%, rgba(158, 27, 27, 0.16), transparent 65%);
  pointer-events: none;
}

.lookup-panel__body {
  position: relative;
  padding: 1.5rem 1.25rem 1.4rem;
}

.lookup-intro {
  margin-bottom: 1.25rem;
}

.lookup-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.lookup-intro h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lookup-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.lookup-form .form-label {
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.45rem;
}

.lookup-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.lookup-input-group {
  flex: 1;
  min-width: 0;
  border-radius: 0.7rem;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow 0.2s ease;
}

.lookup-input-group:focus-within {
  box-shadow: 0 0 0 2px var(--brand);
}

.lookup-input-group .input-group-text {
  background: #fff;
  border: 0;
  color: var(--brand);
  padding-inline: 0.75rem;
  font-size: 1rem;
}

.lookup-input-group .form-control {
  border: 0;
  background: #fff;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding-block: 0.55rem;
  font-size: 0.95rem;
}

.lookup-input-group .form-control:focus {
  box-shadow: none;
}

.form-hint {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.btn-brand {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-active-border-color: var(--brand-dark);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: #b36a6a;
  --bs-btn-disabled-border-color: #b36a6a;
  width: 100%;
  border-radius: 0.7rem;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.25rem;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 8px 18px rgba(158, 27, 27, 0.22);
}

.btn-brand:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(111, 16, 16, 0.28);
}

.btn-brand:active {
  transform: translateY(0);
}

.info-section {
  max-width: 46rem;
  margin: 0 auto 1.5rem;
  animation: rise-in 0.8s ease 0.18s both;
}

.convenios-accordion .accordion-item {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 1rem !important;
  margin-bottom: 0.75rem;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(48, 18, 18, 0.06);
}

.convenios-accordion .accordion-button {
  background: var(--surface-solid);
  color: var(--ink);
  font-weight: 600;
  box-shadow: none !important;
  padding: 1rem 1.1rem;
}

.convenios-accordion .accordion-button:not(.collapsed) {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.convenios-accordion .accordion-button::after {
  background-size: 1rem;
  width: 1rem;
  height: 1rem;
}

.accordion-lead {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-align: left;
}

.accordion-lead strong {
  display: block;
  font-size: 1rem;
  line-height: 1.2;
}

.accordion-lead small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.accordion-logo {
  width: 3rem;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.accordion-logo--tall {
  width: 3.4rem;
}

.accordion-body {
  padding: 0 1.1rem 1.15rem;
}

.info-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.92rem;
}

.info-link:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.doc-frame-wrap {
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f8f5f2;
}

.doc-frame {
  display: block;
  width: 100%;
  height: min(55vh, 22rem);
  border: 0;
  background: #fff;
}

.result-slot:not(:empty) {
  max-width: 46rem;
  margin: 0 auto 1.5rem;
  animation: rise-in 0.45s ease both;
}

.site-footer {
  margin-top: auto;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: rgba(255, 255, 255, 0.92);
  padding: 0.85rem 0 calc(0.85rem + env(safe-area-inset-bottom));
}

.footer-grid {
  display: grid;
  gap: 0.65rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.footer-brand strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.footer-brand span {
  font-size: 0.78rem;
  opacity: 0.85;
}

.footer-contacts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.footer-contacts li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.8rem;
  line-height: 1.3;
}

.footer-contacts i {
  margin-top: 0.15rem;
  opacity: 0.9;
}

.footer-contacts a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.footer-contacts a:hover {
  text-decoration: underline;
}

.footer-address span {
  opacity: 0.92;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  .site-header {
    padding-top: 1.5rem;
  }

  .lookup-panel {
    max-width: 28rem;
  }

  .lookup-panel__body {
    padding: 1.35rem 1.4rem 1.25rem;
  }

  .lookup-intro {
    margin-bottom: 1rem;
  }

  .lookup-intro h2 {
    font-size: 1.4rem;
  }

  .lookup-input-group .form-control {
    padding-block: 0.45rem;
    font-size: 0.9rem;
  }

  .lookup-input-group .input-group-text {
    padding-inline: 0.65rem;
    font-size: 0.95rem;
  }

  .lookup-row {
    flex-direction: row;
    align-items: stretch;
    gap: 0.5rem;
  }

  .btn-brand {
    width: auto;
    flex-shrink: 0;
    padding: 0.45rem 1.1rem;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(158, 27, 27, 0.18);
  }

  .btn-brand:hover {
    box-shadow: 0 6px 14px rgba(111, 16, 16, 0.22);
  }

  .site-footer {
    padding: 0.65rem 0;
  }

  .footer-grid {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 1.5rem;
  }

  .footer-contacts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.25rem;
    row-gap: 0.2rem;
  }

  .footer-address {
    grid-column: 1 / -1;
  }

  .footer-contacts li {
    font-size: 0.78rem;
  }

  .doc-frame {
    height: 24rem;
  }
}

@media (max-width: 575.98px) {
  .brand-mark {
    width: 100%;
    justify-content: flex-start;
    padding-inline: 0.25rem;
  }

  .brand-icon {
    width: 3.6rem;
    height: 3.6rem;
  }

  .lookup-panel,
  .convenios-accordion .accordion-item {
    border-radius: 1rem;
  }

  .lookup-input-group .form-control {
    padding-block: 0.7rem;
  }

  .btn-brand {
    width: 100%;
    padding-block: 0.7rem;
  }

  .container {
    padding-inline: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
