/* ==========================================================================
   ACH Servicios Contables — Estilos principales
   Stack: HTML5 + CSS3 vanilla, mobile-first
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Variables CSS
   -------------------------------------------------------------------------- */
:root {
  --color-primary: #0B3542;
  --color-white: #FFFFFF;
  --color-grey-light: #F4F6F7;
  --color-grey-mid: #E0E4E6;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', Arial, sans-serif;
  --transition-base: 0.3s ease;
  --shadow-card: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-card-hover: 0 8px 32px rgba(0,0,0,0.18);
}

/* --------------------------------------------------------------------------
   2. Reset base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --------------------------------------------------------------------------
   3. Body
   -------------------------------------------------------------------------- */
body {
  font-family: var(--font-sans);
  color: var(--color-primary);
  background: var(--color-white);
  font-size: 16px;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   4. Tipografía
   -------------------------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--font-serif);
}

/* --------------------------------------------------------------------------
   5. Animaciones de scroll (con @supports para fallback sin JS/animaciones)
   -------------------------------------------------------------------------- */
@supports (animation-name: test) {
  .animate-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   6. Animaciones de entrada del Hero
   -------------------------------------------------------------------------- */
.hero-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.hero-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   7. Layout — Container y secciones (mobile-first, base < 768px)
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

section {
  padding: 4rem 0;
}

section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   8. Botones CTA
   -------------------------------------------------------------------------- */
.btn-cta {
  display: inline-block;
  background: #25D366;
  color: #fff;
  padding: 0.875rem 2rem;
  border-radius: 50px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
  transition: background var(--transition-base), transform var(--transition-base);
  cursor: pointer;
  border: none;
}

.btn-cta:hover,
.btn-cta:focus {
  background: #1da851;
  transform: translateY(-2px);
}

/* Variante primaria: fondo blanco, texto color primario */
.btn-cta-primary {
  background: var(--color-white);
  color: var(--color-primary);
}

.btn-cta-primary:hover,
.btn-cta-primary:focus {
  background: var(--color-grey-light);
}

/* --------------------------------------------------------------------------
   9. Services Grid — responsive
   -------------------------------------------------------------------------- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --------------------------------------------------------------------------
   10. Social Grid — responsive
   -------------------------------------------------------------------------- */
.social-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 768px) {
  .social-grid {
    flex-direction: row;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   11. Hero Section — Parallax
   -------------------------------------------------------------------------- */
#hero {
  position: relative;
  color: var(--color-white);
  text-align: center;
  padding: 7rem 0 6rem;
  overflow: hidden;
  isolation: isolate;
}

/* Capa de imagen parallax difuminada */
#hero::before {
  content: '';
  position: absolute;
  inset: -40px;
  background-image: url('Parallax.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  filter: blur(4px) brightness(0.35);
  z-index: -2;
  transform: translateY(var(--parallax-offset, 0px));
}

/* En móviles, desactivar fixed y usar la variable JS */
@media (max-width: 767px) {
  #hero::before {
    background-attachment: scroll;
  }
}

/* Overlay de color primario semitransparente para mantener la identidad de marca */
#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(11, 53, 66, 0.72) 0%,
    rgba(11, 53, 66, 0.55) 100%
  );
  z-index: -1;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.hero-logo {
  width: 140px;
  height: auto;
}

.hero-title {
  font-size: 2.2rem;
  color: var(--color-white);
  line-height: 1.2;
  max-width: 700px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.85);
  max-width: 560px;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3rem;
  }

  .hero-logo {
    width: 180px;
  }
}

/* --------------------------------------------------------------------------
   12. Service Cards
   -------------------------------------------------------------------------- */
#servicios {
  background: var(--color-grey-light);
}

.service-card {
  background: var(--color-white);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.service-icon {
  color: var(--color-primary);
  width: 48px;
  height: 48px;
}

.service-icon svg {
  width: 100%;
  height: 100%;
}

.service-card h3 {
  font-size: 1.2rem;
  color: var(--color-primary);
}

.service-card p {
  font-size: 0.95rem;
  color: #4a6572;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   13. Social Proof Section
   -------------------------------------------------------------------------- */
#redes-sociales {
  background: var(--color-white);
  text-align: center;
}

.social-subtitle {
  color: #4a6572;
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

.social-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 2.5rem;
  border-radius: 16px;
  border: 2px solid var(--color-grey-mid);
  text-decoration: none;
  color: var(--color-primary);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
  min-width: 200px;
}

.social-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-card);
  transform: translateY(-3px);
}

.social-card-name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
}

.social-card-handle {
  font-size: 0.9rem;
  color: #4a6572;
}

/* --------------------------------------------------------------------------
   14. Floating WhatsApp Button
   -------------------------------------------------------------------------- */
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.3); }
  50%  { opacity: 1; transform: scale(1.1); }
  70%  { transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

#whatsapp-flotante {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,0.4);
  animation: bounceIn 0.5s ease 1.5s both;
  transition: background var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}

#whatsapp-flotante:hover,
#whatsapp-flotante:focus {
  background: #1da851;
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37,211,102,0.5);
}

/* --------------------------------------------------------------------------
   15. Footer y formulario de contacto
   -------------------------------------------------------------------------- */
#contacto {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 4rem 0 2rem;
}

#contacto h2 {
  color: var(--color-white);
  text-align: center;
  margin-bottom: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

label {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
}

input,
textarea {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1.5px solid var(--color-grey-mid);
  font-family: var(--font-sans);
  font-size: 1rem;
  background: rgba(255,255,255,0.08);
  color: var(--color-white);
  transition: border-color var(--transition-base);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #25D366;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255,255,255,0.4);
}

.field-error {
  color: #ff6b6b;
  font-size: 0.82rem;
  min-height: 1rem;
}

.success-message {
  background: rgba(37,211,102,0.15);
  border: 1px solid #25D366;
  color: #25D366;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.footer-social {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

.footer-social h3 {
  color: var(--color-white);
  margin-bottom: 0.5rem;
}

.footer-social a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color var(--transition-base);
}

.footer-social a:hover {
  color: var(--color-white);
}

.copyright {
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* --------------------------------------------------------------------------
   16. Header sticky y navegación
   -------------------------------------------------------------------------- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--color-primary);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-white);
}

.header-logo img {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: contain;
}

.header-brand {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-white);
}

#main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

#main-nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color var(--transition-base);
}

#main-nav a:hover,
#main-nav a:focus {
  color: var(--color-white);
}

.nav-cta {
  background: #25D366;
  color: #fff !important;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-weight: 600;
}

.nav-cta:hover {
  background: #1da851;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

@media (max-width: 767px) {
  #site-header {
    position: relative;
  }

  .menu-toggle {
    display: flex;
  }

  #main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-primary);
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }

  #main-nav.nav-open {
    display: block;
  }

  #main-nav ul {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   17. Splash Screen — Animación de carga
   -------------------------------------------------------------------------- */
#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#splash.splash-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  animation: splashReveal 0.7s ease both;
}

@keyframes splashReveal {
  from { opacity: 0; transform: translateY(24px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.splash-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 16px;
  animation: splashPulse 1.4s ease-in-out infinite;
}

@keyframes splashPulse {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 0px rgba(37,211,102,0)); }
  50%       { transform: scale(1.06); filter: drop-shadow(0 0 18px rgba(37,211,102,0.55)); }
}

.splash-tagline {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.08em;
  animation: splashReveal 0.7s ease 0.2s both;
}

.splash-bar {
  width: 180px;
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 99px;
  overflow: hidden;
  animation: splashReveal 0.7s ease 0.3s both;
}

.splash-bar-fill {
  height: 100%;
  width: 0%;
  background: #25D366;
  border-radius: 99px;
  animation: splashLoad 1.6s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards;
}

@keyframes splashLoad {
  0%   { width: 0%; }
  60%  { width: 80%; }
  100% { width: 100%; }
}
