/* =========================================================================
   TCON – Tributaria Consultores
   Hoja de estilos principal
   -------------------------------------------------------------------------
   Índice:
   1. Reset & variables (tokens de marca)
   2. Tipografía base
   3. Utilidades / layout
   4. Botones
   5. Header / navegación
   6. Hero
   7. Sobre nosotros
   8. Servicios
   9. Por qué elegirnos
   10. Contacto / formulario
   11. Footer
   12. Animaciones (scroll reveal, reduced motion)
   13. Responsive
   ========================================================================= */

/* ---------- 1. RESET & VARIABLES ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

:root {
  /* Paleta de marca */
  --navy: #0B2341;
  --navy-2: #132C52;
  --navy-soft: #1D3A63;
  --white: #FFFFFF;
  --gray-50: #F5F6F8;
  --gray-100: #EAEDF2;
  --gray-300: #D3D9E3;
  --gray-500: #6B7686;
  --gray-600: #4A5568;
  --gold: #C7A256;
  --gold-light: #DDB973;
  --gold-dark: #A9843F;

  /* Tipografía */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Radios y sombras */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 26px;
  --shadow-sm: 0 2px 10px rgba(11, 35, 65, 0.06);
  --shadow-md: 0 12px 32px rgba(11, 35, 65, 0.10);
  --shadow-lg: 0 24px 60px rgba(11, 35, 65, 0.16);

  /* Layout */
  --container-w: 1180px;
  --header-h: 84px;
  --ease: cubic-bezier(.22,1,.36,1);
}

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--gray-600);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

ul { list-style: none; margin: 0; padding: 0; }

.icon { width: 1em; height: 1em; }

svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 2. TIPOGRAFÍA ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .6em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 4.4vw, 3.6rem); font-weight: 600; }
h2 { font-size: clamp(1.9rem, 3vw, 2.5rem); }
h3 { font-size: 1.2rem; margin-bottom: .5em; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--navy); color: var(--white);
  padding: 12px 20px; z-index: 999; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* Foco visible accesible */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- 3. UTILIDADES / LAYOUT ---------- */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 108px 0; }

.section-eyebrow {
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 14px;
}
.section-eyebrow-light { color: var(--gold-light); }

.section-head { max-width: 680px; margin-bottom: 56px; }
.section-head-light h2 { color: var(--white); }
.section-lead { font-size: 1.08rem; color: var(--gray-500); }

/* Marca decorativa: tres barras ascendentes (firma visual recurrente) */
.brand-mark {
  display: inline-flex; align-items: flex-end; gap: 3px; height: 16px;
}
.brand-mark span { display: block; width: 4px; background: var(--gold); border-radius: 2px; }
.brand-mark span:nth-child(1) { height: 60%; }
.brand-mark span:nth-child(2) { height: 100%; }
.brand-mark span:nth-child(3) { height: 75%; }

/* ---------- 4. BOTONES ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 30px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .96rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
  white-space: nowrap;
}
.btn-sm { padding: 11px 20px; font-size: .88rem; }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--gray-300);
}
.btn-ghost:hover {
  border-color: var(--navy);
  transform: translateY(-2px);
}

/* ---------- 5. HEADER ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 500;
  border-bottom: 1px solid transparent;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), height .3s var(--ease);
}
.site-header.is-scrolled {
  height: 68px;
  border-bottom-color: var(--gray-100);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
}

.brand { display: flex; align-items: center; }
.brand-logo { height: 42px; width: auto; transition: height .3s var(--ease); }
.site-header.is-scrolled .brand-logo { height: 36px; }

.main-nav ul { display: flex; gap: 34px; }
.main-nav a {
  font-size: .95rem; font-weight: 500; color: var(--navy);
  position: relative; padding: 6px 0;
}
.main-nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--gold); transition: width .3s var(--ease);
}
.main-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 18px; }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; background: none; border: none; cursor: pointer;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--navy); margin: 0 auto; transition: transform .3s var(--ease), opacity .3s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 6. HERO ---------- */
.hero {
  padding: calc(var(--header-h) + 72px) 0 96px;
  background: var(--white);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 64px;
  align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .82rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-dark); margin-bottom: 22px;
}
.eyebrow-mark { width: 34px; height: 1.5px; background: var(--gold); display: inline-block; }

.hero h1 { color: var(--navy); margin-bottom: .5em; }

.hero-subtitle {
  font-size: 1.18rem;
  color: var(--gray-500);
  max-width: 46ch;
  margin-bottom: 2.1em;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 46px; }

.hero-trust { display: flex; flex-wrap: wrap; gap: 26px; }
.hero-trust li { display: flex; align-items: center; gap: 9px; font-size: .9rem; color: var(--navy); font-weight: 500; }
.hero-trust svg { width: 18px; height: 18px; color: var(--gold-dark); flex-shrink: 0; }

.hero-visual { position: relative; }
.hero-visual img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; height: auto;
  aspect-ratio: 5 / 6;
  object-fit: cover;
}

.hero-card {
  position: absolute; left: -18px; bottom: -22px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 20px 24px;
  display: flex; align-items: center; gap: 14px;
  max-width: 260px;
}
.hero-card p { margin: 0; font-size: .92rem; color: var(--navy); line-height: 1.4; }
.hero-card-mark {
  width: 8px; height: 44px; border-radius: 4px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
}

/* ---------- 7. SOBRE NOSOTROS ---------- */
.nosotros { background: var(--gray-50); }

.about-grid {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  gap: 64px;
  align-items: start;
}

.about-copy h2 { color: var(--navy); }
.about-copy p { color: var(--gray-600); font-size: 1.03rem; }

.about-values { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.value-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 26px 24px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.value-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }
.value-card:nth-child(5) { grid-column: 1 / -1; }

.value-index {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--gold-dark);
  font-weight: 600;
  margin-bottom: 10px;
}
.value-card p { font-size: .93rem; color: var(--gray-500); }

/* ---------- 8. SERVICIOS ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.service-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 50px; height: 50px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--navy), var(--navy-soft));
  color: var(--gold-light);
  margin-bottom: 20px;
}
.service-icon svg { width: 24px; height: 24px; }

.service-card h3 { color: var(--navy); }
.service-card p { font-size: .93rem; color: var(--gray-500); margin: 0; }

/* ---------- 9. POR QUÉ ELEGIRNOS ---------- */
.why {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  position: relative;
}
.why::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(199,162,86,.16) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: .5;
  pointer-events: none;
}
.why .container { position: relative; }

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.why-card {
  background: var(--navy);
  padding: 40px 32px;
  transition: background-color .3s var(--ease);
}
.why-card:hover { background: var(--navy-soft); }

.why-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px;
  color: var(--gold);
  margin-bottom: 18px;
}
.why-icon svg { width: 26px; height: 26px; }

.why-card h3 { color: var(--white); }
.why-card p { color: rgba(255,255,255,.68); font-size: .92rem; margin: 0; }

/* ---------- 10. CONTACTO ---------- */
.contacto { background: var(--white); }

.contact-grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 72px;
  align-items: start;
}

.contact-info h2 { color: var(--navy); }

.contact-details { margin-top: 40px; display: flex; flex-direction: column; gap: 26px; }
.contact-details li { display: flex; align-items: flex-start; gap: 16px; }
.contact-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 12px;
  background: var(--gray-50);
  color: var(--gold-dark);
}
.contact-icon svg { width: 22px; height: 22px; }
.contact-details strong { display: block; color: var(--navy); font-size: .95rem; margin-bottom: 2px; }
.contact-details a, .contact-details span { color: var(--gray-500); font-size: .95rem; }
.contact-details a:hover { color: var(--gold-dark); }

.contact-mark {
  margin-top: 56px;
  width: 64px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.contact-form-wrap {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 44px;
}

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

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: .84rem; font-weight: 600; color: var(--navy);
  margin-bottom: 8px; letter-spacing: .01em;
}
.form-group input, .form-group textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: .96rem;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
  resize: vertical;
}
.form-group input:focus, .form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(199,162,86,.18);
  outline: none;
}
.form-group input.is-invalid, .form-group textarea.is-invalid {
  border-color: #C0442F;
}

.form-error {
  display: block;
  min-height: 18px;
  font-size: .78rem;
  color: #C0442F;
  margin-top: 6px;
}

.form-note { font-size: .82rem; color: var(--gray-500); margin-bottom: 22px; }

.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(11,35,65,.25);
  border-top-color: var(--navy);
  border-radius: 50%;
  display: none;
  animation: spin .7s linear infinite;
}
.is-loading .btn-spinner { display: inline-block; }
.is-loading .btn-label { opacity: .7; }
.is-loading { cursor: progress; }

@keyframes spin { to { transform: rotate(360deg); } }

.form-feedback {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  display: none;
}
.form-feedback.is-success {
  display: block;
  background: #E7F3EA;
  color: #276440;
  border: 1px solid #BFE0C8;
}
.form-feedback.is-error {
  display: block;
  background: #FBEAE7;
  color: #9A2E1B;
  border: 1px solid #F2C4BA;
}

/* ---------- 11. FOOTER ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,.75); }

.footer-inner {
  padding: 64px 0 40px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
}

.footer-brand img { margin-bottom: 16px; }
.footer-brand p { font-size: .88rem; color: rgba(255,255,255,.55); max-width: 32ch; }

.footer-nav { display: flex; flex-direction: column; gap: 12px; }
.footer-nav a { font-size: .92rem; color: rgba(255,255,255,.72); transition: color .25s var(--ease); }
.footer-nav a:hover { color: var(--gold-light); }

.footer-contact { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.footer-contact a { font-size: .92rem; color: var(--gold-light); }
.footer-contact span { font-size: .86rem; color: rgba(255,255,255,.55); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 22px 0;
}
.footer-bottom p { margin: 0; font-size: .8rem; color: rgba(255,255,255,.45); text-align: center; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; right: 26px; bottom: 26px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold-light);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
  z-index: 400;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top svg { width: 20px; height: 20px; }
.back-to-top:hover { background: var(--navy-soft); }

/* ---------- 12. ANIMACIONES / SCROLL REVEAL ---------- */
[data-animate] { opacity: 0; }
.is-visible[data-animate="fade-up"] { animation: fadeUp .8s var(--ease) forwards; }
.is-visible[data-animate="fade-in"] { animation: fadeIn 1s var(--ease) forwards; }
.is-visible[data-animate="fade-up-stagger"] { opacity: 1; }
.is-visible[data-animate="fade-up-stagger"] > * {
  animation: fadeUp .7s var(--ease) forwards;
  opacity: 0;
}
.is-visible[data-animate="fade-up-stagger"] > *:nth-child(1) { animation-delay: .05s; }
.is-visible[data-animate="fade-up-stagger"] > *:nth-child(2) { animation-delay: .12s; }
.is-visible[data-animate="fade-up-stagger"] > *:nth-child(3) { animation-delay: .19s; }
.is-visible[data-animate="fade-up-stagger"] > *:nth-child(4) { animation-delay: .26s; }
.is-visible[data-animate="fade-up-stagger"] > *:nth-child(5) { animation-delay: .33s; }
.is-visible[data-animate="fade-up-stagger"] > *:nth-child(6) { animation-delay: .40s; }
.is-visible[data-animate="fade-up-stagger"] > *:nth-child(7) { animation-delay: .47s; }
.is-visible[data-animate="fade-up-stagger"] > *:nth-child(8) { animation-delay: .54s; }
.is-visible[data-animate="fade-up-stagger"] > *:nth-child(9) { animation-delay: .61s; }
.is-visible[data-animate="fade-up-stagger"] > *:nth-child(10) { animation-delay: .68s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-animate], .is-visible[data-animate] > * { animation: none !important; opacity: 1 !important; transform: none !important; }
  * { transition-duration: 0.001ms !important; }
}

/* ---------- 13. RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid, .about-grid, .contact-grid { gap: 44px; }
}

@media (max-width: 900px) {
  .main-nav { position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: var(--white); padding: 34px 24px; transform: translateX(100%);
    transition: transform .35s var(--ease); overflow-y: auto; }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; gap: 6px; }
  .main-nav a { display: block; padding: 16px 4px; font-size: 1.1rem; border-bottom: 1px solid var(--gray-100); }
  .nav-toggle { display: flex; }
  .header-actions .btn-sm { display: none; }

  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 420px; margin: 0 auto 12px; }
  .hero-card { left: 0; }

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

  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .section { padding: 76px 0; }
  .hero { padding-top: calc(var(--header-h) + 40px); }
  .services-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .about-values { grid-template-columns: 1fr; }
  .value-card:nth-child(5) { grid-column: auto; }
  .form-row { grid-template-columns: 1fr; }
  .contact-form-wrap { padding: 28px; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-card { position: static; margin-top: 16px; max-width: none; }
}
