:root {
  --azul: #1a56db;
  --azul-escuro: #123a91;
  --azul-claro: #eef3ff;
  --verde: #16a34a;
  --verde-bg: #dcfce7;
  --vermelho: #dc2626;
  --vermelho-bg: #fee2e2;
  --cinza: #f4f6f9;
  --texto: #1f2937;
  --muted: #64748b;
  --borda: #e5e9f0;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 8px 24px rgba(18, 58, 145, .08);
  --shadow-lg: 0 20px 48px rgba(18, 58, 145, .14);
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: var(--cinza);
  color: var(--texto);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

::selection { background: var(--azul); color: #fff; }

a { color: inherit; }
img { max-width: 100%; }

h1, h2, h3, h4 {
  font-family: 'Manrope', 'Inter', 'Segoe UI', Arial, sans-serif;
  letter-spacing: -0.01em;
}

a, button, .card, .btn, .horario-opt span, .nav-toggle span {
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease),
              transform .18s var(--ease), box-shadow .18s var(--ease), opacity .18s var(--ease);
}

:focus-visible {
  outline: 2px solid var(--azul);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  padding: 16px 28px;
  border-bottom: 1px solid var(--borda);
  position: sticky;
  top: 0;
  z-index: 40;
}
.logo {
  font-family: 'Manrope', sans-serif;
  font-size: 23px;
  font-weight: 800;
  color: var(--azul-escuro);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo span { color: var(--azul); }
.logo-img { display: block; height: 44px; width: auto; }
@media (max-width: 780px) { .logo-img { height: 38px; } }

.topbar nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar nav a {
  padding: 9px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--texto);
  font-weight: 600;
  font-size: 14px;
}
.topbar nav a:hover { background: var(--azul-claro); color: var(--azul-escuro); }
.topbar nav a.nav-cta {
  background: var(--azul);
  color: #fff;
  margin-left: 8px;
}
.topbar nav a.nav-cta:hover { background: var(--azul-escuro); color: #fff; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--borda);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--texto); margin: 0 auto; border-radius: 2px; }

@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  .topbar nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px 16px;
    border-bottom: 1px solid var(--borda);
    box-shadow: var(--shadow);
    gap: 2px;
  }
  .topbar nav.is-open { display: flex; }
  .topbar nav a { padding: 12px 14px; }
  .topbar nav a.nav-cta { margin-left: 0; text-align: center; }
}

/* ---------- layout ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 28px 16px 64px; transition: opacity .14s ease; }
.container.pagina-saindo { opacity: 0; }

.hero {
  background: linear-gradient(135deg, var(--azul), var(--azul-escuro) 120%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%);
  pointer-events: none;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(24px, 4vw, 32px); font-weight: 800; }
.hero p { margin: 0; opacity: .92; font-size: 15.5px; max-width: 520px; }

.search-form {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px;
  margin: -22px 4px 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: var(--sticky-top, 76px);
  z-index: 30;
  border: 1px solid transparent;
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.search-form.is-stuck {
  box-shadow: 0 16px 32px rgba(18, 58, 145, .18);
  border-color: var(--borda);
}
@media (max-width: 780px) {
  .search-form { position: static; }
}
.search-form select, .search-form input, .search-form button {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--borda);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.search-form select:focus, .search-form input:focus { border-color: var(--azul); }
.search-form button {
  background: var(--azul);
  color: #fff;
  border: none;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
  min-width: 140px;
  box-shadow: var(--shadow-sm);
}
.search-form button:hover { background: var(--azul-escuro); transform: translateY(-1px); }

/* ---------- cards / grid ---------- */
@keyframes cardEntrada {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-top: 24px; }
.grid .card {
  animation: cardEntrada .5s var(--ease) both;
  animation-delay: calc(var(--card-index, 0) * 60ms);
}
.grid .card:nth-child(1) { --card-index: 1; }
.grid .card:nth-child(2) { --card-index: 2; }
.grid .card:nth-child(3) { --card-index: 3; }
.grid .card:nth-child(4) { --card-index: 4; }
.grid .card:nth-child(5) { --card-index: 5; }
.grid .card:nth-child(6) { --card-index: 6; }
.grid .card:nth-child(7) { --card-index: 7; }
.grid .card:nth-child(8) { --card-index: 8; }
.grid .card:nth-child(n+9) { --card-index: 9; }
.card {
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}
.grid .card:hover {
  transform: translateY(-6px) scale(1.012);
  box-shadow: var(--shadow-lg);
  border-color: #d7deeb;
}
.card h3 { margin: 0; font-size: 17px; font-weight: 700; }
.card-banner {
  position: relative;
  height: 170px;
  width: 100%;
  background: linear-gradient(135deg, #dbeafe, #e0e7ff);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  transition: background-size .5s var(--ease);
}
.grid .card:hover .card-banner { background-size: 112%; }
.card-logo {
  transition: transform .28s var(--ease), box-shadow .28s var(--ease);
}
.grid .card:hover .card-logo { transform: translateY(-50%) scale(1.06); box-shadow: var(--shadow); }
.card-body {
  padding: 14px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--azul);
  margin: 0 0 2px;
}
.card-local { color: var(--muted); font-size: 14px; margin: 0; }
.preco-sub { color: var(--muted); font-size: 12px; margin: -2px 0 6px; }
.card-logo {
  position: absolute;
  left: 18px;
  top: 100%;
  transform: translateY(-50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: var(--shadow-sm);
  background: #fff;
  z-index: 2;
}
.card-logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--azul);
  color: #fff;
  font-weight: 800;
  font-size: 22px;
}
.card-banner-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--azul-escuro);
  opacity: .45;
  font-weight: 800;
  font-size: 48px;
  font-family: 'Manrope', sans-serif;
}

/* ---------- perfil / detalhe ---------- */
.perfil-layout {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 32px;
  align-items: start;
}
.badges-row { display: flex; gap: 8px; flex-wrap: wrap; }
.badge-ok { background: var(--verde-bg); color: #166534; }
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 22px;
}
.info-box {
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.info-box h4 {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  font-family: inherit;
  font-weight: 700;
}
.info-box p { margin: 0; font-size: 14px; color: var(--texto); }

.agendador-card {
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky;
  top: 88px;
  box-shadow: var(--shadow-sm);
}
.agendador-card label { display: block; margin: 4px 0 6px; font-weight: 600; font-size: 13px; }
.agendador-card select,
.agendador-card input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--borda);
  font-size: 14px;
  font-family: inherit;
}
.horarios-scroll {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--borda);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.horario-opt { display: block; cursor: pointer; }
.horario-opt input { position: absolute; opacity: 0; pointer-events: none; }
.horario-opt span {
  display: block;
  text-align: center;
  padding: 9px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--borda);
  font-size: 13px;
  color: #374151;
}
.horario-opt span:hover { border-color: var(--azul); }
.horario-opt input:checked + span {
  background: var(--azul);
  border-color: var(--azul);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.preco-final-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--azul-claro);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 14px 0;
  font-size: 14px;
  color: #4b5563;
}
.preco-final-row strong { color: var(--azul-escuro); font-size: 16px; }
@media (max-width: 820px) {
  .perfil-layout { grid-template-columns: 1fr; }
  .agendador-card { position: static; }
  .info-grid { grid-template-columns: 1fr; }
}

/* ---------- badges / preco / nota ---------- */
.badge {
  display: inline-block;
  background: var(--azul-claro);
  color: var(--azul-escuro);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
}
.preco { font-size: 21px; font-weight: 800; color: var(--azul-escuro); margin-top: 4px; font-family: 'Manrope', sans-serif; }
.nota { color: #d97706; font-weight: 700; font-size: 14px; }

/* ---------- buttons ---------- */
.btn-full { display: block; width: 100%; margin-top: 10px; background: var(--azul-escuro); }
.btn {
  display: inline-block;
  text-align: center;
  background: var(--azul);
  color: #fff;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--azul-escuro); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(.97); }
.btn-outline {
  background: #fff;
  color: var(--azul);
  border: 1px solid var(--azul);
  box-shadow: none;
}
.btn-outline:hover { background: var(--azul-claro); color: var(--azul-escuro); }

/* ---------- forms ---------- */
.form-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  max-width: 560px;
  margin: 0 auto;
  border: 1px solid var(--borda);
  box-shadow: var(--shadow-sm);
}
.form-box h1 { margin-top: 0; }
.form-box label { display: block; margin: 12px 0 5px; font-weight: 600; font-size: 13.5px; color: #374151; }
.form-box input, .form-box select, .form-box textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--borda);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.form-box input:focus, .form-box select:focus, .form-box textarea:focus { border-color: var(--azul); }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert-ok { background: var(--verde-bg); color: #166534; }
.alert-erro { background: var(--vermelho-bg); color: #991b1b; }

/* ---------- footer ---------- */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--borda);
  margin-top: 48px;
  padding: 48px 16px 0;
}
.footer-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
}
.footer-brand .logo { display: inline-block; margin-bottom: 10px; }
.footer-brand p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; max-width: 320px; }
.footer-col h4 { margin: 0 0 14px; font-size: 13.5px; color: var(--azul-escuro); }
.footer-col a {
  display: block;
  color: #4b5563;
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 10px;
}
.footer-col a:hover { color: var(--azul); }
.footer-col p { color: #4b5563; font-size: 14px; margin: 0 0 10px; line-height: 1.5; }
.footer-bottom {
  border-top: 1px solid var(--borda);
  text-align: center;
  padding: 18px 0;
  color: #9ca3af;
  font-size: 13px;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 440px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- tables ---------- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--borda);
  box-shadow: var(--shadow-sm);
}
table.compare { width: 100%; min-width: 560px; border-collapse: collapse; background: #fff; margin-top: 0; }
table.compare th, table.compare td {
  border: 1px solid var(--borda);
  padding: 11px;
  text-align: left;
  font-size: 14px;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  vertical-align: top;
}
table.compare th:first-child, table.compare td:first-child {
  position: sticky;
  left: 0;
  background: #f8fafc;
  min-width: 120px;
  font-weight: 600;
  z-index: 1;
}
table.compare th { background: #f1f5f9; font-weight: 700; }
@media (max-width: 480px) {
  table.compare { min-width: 480px; }
  table.compare th, table.compare td { padding: 8px; font-size: 13px; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
}