/* =========================
   CSS COMPLETO ATUALIZADO
   Responsivo + Dark Mode consistente (sem briga de regras)
   ========================= */

/* 1) Reset/Base */
:root {
  --container-max: 1120px;
  --gutter: 16px;

  /* Paleta base */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-strong: #f1f5f9;
  --text: #0f172a;
  --muted: #6b7280;

  --card-border: #e5e7eb;
  --card-shadow: 0 35px 70px rgba(15, 23, 42, 0.15);
  --card-shadow-strong: 0 55px 90px rgba(15, 23, 42, 0.25);
  --accent: #f97316;
  --accent-dark: #c2410c;
  --accent-soft: #fff3e0;

  /* Paleta dark */
  --bg-dark: #0b1120;
  --surface-dark: #121827;
  --surface-dark-2: #202736;
  --text-dark: #f8fafc;
  --muted-dark: #b9c1d0;

  --border-dark: #2d3748;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

#landing-root {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg), var(--surface-strong));
  transition: background 0.4s ease;
}

body {
  margin: 0;
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  transition: background-color 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
}

body.dark-mode {
  background-color: #030712;
  color: #f8fafc;
}

body.dark-mode #landing-root {
  background: linear-gradient(180deg, #020612 0%, #020c18 35%, #091328 70%, #111827 100%);
}

header {
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  backdrop-filter: blur(18px);
  background-color: rgba(255, 255, 255, 0.92);
}

body.dark-mode header {
  background-color: rgba(4, 9, 21, 0.95);
  border-color: rgba(20, 30, 50, 0.8);
}

body.dark-mode header nav a,
body.dark-mode header .drawer-cta {
  color: #f8fafc;
}

#site-name {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: letter-spacing 0.3s ease;
}

@media (max-width: 640px) {
  #site-name {
    letter-spacing: 0.08em;
  }
}

/* Mídias responsivas */
img,
video,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Conteúdo não deve estourar */
p,
h1,
h2,
h3,
h4,
h5,
h6,
span,
a,
button,
input,
textarea,
select {
  overflow-wrap: anywhere;
}

/* Utility */
.min-w-0 {
  min-width: 0 !important;
}

#mobile-drawer a:focus-visible,
#mobile-drawer button:focus-visible {
  outline: 2px solid #f97316;
  outline-offset: 3px;
}

body.dark-mode #mobile-drawer a:focus-visible,
body.dark-mode #mobile-drawer button:focus-visible {
  outline-color: #fbbf24;
}

/* Container padrão */
.container {
  width: min(var(--container-max), calc(100% - (var(--gutter) * 2)));
  margin-inline: auto;
}

/* Wrapper opcional */
.page-wrap,
.app-wrap {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Inputs/Buttons não estouram */
input,
select,
textarea,
button {
  max-width: 100%;
}

input,
select,
textarea {
  min-width: 0; /* crítico em flex */
}

/* Barra de busca (se usar no pai) */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.search-bar input,
.search-bar .form-input {
  flex: 1 1 auto;
  min-width: 0;
}

.search-bar button {
  flex: 0 0 auto;
}

.gradient-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 32px;
  background: linear-gradient(135deg, #0f172a 0%, #111827 55%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 45px 90px rgba(15, 23, 42, 0.4);
  padding: 3rem;
}

.gradient-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.35), transparent 55%);
  opacity: 0.7;
  pointer-events: none;
}

body.dark-mode .gradient-hero::after {
  background: radial-gradient(circle at 80% 0%, rgba(249, 115, 22, 0.25), transparent 55%);
}

#hero-title {
  color: #f8fafc;
  font-size: clamp(2.8rem, 4vw, 3.75rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

#hero-subtitle {
  color: rgba(248, 250, 252, 0.85);
  max-width: 560px;
}

.gradient-hero .search-bar {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-hero .search-bar input {
  background: transparent;
  color: #e2e8f0;
  border: none;
}

.gradient-hero .search-bar input::placeholder {
  color: rgba(226, 232, 240, 0.7);
}

.gradient-hero .search-bar button {
  background: var(--accent);
  border-radius: 999px;
  border: none;
  font-weight: 700;
  box-shadow: 0 15px 35px rgba(249, 115, 22, 0.25);
}

#hero-search {
  font-size: 1.1rem;
}

.gradient-hero .mt-3.flex.flex-wrap button {
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.35);
}

.gradient-hero .mt-3.flex.flex-wrap button:hover {
  border-color: white;
  background: rgba(255, 255, 255, 0.2);
}

.gradient-hero #cta-profissional,
.gradient-hero #cta-cliente {
  min-width: 220px;
  border-radius: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gradient-hero #cta-cliente {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 20px 30px rgba(249, 115, 22, 0.35);
}

.gradient-hero #cta-profissional {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.gradient-hero #cta-profissional:hover,
.gradient-hero #cta-cliente:hover {
  transform: translateY(-2px) scale(1.01);
}

.gradient-hero #cta-profissional::after,
.gradient-hero #cta-cliente::after {
  display: none;
}

body.dark-mode .gradient-hero {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.92) 100%);
  border-color: rgba(255, 255, 255, 0.15);
}

body.dark-mode .gradient-hero .search-bar {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
}

body.dark-mode .gradient-hero .search-bar input {
  color: #e2e8f0;
}

body.dark-mode .gradient-hero .mt-3.flex.flex-wrap button {
  border-color: rgba(255, 255, 255, 0.2);
}

#profissionais {
  background: #fdfdfd;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  padding: 4rem 1.5rem 3rem;
}

#profissionais-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

#profissionais-list > div {
  border-radius: 26px;
  border: 1px solid var(--card-border);
  background: var(--surface);
  box-shadow: var(--card-shadow-strong);
  padding: 1.75rem;
  transition: transform 0.24s ease, box-shadow 0.24s ease;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 100%;
}

#profissionais-list > div:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-shadow-strong), 0 45px 65px rgba(15, 23, 42, 0.3);
}

body.dark-mode #profissionais {
  background: #050815;
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode #profissionais-list > div {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(255, 255, 255, 0.08);
}

#profissionais-list .flex.items-start {
  gap: 1.5rem;
}

#profissionais-list .w-20 {
  border-radius: 22px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.15), 0 15px 35px rgba(15, 23, 42, 0.2);
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.9), rgba(245, 158, 11, 0.8));
}

#profissionais-list h4 {
  letter-spacing: -0.01em;
  font-size: 1.25rem;
}

#profissionais-list p.text-orange-500 {
  color: var(--accent);
  letter-spacing: 0.01em;
}

#profissionais-list .flex.gap-2 button,
#profissionais-list .flex.gap-2 a {
  border-radius: 16px;
  font-weight: 600;
  text-transform: none;
}

#profissionais-list .flex.gap-2 button[data-action="open-profile"],
#profissionais-list .flex.gap-2 a[href*="wa.me"] {
  padding: 0.95rem 1.25rem;
}

#profissionais-list .flex.gap-2 button[data-action="open-profile"]:hover,
#profissionais-list .flex.gap-2 a[href*="wa.me"]:hover {
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
}

.skeleton-card {
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.08);
}

header nav {
  gap: 0.75rem;
}

header nav a {
  transition: color 0.35s ease;
}

@media (max-width: 1024px) {
  header nav {
    flex-direction: column;
    align-items: flex-end;
  }

  header nav > a {
    display: inline-flex;
    width: auto;
  }

  .gradient-hero section .flex.flex-col {
    gap: 2rem;
  }
}

#mobile-drawer {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.45), rgba(2, 6, 23, 0.25));
  backdrop-filter: blur(18px);
}

#mobile-drawer > div {
  align-items: flex-start;
  padding: 1.25rem;
}

#mobile-drawer .drawer-panel {
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.8));
  border-radius: 36px;
  padding: 2rem 1.75rem;
  width: min(90vw, 360px);
  border: 1px solid rgba(249, 115, 22, 0.4);
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.55);
  position: relative;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
}

#mobile-drawer .drawer-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(249, 115, 22, 0.18), transparent 45%);
  pointer-events: none;
  opacity: 0.7;
}

#mobile-drawer .drawer-panel > * {
  position: relative;
  z-index: 1;
}

#mobile-drawer .drawer-panel h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
}

.drawer-cta {
  background: linear-gradient(135deg, var(--accent), #e56c11);
  color: #fff;
  box-shadow: 0 30px 40px rgba(249, 115, 22, 0.45);
  border: none;
  border-radius: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.drawer-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 36px 48px rgba(249, 115, 22, 0.55);
}

.drawer-cta:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 18px 26px rgba(249, 115, 22, 0.35);
}

.drawer-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  color: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.drawer-action:hover {
  transform: translateY(-4px);
  border-color: rgba(249, 115, 22, 0.4);
  background: rgba(255, 255, 255, 0.15);
}

.drawer-action:active {
  transform: translateY(0) scale(0.98);
  box-shadow: inset 0 0 0 rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.drawer-action span {
  font-weight: 600;
}

@media (max-width: 900px) {
  .gradient-hero {
    padding: 2.25rem;
  }

  .gradient-hero .search-bar {
    flex-direction: column;
    gap: 12px;
  }

  .gradient-hero .search-bar input {
    padding-left: 0;
  }

  .gradient-hero .search-bar button {
    width: 100%;
    justify-content: center;
  }

  .gradient-hero .mt-3.flex.flex-wrap {
    justify-content: center;
  }

  .gradient-hero #cta-profissional,
  .gradient-hero #cta-cliente {
    width: 100%;
    min-width: 0;
    text-align: center;
  }
  #favorites-panel,
  #compare-panel {
    width: min(360px, calc(100% - 2rem));
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  #compare-panel {
    width: min(600px, calc(100% - 1rem));
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 640px) {
  header {
    border-bottom: none;
  }

  header nav {
    align-items: flex-start;
  }

  .gradient-hero {
    padding: 1.75rem;
    border-radius: 28px;
  }

  #profissionais {
    padding: 2rem 1rem 3rem;
  }

  #profissionais-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  #profissionais-list > div {
    width: 100%;
    padding: 1.5rem;
  }
}

@media (max-width: 500px) {
  .gradient-hero {
    padding: 1.5rem;
    border-radius: 24px;
  }

  .gradient-hero .search-bar {
    padding: 6px;
  }

  .gradient-hero #hero-title {
    font-size: clamp(2.2rem, 8vw, 2.8rem);
  }

  .gradient-hero #hero-subtitle {
    font-size: 1rem;
  }

  .gradient-hero .mt-3.flex.flex-wrap button {
    flex: 1 1 140px;
  }
}

/* Títulos fluidos (se aplicar as classes) */
.hero-title {
  font-size: clamp(28px, 6vw, 56px);
  line-height: 1.05;
}

.hero-subtitle {
  font-size: clamp(14px, 2.5vw, 18px);
}

/* =========================
   2) Dark Mode (CONSISTENTE)
   ========================= */
body.dark-mode {
  background-color: var(--bg-dark);
  color: var(--text-dark);
}

/* Texto utilitário Tailwind (quando usado) */
body.dark-mode .text-gray-900 {
  color: var(--text-dark) !important;
}
body.dark-mode .text-gray-700 {
  color: #d6d6d6 !important;
}
body.dark-mode .text-gray-600 {
  color: var(--muted-dark) !important;
}
body.dark-mode .text-gray-500 {
  color: #a6a6a6 !important;
}
body.dark-mode .text-black {
  color: var(--text-dark) !important;
}

/* Bordas utilitárias Tailwind (quando usado) */
body.dark-mode .border-gray-100,
body.dark-mode .border-gray-200,
body.dark-mode .border-gray-300 {
  border-color: var(--border-dark) !important;
}

/* IMPORTANTE:
   No dark mode, qualquer "fundo claro" vira surface escuro.
   Isso resolve os cards bege/azul/verde que ficavam com texto apagado. */
body.dark-mode .bg-white,
body.dark-mode .bg-gray-50,
body.dark-mode .bg-gray-100,
body.dark-mode .bg-orange-50,
body.dark-mode .bg-amber-50,
body.dark-mode .bg-yellow-50,
body.dark-mode .bg-green-50,
body.dark-mode .bg-emerald-50,
body.dark-mode .bg-blue-50,
body.dark-mode .bg-indigo-50,
body.dark-mode .bg-purple-50,
body.dark-mode .bg-pink-50,
body.dark-mode .bg-teal-50,
body.dark-mode .bg-slate-50,
body.dark-mode .bg-zinc-50,
body.dark-mode .bg-neutral-50 {
  background-color: var(--surface-dark) !important;
  color: var(--text-dark) !important;
}

/* Caso existam cards com sombra e você queira manter contraste */
body.dark-mode .shadow,
body.dark-mode .shadow-md,
body.dark-mode .shadow-lg,
body.dark-mode .shadow-xl {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55) !important;
}

/* Inputs em dark mode (quando seu layout usa bg-white no input) */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background-color: var(--surface-dark-2);
  color: var(--text-dark);
  border-color: var(--border-dark);
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #9a9a9a;
}

/* Toast legível no dark mode */
body.dark-mode .toast-notification {
  background: var(--surface-dark-2);
  color: var(--text-dark);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.6);
}

/* =========================
   3) Seus estilos originais
   ========================= */
.gradient-hero {
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
}

.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* no dark mode: hover menos “lavado” */
body.dark-mode .card-hover:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}

.profissao-badge {
  display: inline-block;
  padding: 4px 12px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* badge em dark mode: não estourar brilho */
body.dark-mode .profissao-badge {
  background: #3a2a12;
  color: #ffd18a;
}

.form-input {
  transition: all 0.2s ease;
}

.form-input:focus {
  transform: scale(1.01);
}

.btn-loading {
  opacity: 0.7;
  pointer-events: none;
}

.success-message {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #9ca3af;
}

.toast-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: white;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  animation: slideInRight 0.3s ease;
  max-width: min(420px, calc(100vw - 40px));
}

body.dark-mode footer {
  background: #040712;
  color: #c7d2fe;
}

body.dark-mode footer a {
  color: #fbbf24;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.favorite-btn {
  transition: all 0.2s ease;
}

.favorite-btn.active {
  color: #ef4444;
  transform: scale(1.2);
}

.premium-badge {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.compare-checkbox {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.image-gallery img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}

.image-gallery img:hover {
  transform: scale(1.05);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes float-delay {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-float-delay {
  animation: float-delay 4s ease-in-out infinite;
}

@view-transition {
  navigation: auto;
}

/* =========================
   4) Responsividade
   ========================= */

/* Galeria: 3 -> 2 -> 1 colunas */
@media (max-width: 900px) {
  .image-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  .image-gallery img {
    height: 96px;
  }
}

@media (max-width: 520px) {
  .image-gallery {
    grid-template-columns: 1fr;
  }
  .image-gallery img {
    height: 140px;
  }
}

/* Mobile: hover e toast + iOS input zoom */
@media (max-width: 640px) {
  .card-hover:hover {
    transform: none;
    box-shadow: none;
  }

  body.dark-mode .card-hover:hover {
    box-shadow: none;
  }

  .toast-notification {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-width: calc(100vw - 24px);
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }
}

@media (max-width: 940px) {
  .grid-cols-3 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
  }
}

/* =========================
   5) Correção segura p/ overflow em flex/grid
   NÃO aplique min-width:0 no container Tailwind (.flex/.grid)
   aplique nos filhos.
   ========================= */
.flex > *,
.grid > * {
  min-width: 0;
}
