/* ===========================
   RIE - Rehabilitación Integral Especializada
   Estilos globales
=========================== */

/* Variables de color */
:root {
  --rie-orange:  #F97316;
  --rie-blue:    #3B82F6;
  --rie-teal:    #14B8A6;
  --rie-dark:    #1F2937;
  --rie-gray:    #6B7280;
  --rie-light:   #F9FAFB;
  --rie-white:   #FFFFFF;
}

/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  color: var(--rie-dark);
  background: var(--rie-white);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

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

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

ul { list-style: none; }

/* ===========================
   Tipografía
=========================== */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(1.6rem, 4vw, 2.8rem); font-weight: 700; line-height: 1.2; }
h3 { font-size: 1.3rem; font-weight: 700; }
h4 { font-size: 1.1rem; font-weight: 600; }
p  { line-height: 1.7; }

/* ===========================
   Utilidades
=========================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section { padding: 5rem 0; }

.text-orange { color: var(--rie-orange); }
.text-blue   { color: var(--rie-blue); }
.text-teal   { color: var(--rie-teal); }
.text-gray   { color: var(--rie-gray); }
.text-center { text-align: center; }

.bg-light { background-color: var(--rie-light); }
.bg-dark  { background-color: var(--rie-dark); }

/* Decorative underline */
.decorated { position: relative; display: inline-block; }
.decorated::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
}

/* ===========================
   Botones
=========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: .75rem;
  font-weight: 700;
  font-size: 1rem;
  transition: all .25s ease;
  cursor: pointer;
  border: none;
  text-align: center;
}

.btn-primary {
  background: var(--rie-orange);
  color: #fff;
}
.btn-primary:hover { background: #ea6907; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(249,115,22,.35); }

.btn-outline {
  background: transparent;
  border: 2px solid var(--rie-orange);
  color: var(--rie-orange);
}
.btn-outline:hover { background: var(--rie-orange); color: #fff; transform: translateY(-2px); }

.btn-white {
  background: #fff;
  color: var(--rie-blue);
}
.btn-white:hover { background: #f0f4ff; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.15); }

.btn-green {
  background: #22c55e;
  color: #fff;
}
.btn-green:hover { background: #16a34a; transform: translateY(-2px); }

/* ===========================
   Navbar
=========================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  box-shadow: 0 1px 12px rgba(0,0,0,.08);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.navbar-brand img { height: 48px; width: auto; }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.nav-link {
  position: relative;
  padding: .55rem 1rem;
  border-radius: .6rem;
  font-weight: 600;
  font-size: .95rem;
  color: #374151;
  transition: color .2s, background .2s;
}

.nav-link:hover { color: var(--rie-orange); background: rgba(249,115,22,.06); }

.nav-link.active {
  color: var(--rie-orange);
  background: rgba(249,115,22,.1);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--rie-orange);
}

/* Hamburger */
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
  color: #374151;
  transition: color .2s;
}
.navbar-toggle:hover { color: var(--rie-orange); }
.navbar-toggle svg { display: block; }

/* Mobile menu */
.navbar-mobile {
  display: none;
  flex-direction: column;
  gap: .25rem;
  padding: 1rem 1.25rem 1.25rem;
  background: #fff;
  border-top: 1px solid #f3f4f6;
}

.navbar-mobile .nav-link { width: 100%; }

/* ===========================
   Hero
=========================== */
.hero {
  position: relative;
  background: linear-gradient(135deg, rgba(249,115,22,.12) 0%, rgba(59,130,246,.08) 50%, rgba(20,184,166,.08) 100%);
  padding: 5rem 0 3rem;
  overflow: hidden;
  text-align: center;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero-blob-1 { width: 320px; height: 320px; background: rgba(249,115,22,.1); top:-80px; right:-60px; }
.hero-blob-2 { width: 200px; height: 200px; background: rgba(20,184,166,.15); bottom:-40px; left:-50px; }
.hero-blob-3 { width: 120px; height: 120px; background: rgba(59,130,246,.1); top:40%; left:5%; }

.hero-content { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(249,115,22,.12);
  color: var(--rie-orange);
  border-radius: 9999px;
  padding: .4rem 1.1rem;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 1.5rem;
}

.hero h1 { margin-bottom: 1.25rem; color: #111827; }
.hero p   { font-size: 1.2rem; color: var(--rie-gray); max-width: 680px; margin: 0 auto 2.5rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(249,115,22,.15);
}

.hero-stat { text-align: center; }
.hero-stat span { display: block; font-size: 2rem; font-weight: 800; color: var(--rie-orange); }
.hero-stat small { color: var(--rie-gray); font-size: .9rem; font-weight: 600; }

/* ===========================
   Cards
=========================== */
.card {
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.07);
  transition: box-shadow .3s, transform .3s;
  overflow: hidden;
}

.card:hover { box-shadow: 0 10px 40px rgba(0,0,0,.12); transform: translateY(-4px); }

.card-body { padding: 2rem; }

/* Icon card */
.icon-card { padding: 2rem; text-align: center; }
.icon-card .icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  border-radius: 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 2rem;
}
.icon-wrap-orange { background: rgba(249,115,22,.12); }
.icon-wrap-blue   { background: rgba(59,130,246,.12); }
.icon-wrap-teal   { background: rgba(20,184,166,.12); }

/* Color SVGs inside icon-wraps */
.icon-wrap-orange svg { color: var(--rie-orange); }
.icon-wrap-blue   svg { color: var(--rie-blue); }
.icon-wrap-teal   svg { color: var(--rie-teal); }

.icon-card h3 { margin-bottom: .6rem; }
.icon-card p  { font-size: .95rem; color: var(--rie-gray); }
.icon-card .icon { margin-bottom: 1rem; }
.icon-card .icon svg { display: block; margin: 0 auto; }

/* ===========================
   Grids
=========================== */
.grid { display: grid; gap: 2rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Col layout helper */
.flex { display: flex; }
.flex-center { align-items: center; }
.gap-1 { gap: 1rem; }
.gap-2 { gap: 2rem; }

/* ===========================
   Section headers
=========================== */
.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-header .badge {
  display: inline-block;
  background: rgba(249,115,22,.1);
  color: var(--rie-orange);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .3rem .9rem;
  border-radius: 9999px;
  margin-bottom: .9rem;
}
.section-header h2 { margin-bottom: .9rem; }
.section-header p  { font-size: 1.1rem; color: var(--rie-gray); max-width: 640px; margin: 0 auto; }

/* ===========================
   CTA Band
=========================== */
.cta-band {
  background: linear-gradient(135deg, var(--rie-blue) 0%, #1d4ed8 100%);
  color: #fff;
  padding: 5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band::before,
.cta-band::after {
  content: '';
  position: absolute;
  border-radius: 50%;
}
.cta-band::before { width: 300px; height: 300px; background: rgba(255,255,255,.05); top: -100px; right: -80px; }
.cta-band::after  { width: 200px; height: 200px; background: rgba(255,255,255,.04); bottom: -60px; left: -40px; }

.cta-band h2 { margin-bottom: 1rem; }
.cta-band p  { font-size: 1.15rem; opacity: .9; max-width: 600px; margin: 0 auto 2.5rem; }
.cta-band-actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; position: relative; z-index: 1; }

/* ===========================
   Page hero (subpages)
=========================== */
.page-hero {
  background: linear-gradient(135deg, rgba(249,115,22,.13) 0%, rgba(59,130,246,.08) 100%);
  padding: 4rem 0;
  text-align: center;
}
.page-hero h1 { margin-bottom: 1rem; }
.page-hero p  { font-size: 1.1rem; color: var(--rie-gray); max-width: 600px; margin: 0 auto; }

/* ===========================
   Footer
=========================== */
.footer {
  background: var(--rie-dark);
  color: #d1d5db;
}

.footer-top {
  padding: 3.5rem 0;
}

.footer-top .container {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  gap: 3rem;
}

.footer-brand img { height: 80px; width: auto; margin-bottom: 1rem; }
.footer-brand p   { font-size: .95rem; line-height: 1.7; }

.footer-nav h4,
.footer-contact h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1.2rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--rie-orange);
  display: inline-block;
}

.footer-nav ul { display: flex; flex-direction: column; gap: .5rem; }
.footer-nav a  { font-size: .93rem; transition: color .2s; }
.footer-nav a:hover { color: var(--rie-orange); }

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  font-size: .93rem;
  margin-bottom: .75rem;
}
.footer-contact-item svg { flex-shrink: 0; margin-top: 2px; color: var(--rie-orange); }
.footer-contact-item a { transition: color .2s; }
.footer-contact-item a:hover { color: var(--rie-orange); }

.footer-socials { display: flex; gap: .75rem; margin-top: 1.25rem; }
.footer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: .6rem;
  background: rgba(255,255,255,.06);
  color: #d1d5db;
  transition: background .2s, color .2s;
}
.footer-socials a:hover { background: var(--rie-orange); color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 1.2rem 0;
  text-align: center;
  font-size: .85rem;
  color: #6b7280;
}

/* ===========================
   WhatsApp FAB
=========================== */
.whatsapp-fab {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 200;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(37,211,102,.45);
  transition: transform .25s, box-shadow .25s;
}
.whatsapp-fab:hover { transform: scale(1.1); box-shadow: 0 8px 28px rgba(37,211,102,.55); }
.whatsapp-fab svg   { fill: #fff; }

/* ===========================
   Servicios cards
=========================== */
.service-card {
  background: #fff;
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.07);
  transition: box-shadow .3s, transform .3s;
  border-top: 4px solid transparent;
}
.service-card:hover { box-shadow: 0 10px 40px rgba(0,0,0,.12); transform: translateY(-4px); }
.service-card.orange { border-top-color: var(--rie-orange); }
.service-card.blue   { border-top-color: var(--rie-blue); }
.service-card.teal   { border-top-color: var(--rie-teal); }

.service-card .icon { font-size: 2.5rem; margin-bottom: 1rem; }
.service-card .icon svg { display: block; margin: 0 auto; }
.service-card.orange .icon svg { color: var(--rie-orange); }
.service-card.blue   .icon svg { color: var(--rie-blue); }
.service-card.teal   .icon svg { color: var(--rie-teal); }
.service-card h3 { margin-bottom: .6rem; }
.service-card p  { font-size: .93rem; color: var(--rie-gray); }

/* ===========================
   Team cards
=========================== */
.team-card {
  background: #fff;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.07);
  transition: box-shadow .3s, transform .3s;
  text-align: center;
  border-top: 4px solid transparent;
}
.team-card:hover { box-shadow: 0 10px 40px rgba(0,0,0,.12); transform: translateY(-4px); }
.team-card:nth-child(5n+1) { border-top-color: var(--rie-orange); }
.team-card:nth-child(5n+2) { border-top-color: var(--rie-teal); }
.team-card:nth-child(5n+3) { border-top-color: var(--rie-blue); }
.team-card:nth-child(5n+4) { border-top-color: #ec4899; }
.team-card:nth-child(5n+5) { border-top-color: #8b5cf6; }

.team-card-body { padding: 2rem 1.75rem 1.75rem; }
.team-card-body h3 { font-size: 1.05rem; margin-bottom: .25rem; }
.team-card-body .rol { font-size: .82rem; font-weight: 700; color: var(--rie-orange); margin-bottom: .6rem; display: block; line-height: 1.35; }
.team-card-body p    { font-size: .85rem; color: var(--rie-gray); }

/* ===========================
   Service detail cards (large)
=========================== */
.svc-detail-card {
  background: #fff;
  border-radius: 1.5rem;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  overflow: hidden;
  margin-bottom: 2rem;
  transition: box-shadow .3s, transform .3s;
}
.svc-detail-card:hover { box-shadow: 0 12px 40px rgba(0,0,0,.12); transform: translateY(-2px); }
.svc-detail-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 2.5rem;
}
.svc-detail-header.orange,
.svc-detail-header.blue,
.svc-detail-header.teal   { background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
.svc-detail-header.orange { border-left: 5px solid var(--rie-orange); }
.svc-detail-header.blue   { border-left: 5px solid var(--rie-blue); }
.svc-detail-header.teal   { border-left: 5px solid var(--rie-teal); }
.svc-detail-header h2 { font-size: 1.75rem; margin: 0; }
.svc-detail-header .badge { font-size: .78rem; display: block; margin-bottom: .3rem; }
.svc-detail-body { padding: 2rem 2.5rem; }
.svc-detail-body > p { line-height: 1.75; margin-bottom: 1rem; }
.svc-detail-body ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; margin: 1rem 0 1.75rem; }
.svc-detail-body li { font-size: .93rem; }
@media (max-width: 600px) {
  .svc-detail-header { padding: 1.5rem; gap: 1rem; }
  .svc-detail-header h2 { font-size: 1.4rem; }
  .svc-detail-body { padding: 1.5rem; }
  .svc-detail-body ul { grid-template-columns: 1fr; }
}

/* ===========================
   Testimonios
=========================== */
.testimonial-card {
  background: #fff;
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.07);
  transition: box-shadow .3s, transform .3s;
  position: relative;
}
.testimonial-card:hover { box-shadow: 0 10px 40px rgba(0,0,0,.12); transform: translateY(-4px); }

.testimonial-card .quote {
  font-size: 3rem;
  line-height: 1;
  color: var(--rie-orange);
  opacity: .25;
  position: absolute;
  top: 1rem;
  left: 1.5rem;
}

.testimonial-card p {
  font-size: .97rem;
  color: #374151;
  font-style: italic;
  margin-bottom: 1.25rem;
  padding-top: 1rem;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rie-orange), var(--rie-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.testimonial-author-info strong { font-size: .95rem; display: block; }
.testimonial-author-info span   { font-size: .82rem; color: var(--rie-gray); }

.stars { color: #fbbf24; font-size: .95rem; margin-bottom: .5rem; }

/* ===========================
   Contacto form
=========================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 3rem;
  align-items: start;
}

.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: .92rem;
  margin-bottom: .4rem;
  color: #374151;
}

.form-control {
  width: 100%;
  padding: .75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: .75rem;
  font-size: .95rem;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
  outline: none;
  color: var(--rie-dark);
}

.form-control:focus {
  border-color: var(--rie-blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

textarea.form-control { resize: vertical; min-height: 130px; }

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

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  background: #f9fafb;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  transition: box-shadow .2s;
}
.contact-info-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }

.contact-info-icon {
  width: 48px;
  height: 48px;
  border-radius: .9rem;
  background: rgba(249,115,22,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--rie-orange);
}

.contact-info-item h4 { font-size: .95rem; margin-bottom: .2rem; }
.contact-info-item p, .contact-info-item a {
  font-size: .9rem;
  color: var(--rie-gray);
  transition: color .2s;
}
.contact-info-item a:hover { color: var(--rie-orange); }

/* Map wrapper */
.map-wrap {
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  margin-top: 3rem;
}
.map-wrap iframe { width: 100%; height: 380px; display: block; border: 0; }

/* ===========================
   SAIE page
=========================== */
.saie-step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.saie-step-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--rie-orange);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.saie-step-body h4 { margin-bottom: .35rem; }
.saie-step-body p  { font-size: .93rem; color: var(--rie-gray); }

/* ===========================
   404 page
=========================== */
.not-found {
  text-align: center;
  padding: 7rem 1.25rem;
}
.not-found .number {
  font-size: 8rem;
  font-weight: 900;
  color: var(--rie-orange);
  line-height: 1;
  margin-bottom: 1rem;
}
.not-found h2 { margin-bottom: 1rem; }
.not-found p  { color: var(--rie-gray); margin-bottom: 2.5rem; }

/* ===========================
   ANIMATIONS
=========================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate { opacity: 0; }
.animate.visible { animation: fadeInUp .6s ease forwards; }
.animate-delay-1 { animation-delay: .1s; }
.animate-delay-2 { animation-delay: .2s; }
.animate-delay-3 { animation-delay: .3s; }
.animate-delay-4 { animation-delay: .4s; }
.animate-delay-5 { animation-delay: .5s; }

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 768px) {
  .section { padding: 3.5rem 0; }

  .navbar-nav { display: none; }
  .navbar-toggle { display: block; }
  .navbar-mobile.open { display: flex; }

  .hero { padding: 3rem 0 2rem; }
  .hero-stats { gap: 1.25rem; }

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

  .footer-top .container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .cta-band { padding: 3.5rem 0; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: center; }
  .cta-band-actions { flex-direction: column; align-items: center; }
  .hero-stats { flex-direction: column; gap: 1rem; }
  .btn { width: 100%; justify-content: center; }
}
