/* ==========================================================================
   CSS SYSTEM - AGROSERVICIOS INTEGRA
   Estilo Premium para Consultoría Técnica y Cumplimiento Agrícola
   ========================================================================== */

/* Importación de fuentes premium */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* Variables de Diseño */
:root {
  /* Paleta de colores */
  --primary: #1b4332;         /* Bosque Oscuro (Dominante) */
  --primary-light: #2d6a4f;   /* Verde Hoja */
  --primary-ultra-light: #d8f3dc; /* Menta suave */
  --accent: #d4a373;          /* Oro Trigo (Acento) */
  --accent-hover: #b58453;    /* Oro Trigo Oscurecido */
  --dark: #121212;            /* Carbón */
  --dark-soft: #2b2b2b;       /* Gris carbón suave */
  --light: #f8f9fa;           /* Crema/Arena suave */
  --white: #ffffff;           /* Blanco puro */
  --border-color: #e9ecef;    /* Bordes suaves */
  
  /* Estados de validación */
  --success: #2a9d8f;
  --error: #e76f51;
  --info: #457b9d;

  /* Tipografía */
  --font-headings: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Tamaños fluidos */
  --step--2: clamp(0.78rem, 0.77rem + 0.03vw, 0.80rem);
  --step--1: clamp(0.94rem, 0.92rem + 0.08vw, 1.00rem);
  --step-0: clamp(1.13rem, 1.09rem + 0.17vw, 1.25rem);
  --step-1: clamp(1.35rem, 1.29rem + 0.30vw, 1.56rem);
  --step-2: clamp(1.62rem, 1.52rem + 0.50vw, 1.95rem);
  --step-3: clamp(1.94rem, 1.79rem + 0.79vw, 2.44rem);
  --step-4: clamp(2.33rem, 2.11rem + 1.19vw, 3.05rem);
  --step-5: clamp(2.80rem, 2.48rem + 1.74vw, 3.82rem);

  /* Espaciado */
  --space-xs: clamp(0.50rem, 0.48rem + 0.09vw, 0.56rem);
  --space-s: clamp(1.00rem, 0.96rem + 0.17vw, 1.13rem);
  --space-m: clamp(1.50rem, 1.43rem + 0.35vw, 1.69rem);
  --space-l: clamp(2.00rem, 1.91rem + 0.43vw, 2.25rem);
  --space-xl: clamp(3.00rem, 2.87rem + 0.65vw, 3.38rem);
  --space-2xl: clamp(4.00rem, 3.83rem + 0.87vw, 4.50rem);
  
  /* Bordes y Sombras */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(27, 67, 50, 0.08), 0 4px 6px -2px rgba(27, 67, 50, 0.03);
  --shadow-lg: 0 20px 25px -5px rgba(27, 67, 50, 0.12), 0 10px 10px -5px rgba(27, 67, 50, 0.04);
  
  /* Transiciones */
  --transition-smooth: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enlace de Salto para Accesibilidad (WCAG 2.4.1) */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-m);
  background-color: var(--accent);
  color: var(--primary);
  padding: 0.8rem 1.6rem;
  font-family: var(--font-headings);
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 9999;
  transition: top 0.3s ease;
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--primary);
}

/* Reset y Estilos de Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--light);
  color: var(--dark-soft);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Accesibilidad: Foco de teclado consistente */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

/* Evitar scroll horizontal */
body {
  overflow-x: hidden;
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  color: var(--primary);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: var(--space-s);
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); font-weight: 500; }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p {
  margin-bottom: var(--space-m);
  color: var(--dark-soft);
  max-width: 75ch; /* Longitud óptima para lectura */
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
}

/* Contenedor Principal */
.container {
  width: 90%;
  max-width: 1200px;
  margin-inline: auto;
}

/* Componentes Globales */

/* Botones Premium */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.6rem;
  font-family: var(--font-headings);
  font-weight: 500;
  font-size: var(--step--1);
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
  position: relative;
  overflow: hidden;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--primary-light);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background-color: var(--accent);
  color: var(--primary);
}

.btn-accent:hover {
  background-color: var(--accent-hover);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline:hover {
  background-color: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

/* Header & Navegación (Glassmorphism sutil en scroll) */
.header {
  position: sticky;
  top: 0;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: var(--transition-fast);
}

.header--scrolled {
  background-color: rgba(27, 67, 50, 0.98);
  box-shadow: var(--shadow-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header--scrolled .nav-link {
  color: rgba(255, 255, 255, 0.85);
}

.header--scrolled .nav-link:hover,
.header--scrolled .nav-link.active {
  color: var(--accent);
}

.header--scrolled .logo-text {
  color: var(--white);
}

.header--scrolled .logo-accent {
  color: var(--accent);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-s) 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
  fill: var(--primary-light);
}

.header--scrolled .logo-icon {
  fill: var(--accent);
}

.logo-text {
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: var(--step-1);
  color: var(--primary);
  letter-spacing: -0.5px;
}

.logo-accent {
  color: var(--primary-light);
}

.nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: var(--space-m);
  align-items: center;
}

.nav-link {
  font-family: var(--font-headings);
  font-weight: 500;
  font-size: var(--step--1);
  color: var(--dark-soft);
  position: relative;
  padding: 0.25rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

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

/* Menú móvil (Burger) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1100;
}

.menu-toggle-icon {
  width: 24px;
  height: 2px;
  background-color: var(--primary);
  display: block;
  position: relative;
  transition: var(--transition-fast);
}

.header--scrolled .menu-toggle-icon {
  background-color: var(--white);
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
  content: '';
  width: 24px;
  height: 2px;
  background-color: inherit;
  position: absolute;
  left: 0;
  transition: var(--transition-fast);
}

.menu-toggle-icon::before { top: -8px; }
.menu-toggle-icon::after { top: 8px; }

/* Estado activo del botón hamburguesa */
.menu-toggle[aria-expanded="true"] .menu-toggle-icon {
  background-color: transparent;
}
.menu-toggle[aria-expanded="true"] .menu-toggle-icon::before {
  transform: rotate(45deg);
  top: 0;
  background-color: var(--primary);
}
.menu-toggle[aria-expanded="true"] .menu-toggle-icon::after {
  transform: rotate(-45deg);
  top: 0;
  background-color: var(--primary);
}

/* Hero Section */
.hero {
  padding: var(--space-2xl) 0;
  background: radial-gradient(circle at 80% 20%, rgba(212, 163, 115, 0.08) 0%, transparent 60%),
              radial-gradient(circle at 10% 80%, rgba(27, 67, 50, 0.05) 0%, transparent 50%),
              var(--white);
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.hero-title {
  font-size: var(--step-5);
  line-height: 1.1;
  margin-bottom: var(--space-m);
}

.hero-subtitle {
  font-size: var(--step-0);
  color: var(--dark-soft);
  margin-bottom: var(--space-l);
}

.hero-btns {
  display: flex;
  gap: var(--space-s);
  flex-wrap: wrap;
}

/* Gráficos vectoriales SVG dinámicos */
.hero-illustration {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.svg-agro-element {
  animation: float 6s ease-in-out infinite;
}

.svg-agro-element-delay {
  animation: float 6s ease-in-out infinite 3s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* Grid de Servicios */
.section {
  padding: var(--space-2xl) 0;
}

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

.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
  max-width: 60ch;
  margin-inline: auto;
}

.section-label {
  display: inline-block;
  font-family: var(--font-headings);
  font-size: var(--step--2);
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-l);
}

/* Tarjetas de Servicios y Contenido */
.card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-l);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-ultra-light);
}

.card-icon-wrapper {
  background-color: var(--primary-ultra-light);
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-m);
}

.card-icon {
  width: 32px;
  height: 32px;
  fill: var(--primary);
}

.card-title {
  margin-bottom: var(--space-xs);
}

.card-text {
  font-size: var(--step--1);
  color: var(--dark-soft);
  flex-grow: 1;
}

.card-link {
  margin-top: var(--space-m);
  font-family: var(--font-headings);
  font-weight: 600;
  font-size: var(--step--1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.card-link svg {
  transition: var(--transition-fast);
}

.card-link:hover svg {
  transform: translateX(4px);
}

/* Sección de Transparencia de Trámites */
.transparent-section {
  background-color: var(--primary);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.transparent-section::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(212, 163, 115, 0.12) 0%, transparent 70%);
  z-index: 1;
}

.transparent-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-xl);
  align-items: center;
  position: relative;
  z-index: 2;
}

.transparent-content h2, 
.transparent-content p {
  color: var(--white);
}

.transparent-content h2 {
  font-size: var(--step-3);
  margin-bottom: var(--space-m);
}

.transparent-content p {
  opacity: 0.9;
  font-size: var(--step-0);
  margin-bottom: var(--space-l);
}

.notice-box {
  background-color: rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--accent);
  padding: var(--space-m);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: var(--space-l);
}

.notice-title {
  color: var(--accent) !important;
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-xs);
  font-weight: 700;
}

.notice-text {
  font-size: var(--step--1) !important;
  margin-bottom: 0 !important;
}

/* Buscador de Trámites e Interfaz de Trámites */
.search-wrapper {
  background: var(--white);
  padding: var(--space-m);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-xl);
}

.search-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-s);
}

.search-input {
  border: 1px solid var(--border-color);
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--step--1);
  color: var(--dark);
  width: 100%;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-ultra-light);
}

.procedures-list {
  display: grid;
  gap: var(--space-m);
}

.procedure-item {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: var(--space-m);
  transition: var(--transition-smooth);
}

.procedure-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-ultra-light);
}

.procedure-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-s);
}

.procedure-title {
  margin-bottom: 0;
  font-size: var(--step-0);
  font-weight: 600;
}

.procedure-badge {
  font-family: var(--font-headings);
  font-size: var(--step--2);
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  background-color: var(--primary-ultra-light);
  color: var(--primary);
}

.procedure-body {
  font-size: var(--step--1);
  margin-bottom: var(--space-m);
}

.procedure-meta {
  display: flex;
  gap: var(--space-m);
  font-size: var(--step--2);
  color: #666;
}

.procedure-meta span strong {
  color: var(--dark-soft);
}

/* Checklist Interactivo */
.checklist-wrapper {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: var(--space-l);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-xl);
}

.checklist-title {
  font-size: var(--step-1);
  margin-bottom: var(--space-m);
  border-bottom: 2px solid var(--primary-ultra-light);
  padding-bottom: var(--space-xs);
}

.checklist-list {
  list-style: none;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-s);
  padding: var(--space-s) 0;
  border-bottom: 1px solid var(--border-color);
}

.checklist-item:last-child {
  border-bottom: none;
}

.checklist-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  margin-top: 0.25rem;
  cursor: pointer;
}

.checklist-label {
  font-size: var(--step--1);
  cursor: pointer;
  transition: var(--transition-fast);
}

.checklist-checkbox:checked + .checklist-label {
  text-decoration: line-through;
  color: #888;
}

/* Acordeón FAQ */
.faq-accordion {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-s);
  overflow: hidden;
  transition: var(--transition-fast);
}

.faq-trigger {
  width: 100%;
  background: none;
  border: none;
  padding: var(--space-m);
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-headings);
  font-size: var(--step-0);
  font-weight: 500;
  color: var(--primary);
  transition: var(--transition-fast);
}

.faq-trigger:hover {
  background-color: var(--primary-ultra-light);
}

.faq-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.faq-trigger[aria-expanded="true"] .faq-icon {
  transform: rotate(180deg);
}

.faq-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  padding: 0 var(--space-m);
  background-color: #fafbfc;
}

.faq-trigger[aria-expanded="true"] + .faq-panel {
  max-height: 1000px;
  padding: var(--space-m);
  transition: max-height 0.4s cubic-bezier(1, 0, 1, 0);
  border-top: 1px solid var(--border-color);
}

/* Tabla Comparativa */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin: var(--space-xl) 0;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--step--1);
  background-color: var(--white);
}

.comparison-table th, 
.comparison-table td {
  padding: var(--space-m);
  border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
  background-color: var(--primary);
  color: var(--white);
  font-family: var(--font-headings);
  font-weight: 600;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr:nth-child(even) td {
  background-color: rgba(27, 67, 50, 0.02);
}

.check-icon {
  fill: var(--success);
  width: 20px;
  height: 20px;
}

/* Formularios Accesibles */
.form-group {
  margin-bottom: var(--space-m);
}

.form-label {
  display: block;
  font-family: var(--font-headings);
  font-weight: 500;
  font-size: var(--step--1);
  margin-bottom: var(--space-xs);
  color: var(--primary);
}

.form-control {
  width: 100%;
  padding: 0.8rem 1.2rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--step--1);
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-ultra-light);
}

.form-error-msg {
  color: var(--error);
  font-size: var(--step--2);
  margin-top: var(--space-xs);
  display: none;
}

.form-group.has-error .form-control {
  border-color: var(--error);
}

.form-group.has-error .form-error-msg {
  display: block;
}

/* Footer Premium */
.footer {
  background-color: var(--dark);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-2xl) 0 var(--space-l) 0;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-brand h3 {
  color: var(--white);
  margin-bottom: var(--space-m);
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--step--1);
}

.footer-links h4 {
  color: var(--white);
  margin-bottom: var(--space-m);
}

.footer-links-list {
  list-style: none;
}

.footer-links-list li {
  margin-bottom: var(--space-xs);
}

.footer-links-list a {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--step--1);
}

.footer-links-list a:hover {
  color: var(--accent);
  padding-left: 4px;
}

.footer-socials {
  display: flex;
  gap: var(--space-s);
  margin-top: var(--space-m);
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--white);
  transition: var(--transition-fast);
}

.footer-social-link:hover {
  background-color: var(--accent);
  color: var(--primary);
  transform: translateY(-2px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: var(--space-m);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-s);
  font-size: var(--step--2);
}

/* Media Queries (Responsive) */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-xl);
  }
  
  .hero-btns {
    justify-content: center;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-l);
  }
  
  .transparent-grid {
    grid-template-columns: 1fr;
    gap: var(--space-l);
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  
  .nav-list {
    position: fixed;
    top: 73px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--white);
    flex-direction: column;
    padding: var(--space-2xl) 0;
    gap: var(--space-l);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.77,0.2,0.05,1.0);
    z-index: 999;
    box-shadow: var(--shadow-lg);
  }
  
  .nav-list.open {
    transform: translateX(0);
  }
  
  .nav-link {
    font-size: var(--step-0);
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
