/* ============================================================
   PROPULSA - Sistema de diseño compartido
   Paleta tomada del prototipo de Figma
   ============================================================ */

:root {
  --primary: #aa348b;
  --primary-dark: #8a2a70;
  --primary-light: #fce7f6;
  --secondary: #10b981;
  --secondary-dark: #0d9668;
  --secondary-light: #d1fae5;

  --background: #ffffff;
  --foreground: #1a1a2e;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --accent: #fce7f6;
  --accent-foreground: #6b1555;
  --destructive: #ef4444;

  --border: rgba(0, 0, 0, 0.08);
  --input-background: #f8fafc;

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.18);

  /* Tipografía de marca:
     - Nunito Sans: jerarquía principal (h1) y todo el texto de lectura
     - Montserrat: jerarquía secundaria (h2-h4) y elementos de interfaz (botones, nav) */
  --font-primary: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-secondary: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family: var(--font-primary);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family);
  color: var(--foreground);
  background: var(--background);
  line-height: 1.5;
}

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

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

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-family: var(--font-primary);
}

h2, h3, h4 {
  font-family: var(--font-secondary);
}

p {
  margin: 0;
}

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

.container-md {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  font-family: var(--font-secondary);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}
.btn-secondary:hover {
  background: var(--secondary-dark);
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary-light);
}

.btn-white {
  background: #fff;
  color: var(--primary);
}
.btn-white:hover {
  background: rgba(255, 255, 255, 0.9);
}

.btn-ghost-white {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.btn-ghost-white:hover {
  background: rgba(255, 255, 255, 0.3);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.field label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="date"],
.field input[type="month"],
.field select,
.field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--input-background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: var(--font-family);
  outline: none;
  transition: box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  box-shadow: 0 0 0 3px var(--primary-light);
  border-color: var(--primary);
}

.field textarea {
  resize: vertical;
  min-height: 90px;
}

.field-hint {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  margin-top: 0.4rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Tarjetas ---------- */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-padded {
  padding: 2rem;
}

/* ---------- Chips / tags seleccionables ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: #fff;
  color: var(--foreground);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--primary);
}

.chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.chip.selected.secondary-chip {
  background: var(--secondary);
  border-color: var(--secondary);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

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

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex: none;
  background: var(--muted);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  font-family: var(--font-secondary);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-text .brand-name {
  font-family: var(--font-secondary);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  color: var(--primary);
  text-transform: uppercase;
}

.logo-text .brand-tagline {
  font-family: var(--font-primary);
  font-size: 0.72rem;
  color: var(--muted-foreground);
}

@media (max-width: 1280px) {
  .logo-text .brand-tagline {
    display: none;
  }
}

/* Bloque de marcas: Propulsa | Municipalidad */
.brand-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-width: 0;
}

.brand-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex: none;
}

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

.muni-logo .logo-icon {
  width: 40px;
  height: 40px;
}

/* Dibujo del logo teñido de lila: el PNG blanco se usa como máscara y se recorta solo el dibujo */
.muni-mark {
  height: 35px;
  width: auto;
  flex: none;
}

.muni-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.muni-name {
  font-family: var(--font-secondary);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--foreground);
}

.muni-sub {
  font-family: var(--font-secondary);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

@media (max-width: 640px) {
  .muni-text {
    display: none;
  }
}

@media (max-width: 480px) {
  .brand-divider,
  .muni-logo {
    display: none;
  }
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
}

/* Links simples del nav (Inicio, Crear perfil, Ver vacantes, Cursos, Recursos) */
.nav-link {
  font-family: var(--font-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--foreground);
  padding: 0.35rem 0.65rem;
  white-space: nowrap;
  border-radius: 999px;
  transition: all 0.15s ease;
}

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

/* Página activa: pill sólida con el color de marca (persona/lila) */
.nav-link.active {
  background: var(--primary);
  color: #fff;
}

.nav-link.active:hover {
  color: #fff;
}

/* Separador entre navegación y acciones de empresa */
.nav-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 0.4rem;
  height: 20px;
}

/* Acciones de empresa: pills en verde, siguiendo la regla de color
   persona = lila (primary) / empresa = verde (secondary) */
.nav-pills {
  display: flex;
  gap: 0.3rem;
}

.nav-pill {
  font-family: var(--font-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nav-pill-empresa {
  background: var(--secondary-light);
  color: var(--secondary-dark);
}

.nav-pill-empresa:hover,
.nav-pill-empresa.active {
  background: var(--secondary);
  color: #fff;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  font-size: 1.3rem;
  cursor: pointer;
}

@media (max-width: 980px) {
  .main-nav {
    display: none;
  }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: #fff;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    gap: 0.75rem;
    z-index: 50;
  }
  .main-nav.open .nav-link,
  .main-nav.open .nav-pill {
    text-align: center;
  }
  .nav-divider {
    display: none;
  }
  .main-nav.open .nav-pills {
    flex-direction: column;
    margin-top: 0.5rem;
  }
  .nav-toggle {
    display: inline-flex;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--muted);
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.site-footer a { color: var(--muted-foreground); }
.site-footer a:hover { color: var(--primary); }

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.4fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-grid h4 {
  color: var(--foreground);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Marca: Propulsa, línea fina horizontal y logo de la Municipalidad */
.footer-brand .logo { display: inline-flex; }

.footer-rule {
  display: block;
  width: 100%;
  max-width: 260px;
  height: 1px;
  background: var(--border);
  margin: 1rem 0;
}

.footer-muni {
  font-family: var(--font-secondary);
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.75rem;
}

.footer-contact li { display: flex; align-items: center; gap: 0.6rem; }
.footer-contact a { color: var(--primary); }
.footer-contact .icon { color: var(--primary); display: inline-flex; width: 18px; height: 18px; }
.footer-contact .icon svg { width: 18px; height: 18px; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  font-size: 0.85rem;
  text-align: center;
  color: var(--muted-foreground);
}

/* ---------- Utilidades ---------- */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-muted { color: var(--muted-foreground); }
/* Iconos SVG inyectados por js/icons.js */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  flex: none;
}

.icon svg {
  width: 100%;
  height: 100%;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-family: var(--font-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-foreground);
}

/* ---------- Menú "Explorar" del encabezado ---------- */
.nav-menu { position: relative; margin-left: 0.4rem; }

.nav-menu-btn {
  font-size: 1.15rem;
  line-height: 1;
  width: 38px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--foreground);
  cursor: pointer;
  white-space: nowrap;
}

.nav-menu-btn:hover { color: var(--primary); border-color: var(--primary); }

.nav-menu-list {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 230px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.4rem;
  z-index: 60;
}

.nav-menu.open .nav-menu-list { display: flex; flex-direction: column; }

.nav-menu-list a {
  font-family: var(--font-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--foreground);
}

.nav-menu-list a:hover { background: var(--muted); color: var(--primary); }

@media (max-width: 980px) {
  .nav-menu { margin-left: 0; }
  .nav-menu-btn { display: none; }
  .nav-menu-list { display: flex; flex-direction: column; position: static; box-shadow: none; border: 0; border-top: 1px solid var(--border); border-radius: 0; margin-top: 0.4rem; text-align: center; }
}

/* Pie de página con 4 columnas */

/* Volver al inicio */
.back-link { display: inline-block; margin-bottom: 1.25rem; font-size: 0.9rem; font-weight: 600; color: var(--muted-foreground); }
.back-link:hover { color: var(--foreground); }

/* Descripción de tareas en Servicios */
.service-desc { font-size: 0.9rem; }
.service-desc strong { display: block; font-family: var(--font-secondary); font-size: 0.8rem; color: var(--primary-dark); margin-bottom: 0.2rem; }
.service-desc p { margin: 0 0 0.3rem; color: var(--muted-foreground); }

/* ---------- Pie de página lila con círculos ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--primary), var(--primary-dark));
  border-top: 0;
  color: rgba(255, 255, 255, 0.85);
}

.site-footer::before,
.site-footer::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  pointer-events: none;
  animation: footer-float 20s ease-in-out infinite;
}

.site-footer::before { width: 360px; height: 360px; left: -90px; bottom: -160px; }
.site-footer::after { width: 460px; height: 460px; right: -120px; top: -200px; animation-duration: 26s; animation-delay: -6s; }

@keyframes footer-float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(18px, -16px); }
}

@media (prefers-reduced-motion: reduce) {
  .site-footer::before, .site-footer::after { animation: none; }
}

.site-footer .container { position: relative; z-index: 1; }

.site-footer a { color: rgba(255, 255, 255, 0.85); }
.site-footer a:hover { color: #fff; }

.footer-grid h4,
.footer-muni { color: #fff; }

.footer-rule,
.footer-bottom { border-color: rgba(255, 255, 255, 0.25); }
.footer-rule { background: rgba(255, 255, 255, 0.3); }

.footer-bottom { color: rgba(255, 255, 255, 0.75); }

.footer-contact a,
.footer-contact .icon { color: #fff; }

/* Logos en blanco sobre el fondo lila */
.site-footer .logo-text .brand-name { color: #fff; }
.site-footer .muni-name { color: #fff; }
.site-footer .muni-mark { filter: brightness(0) invert(1); }
.site-footer .logo-icon { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.5); color: #fff; }
