/* Variables y Configuración Base */
:root {
  --color-primary: #151E57; /* Azul Marino Institucional */
  --color-secondary: #050716; /* Azul Noche / Footer */
  --color-accent: #1D4ED8; /* Azul Interactivo */
  --color-accent-hover: #2563EB;
  --color-light: #F8FAFC; /* Gris Neutro Claro */
  --color-white: #FFFFFF;
  --color-text: #333333;
  --color-text-muted: #666666;
  
  --font-family: 'Inter', 'Roboto', system-ui, -apple-system, sans-serif;
  --transition: all 0.3s ease;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 0.5rem;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background-color: var(--color-light);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: var(--color-accent);
  transition: var(--transition);
}

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

ul {
  list-style: none;
}

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-primary);
  line-height: 1.2;
  margin-bottom: 1rem;
}

/* Botones */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

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

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

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

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

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

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

/* Encabezado y Navegación */
.top-bar {
  background-color: var(--color-secondary);
  color: var(--color-white);
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-links a {
  color: var(--color-white);
  margin-right: 1rem;
}

.top-bar-links a:hover {
  color: var(--color-light);
}

.top-bar-social a {
  color: var(--color-white);
  margin-left: 1rem;
}

.header {
  background-color: var(--color-white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

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

.navbar-logo img {
  height: 50px;
}

.navbar-logo span {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-primary);
}

.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-menu a {
  color: var(--color-text);
  font-weight: 500;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--color-accent);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-primary);
  cursor: pointer;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: var(--color-white);
  padding: 6rem 0;
  text-align: center;
}

.hero h1 {
  color: var(--color-white);
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.25rem;
  max-width: 800px;
  margin: 0 auto 2rem;
  opacity: 0.9;
}

/* Secciones Generales */
.section {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background-color: var(--color-accent);
  margin: 1rem auto 0;
  border-radius: 2px;
}

/* Grid y Tarjetas */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }

.card {
  background-color: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  transition: var(--transition);
  text-align: center;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  font-size: 3rem;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

/* Noticias / Comunicados */
.news-card {
  background-color: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.news-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background-color: #ddd;
}

.news-content {
  padding: 1.5rem;
}

.news-date {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  display: block;
}

.news-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

/* Banner Institucional / Indicadores */
.metrics {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: 4rem 0;
  text-align: center;
}

.metric-item h3 {
  color: var(--color-white);
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.metric-item p {
  font-size: 1.125rem;
  opacity: 0.9;
}

/* Footer */
.footer {
  background-color: var(--color-secondary);
  color: var(--color-white);
  padding: 4rem 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  color: var(--color-white);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background-color: var(--color-accent);
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--color-light);
  opacity: 0.8;
}

.footer-links a:hover {
  opacity: 1;
  padding-left: 5px;
}

.footer-contact li {
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  opacity: 0.8;
}

.footer-contact i {
  color: var(--color-accent);
  margin-top: 5px;
}

.footer-bottom {
  background-color: #03040a;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.875rem;
  opacity: 0.8;
}

/* Tablas (Documentos) */
.table-container {
  overflow-x: auto;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

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

tr:hover {
  background-color: #f1f5f9;
}

/* Formularios */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  font-family: var(--font-family);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

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

/* Acordeón (Servicios) */
.accordion {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid #eee;
}

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

.accordion-header {
  padding: 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-white);
  transition: var(--transition);
}

.accordion-header:hover {
  background: #f8fafc;
}

.accordion-content {
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease;
}

.accordion-item.active .accordion-content {
  padding: 1.5rem;
  max-height: 500px;
}

.accordion-item.active .accordion-header i {
  transform: rotate(180deg);
}

.accordion-header i {
  transition: transform 0.3s ease;
}

/* Modales / Alertas */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-white);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 90%;
  text-align: center;
  transform: translateY(-20px);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-icon {
  font-size: 3rem;
  color: #10B981;
  margin-bottom: 1rem;
}

/* Responsividad */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--color-white);
    flex-direction: column;
    gap: 0;
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
  }
  
  .nav-menu.active {
    max-height: 400px;
  }
  
  .nav-menu a {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: block;
    text-align: center;
  }
  
  .top-bar-links {
    display: none;
  }
  
  .top-bar .container {
    justify-content: center;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
}
