:root {
  --bg: #ADD8E6;
  --bg-elevated: rgba(255, 255, 255, 0.86);
  --bg-strong: #ffffff;
  --bg-soft: #e7f0ff;
  --text: #10213f;
  --text-muted: #5f6f8f;
  --border: rgba(16, 33, 63, 0.1);
  --primary: #0e63ff;
  --primary-deep: #0849c8;
  --primary-soft: rgba(14, 99, 255, 0.12);
  --shadow: 0 24px 60px rgba(11, 37, 89, 0.12);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

body.dark-mode {
  --bg: #08101f;
  --bg-elevated: rgba(12, 24, 46, 0.9);
  --bg-strong: #0c1830;
  --bg-soft: #10213f;
  --text: #edf4ff;
  --text-muted: #a8b6d3;
  --border: rgba(237, 244, 255, 0.1);
  --primary: #6aa8ff;
  --primary-deep: #3e85f5;
  --primary-soft: rgba(106, 168, 255, 0.14);
  --shadow: 0 28px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(92, 163, 255, 0.24), transparent 24%),
    radial-gradient(circle at left center, rgba(14, 99, 255, 0.14), transparent 28%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

body[data-page="home"] .hero {
  min-height: clamp(520px, 82vh, 760px);
  display: grid;
  align-items: center;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(1160px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(244, 248, 255, 0.8);
  border-bottom: 1px solid var(--border);
}

body.dark-mode .site-header {
  background: rgba(8, 16, 31, 0.82);
}

.nav-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #5ca3ff);
  border-radius: 18px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.brand-text small {
  color: var(--text-muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.site-nav a,
.theme-toggle {
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text);
  background: transparent;
  transition: 0.2s ease;
}

.theme-toggle {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  border-color: var(--border);
  background: var(--bg-strong);
  box-shadow: var(--shadow);
  font-size: 1.1rem;
}

.theme-toggle span {
  line-height: 1;
}

.site-nav a:hover,
.theme-toggle:hover,
.site-nav a.is-active,
.site-nav a:focus-visible,
.theme-toggle:focus-visible {
  background: var(--primary-soft);
  border-color: var(--border);
  outline: none;
}

.theme-toggle[aria-pressed="true"] {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-toggle {
  display: none;
  border: 0;
  background: var(--bg-strong);
  width: 3rem;
  height: 3rem;
  padding: 0.7rem;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  margin: 0.28rem 0;
  border-radius: 999px;
}

.hero,
.page-main {
  padding-top: 2rem;
}

.hero {
  padding-bottom: 2rem;
}

.hero-grid,
.form-layout {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: start;
}

.hero-copy {
  padding: 4rem 0 2rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero h1,
.section h1,
.section h2,
.cta-banner h2 {
  margin: 0 0 1rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2.7rem, 4vw, 4.9rem);
  max-width: 12ch;
}

.hero p,
.section p,
.form-intro p,
.site-footer p,
.results-meta {
  color: var(--text-muted);
  line-height: 1.7;
}

.hero-actions,
.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.button,
.text-link {
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.95rem 1.4rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.button:hover,
.text-link:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  box-shadow: var(--shadow);
}

.button-secondary {
  color: var(--text);
  background: var(--bg-strong);
  border-color: var(--border);
}

.button-whatsapp {
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #169b47);
  box-shadow: var(--shadow);
}

.button-danger {
  color: #fff;
  background: linear-gradient(135deg, #e64f4f, #b13333);
  box-shadow: var(--shadow);
}

.card,
.cta-banner {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-panel,
.filters,
.business-form,
.info-card,
.cta-banner {
  padding: 1.5rem;
}

.search-form,
.filters,
.business-form {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1rem;
  color: var(--text);
  background: var(--bg-strong);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(14, 99, 255, 0.18);
  border-color: var(--primary);
}

.section {
  padding: 2.5rem 0;
}

.section-tint {
  background: linear-gradient(180deg, transparent, rgba(92, 163, 255, 0.08));
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
}

.chip {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-strong);
  font-weight: 700;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.provider-card {
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  min-height: 100%;
}

.provider-top {
  display: flex;
  gap: 1.15rem;
  align-items: center;
}

.provider-avatar {
  width: 90px;
  height: 90px;
  flex: 0 0 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8cc0ff);
  border: 3px solid var(--bg-strong);
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(11, 37, 89, 0.14);
  text-transform: uppercase;
}

.provider-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.provider-heading {
  min-width: 0;
}

.provider-heading h3 {
  margin-top: 0;
  margin-bottom: 0.65rem;
  overflow-wrap: anywhere;
}

.provider-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 700;
}

.provider-meta,
.provider-links {
  display: grid;
  gap: 0.55rem;
  color: var(--text-muted);
}

.provider-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: auto;
}

.rating {
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.rating-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
}

.rating-average-star {
  color: #f8b400;
  font-size: 1.05rem;
  line-height: 1;
}

.rating-review-count,
.rating-label {
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 600;
}

.rating-input-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.rating-actions {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.18rem;
}

.rating-star {
  width: 1.7rem;
  height: 1.7rem;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(248, 180, 0, 0.34);
  font-size: 1.2rem;
  line-height: 1;
  transition: color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.rating-star.is-filled {
  color: #f8b400;
}

.rating-star:not(:disabled):hover,
.rating-star:not(:disabled):focus-visible {
  color: #f8b400;
  transform: translateY(-1px) scale(1.08);
}

.rating-star:disabled {
  cursor: default;
  opacity: 0.78;
}

.rating-star:focus-visible {
  outline: 2px solid rgba(14, 99, 255, 0.22);
  border-radius: 999px;
}

.rating-feedback {
  color: #167040;
  min-height: 1.2em;
  font-size: 0.92rem;
  line-height: 1.3;
}

.rating-feedback.error {
  color: #b13333;
}

.status-message,
.results-meta,
.form-feedback,
.image-preview {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: var(--bg-strong);
  border: 1px solid var(--border);
}

.form-feedback.success {
  background: rgba(39, 174, 96, 0.12);
  color: #167040;
  border-color: rgba(39, 174, 96, 0.24);
}

.form-feedback.error {
  background: rgba(230, 79, 79, 0.12);
  color: #b13333;
  border-color: rgba(230, 79, 79, 0.2);
}

.results-meta {
  margin: 1.25rem 0;
}

.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer {
  margin-top: 2rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(14, 99, 255, 0.06));
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.info-card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.text-link {
  color: var(--primary);
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

.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 (max-width: 900px) {
  .hero-grid,
  .form-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding-top: 1rem;
  }

  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 1rem;
    left: 1rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    border-radius: 22px;
    background: var(--bg-strong);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a,
  .theme-toggle {
    width: 100%;
    text-align: left;
  }

  .theme-toggle {
    justify-content: center;
  }

  .section-heading,
  .cta-banner,
  .provider-top {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 1rem, 1160px);
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .button,
  .filter-actions .button {
    width: 100%;
  }

  .provider-top {
    gap: 0.85rem;
  }

  .provider-avatar {
    width: 70px;
    height: 70px;
    flex-basis: 70px;
    font-size: 1.55rem;
  }

  .rating-input-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }
}
