:root {
  --ink: #142033;
  --muted: #617085;
  --line: #dfe7f1;
  --soft: #f4f7fb;
  --white: #ffffff;
  --blue: #214785;
  --blue-dark: #132f59;
  --blue-soft: #e8eef8;
  --gold: #c18b2f;
  --gold-soft: #fbf4e5;
  --whatsapp: #25d366;
  --whatsapp-dark: #128c4a;
  --shadow: 0 24px 70px rgba(18, 47, 89, 0.16);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--ink);
  font-family: "Inter", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.62;
  background: var(--white);
  overflow-x: hidden;
}

a {
  text-decoration: none;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1040;
  height: 36px;
  color: var(--white);
  background: var(--blue-dark);
  font-size: 0.84rem;
}

.topbar .container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  height: 100%;
}

.topbar a,
.topbar span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}

.navbar {
  top: 36px;
  padding: 12px 0;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(223, 231, 241, 0.86);
  backdrop-filter: blur(18px);
  transition: box-shadow 220ms ease, background 220ms ease, padding 220ms ease;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--white);
  border: 1px solid rgba(33, 71, 133, 0.18);
  box-shadow: 0 10px 24px rgba(33, 71, 133, 0.13);
  overflow: hidden;
  transition: transform 220ms var(--ease), box-shadow 220ms ease;
}

.brand-mark img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.navbar-brand:hover .brand-mark {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(33, 71, 133, 0.18);
}

.brand-text {
  display: grid;
  line-height: 1.05;
}

.brand-text strong {
  font-size: 1rem;
}

.brand-text small {
  color: var(--muted);
  font-size: 0.8rem;
}

.nav-link {
  position: relative;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

.nav-link:hover,
.nav-link.active {
  color: var(--blue);
}

.nav-link::after {
  content: "";
  position: absolute;
  right: 0.5rem;
  bottom: 0.2rem;
  left: 0.5rem;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 240ms var(--ease);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 800;
  min-height: 48px;
  padding: 0.82rem 1.22rem;
  overflow: hidden;
  transform: translateZ(0);
  transition: transform 220ms var(--ease), box-shadow 220ms ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(20, 32, 51, 0.14);
}

.btn i {
  transition: transform 220ms var(--ease);
}

.btn:hover i {
  transform: translateX(2px);
}

.btn-primary {
  --bs-btn-bg: var(--blue);
  --bs-btn-border-color: var(--blue);
  --bs-btn-hover-bg: var(--blue-dark);
  --bs-btn-hover-border-color: var(--blue-dark);
  --bs-btn-active-bg: var(--blue-dark);
  --bs-btn-active-border-color: var(--blue-dark);
}

.btn-outline-primary {
  --bs-btn-color: var(--blue);
  --bs-btn-border-color: var(--blue);
  --bs-btn-hover-bg: var(--blue);
  --bs-btn-hover-border-color: var(--blue);
}

.btn-whatsapp {
  --bs-btn-color: var(--white);
  --bs-btn-bg: var(--whatsapp-dark);
  --bs-btn-border-color: var(--whatsapp-dark);
  --bs-btn-hover-color: var(--white);
  --bs-btn-hover-bg: #0f7a40;
  --bs-btn-hover-border-color: #0f7a40;
  --bs-btn-active-color: var(--white);
  --bs-btn-active-bg: #0d6b38;
  --bs-btn-active-border-color: #0d6b38;
}

.hero {
  position: relative;
  min-height: 780px;
  overflow: hidden;
  isolation: isolate;
}

.hero-media,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-media {
  background-image: url("../img/hero-ortopedia.png");
  background-size: cover;
  background-position: center right;
  --hero-x: 0px;
  --hero-y: 0px;
  transform: translate3d(var(--hero-x), var(--hero-y), 0) scale(1.035);
  animation: heroBreath 16s ease-in-out infinite alternate;
  will-change: transform;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.99) 0%, rgba(246, 249, 253, 0.96) 36%, rgba(232, 238, 248, 0.48) 64%, rgba(255, 255, 255, 0.08) 100%),
    linear-gradient(180deg, rgba(19, 47, 89, 0.08), rgba(19, 47, 89, 0.02));
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-top: 74px;
}

.hero .eyebrow,
.hero h1,
.hero .lead,
.hero-actions,
.hero-tags {
  opacity: 0;
  transform: translateY(24px);
  animation: heroIntro 760ms var(--ease) forwards;
}

.hero h1 {
  animation-delay: 120ms;
}

.hero .lead {
  animation-delay: 220ms;
}

.hero-actions {
  animation-delay: 320ms;
}

.hero-tags {
  animation-delay: 430ms;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-weight: 900;
  margin-bottom: 14px;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.eyebrow::before {
  content: "";
  width: 30px;
  height: 2px;
  background: var(--gold);
}

h1,
h2,
h3 {
  font-weight: 900;
}

h1 {
  max-width: 850px;
  font-size: clamp(2.5rem, 5vw, 4.65rem);
  line-height: 0.98;
  margin-bottom: 24px;
}

h2 {
  font-size: clamp(2rem, 4.3vw, 3.35rem);
  line-height: 1.04;
  margin-bottom: 18px;
}

h3 {
  font-size: 1.2rem;
}

.lead {
  max-width: 700px;
  color: #26394f;
  font-size: 1.26rem;
  line-height: 1.58;
}

.hero-actions,
.hero-tags,
.contact-actions,
.patient-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 30px;
}

.hero-tags {
  max-width: 760px;
  margin-top: 26px;
}

.hero-tags span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: var(--blue-dark);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(33, 71, 133, 0.14);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(20, 32, 51, 0.08);
  font-weight: 800;
}

.hero-tags i {
  color: var(--blue);
}

.quick-access {
  position: relative;
  z-index: 4;
  margin-top: -76px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.quick-grid a {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 172px;
  padding: 28px;
  color: var(--ink);
  border-right: 1px solid var(--line);
  transition: transform 260ms var(--ease), background 260ms ease, box-shadow 260ms ease;
}

.quick-grid a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(33, 71, 133, 0.08), rgba(193, 139, 47, 0.08));
  opacity: 0;
  transition: opacity 260ms ease;
}

.quick-grid a > * {
  position: relative;
  z-index: 1;
}

.quick-grid a:hover {
  background: #fbfcff;
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(18, 47, 89, 0.12);
}

.quick-grid a:hover::before {
  opacity: 1;
}

.quick-grid a:last-child {
  border-right: 0;
}

.quick-grid i {
  color: var(--blue);
  font-size: 2rem;
  transition: transform 260ms var(--ease), color 260ms ease;
}

.quick-grid a:hover i {
  color: var(--gold);
  transform: translateY(-3px) scale(1.04);
}

.quick-grid strong {
  font-size: 1.1rem;
}

.quick-grid span {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.section {
  padding: 112px 0;
}

.section-muted {
  background: var(--soft);
}

.section-heading {
  max-width: 850px;
  margin-bottom: 42px;
}

.section-heading p,
.section p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.68;
}

.service-card,
.contact-panel,
.appointment-form {
  height: 100%;
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 18px 45px rgba(20, 32, 51, 0.08);
}

.service-card {
  position: relative;
  overflow: hidden;
  transition: transform 260ms var(--ease), box-shadow 260ms ease, border-color 260ms ease;
}

.service-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--blue));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 280ms var(--ease);
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(33, 71, 133, 0.25);
  box-shadow: var(--shadow);
}

.service-card:hover::after {
  transform: scaleX(1);
}

.service-card.featured {
  background: var(--blue);
  color: var(--white);
}

.service-card.featured p {
  color: rgba(255, 255, 255, 0.78);
}

.service-card i {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 22px;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 18px;
  font-size: 1.65rem;
  transition: transform 260ms var(--ease), background 260ms ease, color 260ms ease;
}

.service-card:hover i {
  transform: translateY(-2px) rotate(-2deg);
}

.service-card.featured i {
  color: var(--white);
  background: rgba(255, 255, 255, 0.16);
}

.visual-care {
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fc 100%);
}

.image-card {
  height: 100%;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 18px 45px rgba(20, 32, 51, 0.08);
  transition: transform 260ms var(--ease), box-shadow 260ms ease, border-color 260ms ease;
}

.image-card:hover {
  transform: translateY(-6px);
  border-color: rgba(33, 71, 133, 0.24);
  box-shadow: var(--shadow);
}

.image-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 700ms var(--ease);
}

.image-card:hover img {
  transform: scale(1.045);
}

.image-card div {
  padding: 26px;
}

.image-card span {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--gold);
  font-weight: 900;
}

.image-card p {
  margin-bottom: 0;
}

.warning-section {
  background: var(--white);
}

.warning-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.warning-grid div {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 96px;
  padding: 22px;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(20, 32, 51, 0.06);
  font-size: 1.03rem;
  font-weight: 800;
  line-height: 1.5;
  transition: transform 260ms var(--ease), background 260ms ease, box-shadow 260ms ease;
}

.warning-grid div:hover {
  transform: translateY(-4px);
  background: var(--blue-soft);
  box-shadow: 0 20px 45px rgba(18, 47, 89, 0.12);
}

.warning-grid i {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 1.3rem;
}

.care-route {
  padding: 104px 0;
  color: var(--white);
  background: linear-gradient(135deg, #102a50 0%, #214785 100%);
  background-size: 140% 140%;
  animation: routeGradient 14s ease-in-out infinite alternate;
  overflow: hidden;
}

.care-route .eyebrow,
.care-route .eyebrow::before {
  color: #f2c46b;
}

.care-route .eyebrow::before {
  background: #f2c46b;
}

.care-route p {
  color: rgba(255, 255, 255, 0.76);
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.route-grid div {
  position: relative;
  padding: 28px;
  min-height: 210px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  transition: background 260ms ease, transform 260ms var(--ease);
}

.route-grid div:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-3px);
}

.route-grid div:nth-child(2n) {
  border-right: 0;
}

.route-grid div:nth-last-child(-n+2) {
  border-bottom: 0;
}

.route-grid span {
  display: inline-flex;
  margin-bottom: 38px;
  color: #f2c46b;
  font-weight: 900;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.diagnostic-grid div {
  display: grid;
  gap: 14px;
  min-height: 150px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 14px 36px rgba(20, 32, 51, 0.07);
  transition: transform 260ms var(--ease), box-shadow 260ms ease, border-color 260ms ease;
}

.diagnostic-grid div:hover {
  transform: translateY(-5px);
  border-color: rgba(33, 71, 133, 0.25);
  box-shadow: var(--shadow);
}

.diagnostic-grid i {
  color: var(--blue);
  font-size: 1.9rem;
  transition: transform 260ms var(--ease), color 260ms ease;
}

.diagnostic-grid div:hover i {
  color: var(--gold);
  transform: scale(1.08);
}

.diagnostic-grid span {
  color: var(--ink);
  font-weight: 900;
}

.diagnostic-note {
  display: flex;
  gap: 12px;
  margin-top: 26px;
  padding: 18px;
  color: var(--blue-dark);
  background: var(--gold-soft);
  border-left: 4px solid var(--gold);
  font-size: 1.03rem;
  line-height: 1.58;
  font-weight: 700;
}

.patient-section {
  background:
    linear-gradient(90deg, rgba(244, 247, 251, 0.95), rgba(255, 255, 255, 1));
}

.patient-actions {
  margin-top: 24px;
}

.modern-accordion {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modern-accordion .accordion-item {
  border-color: var(--line);
  transition: background 220ms ease;
}

.modern-accordion .accordion-item:hover {
  background: #fbfcff;
}

.modern-accordion .accordion-button {
  padding: 22px 24px;
  font-size: 1.05rem;
  font-weight: 900;
}

.modern-accordion .accordion-button:not(.collapsed) {
  color: var(--blue-dark);
  background: var(--blue-soft);
  box-shadow: none;
}

.modern-accordion .accordion-body {
  color: var(--muted);
  padding: 0 24px 24px;
  font-size: 1.02rem;
  line-height: 1.65;
}

.contact-section {
  background: var(--soft);
}

.contact-list {
  display: grid;
  gap: 16px;
  padding: 0;
  margin: 28px 0;
  list-style: none;
}

.contact-list li {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.55;
}

.contact-list i {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 1.2rem;
}

.contact-list a {
  color: var(--ink);
  font-weight: 800;
}

.appointment-form p {
  color: var(--muted);
}

.form-control,
.form-select {
  min-height: 54px;
  border-color: var(--line);
  border-radius: 0;
  font-size: 1.03rem;
}

.form-label {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 0.2rem rgba(33, 71, 133, 0.14);
}

.map-shell {
  height: 430px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 260ms var(--ease), box-shadow 260ms ease;
}

.map-shell:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 80px rgba(18, 47, 89, 0.18);
}

.map-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.site-footer {
  padding: 38px 0;
  color: var(--white);
  background: #101923;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  padding: 4px;
  border-radius: 13px;
  background: var(--white);
}

.site-footer p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1rem;
}

.site-footer a {
  color: #d5e4ff;
  font-weight: 800;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.floating-whatsapp {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  color: var(--white);
  background: var(--whatsapp-dark);
  box-shadow: 0 18px 45px rgba(18, 140, 74, 0.34);
  font-size: 1.55rem;
  transition: transform 180ms ease, background 180ms ease;
}

.floating-whatsapp::before {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(18, 140, 74, 0.34);
  border-radius: 50%;
  animation: whatsappPulse 2.4s ease-out infinite;
}

.floating-whatsapp:hover {
  color: var(--white);
  background: #0f7a40;
  transform: translateY(-2px);
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 720ms var(--ease), transform 720ms var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

@keyframes heroBreath {
  from {
    transform: translate3d(var(--hero-x), var(--hero-y), 0) scale(1.035);
  }

  to {
    transform: translate3d(var(--hero-x), var(--hero-y), 0) scale(1.075);
  }
}

@keyframes routeGradient {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 100% 50%;
  }
}

@keyframes whatsappPulse {
  0% {
    opacity: 0.6;
    transform: scale(0.88);
  }

  100% {
    opacity: 0;
    transform: scale(1.28);
  }
}

@media (max-width: 991.98px) {
  .topbar {
    display: none;
  }

  .navbar {
    top: 0;
  }

  .hero {
    min-height: 780px;
  }

  .hero-content {
    padding-top: 86px;
  }

  .hero-media {
    background-position: 62% center;
  }

  .hero-overlay {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(246, 249, 253, 0.96) 58%, rgba(255, 255, 255, 0.52) 100%);
  }

  .quick-access {
    margin-top: -64px;
  }

  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-grid a:nth-child(2n) {
    border-right: 0;
  }

  .quick-grid a:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .diagnostic-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575.98px) {
  .navbar {
    padding: 10px 0;
  }

  .brand-mark {
    width: 50px;
    height: 50px;
  }

  .brand-text strong {
    max-width: 190px;
    white-space: normal;
  }

  .hero {
    min-height: 790px;
  }

  .hero-tags {
    display: none;
  }

  .quick-access {
    margin-top: -120px;
  }

  .hero-actions .btn,
  .patient-actions .btn,
  .contact-actions .btn {
    width: 100%;
  }

  .quick-grid,
  .route-grid,
  .diagnostic-grid,
  .warning-grid {
    grid-template-columns: 1fr;
  }

  .quick-grid a,
  .route-grid div {
    border-right: 0;
  }

  .route-grid div:nth-last-child(-n+2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }

  .route-grid div:last-child {
    border-bottom: 0;
  }

  .section {
    padding: 78px 0;
  }

  .service-card,
  .contact-panel,
  .appointment-form {
    padding: 26px;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .hero .eyebrow,
  .hero h1,
  .hero .lead,
  .hero-actions,
  .hero-tags,
  .reveal {
    opacity: 1;
    transform: none;
  }
}
